The first line of input contains the number of test cases T. The descriptions of the test cases
Each test case starts with a line containing the number of items n (1《n≤ 150 000) and the
the maximum number of The Imp's spells k (0≤ k < 9). The next n lines contain the items'
values and costs, the i-th line containing the numbers vi and ci, in that order (0≤ vi, ci≤ 10^6).