The Shoemaker's Problem A shoemaker has N jobs (orders from customers) which he must do. The shoemaker can work on only one job each day. The jobs are numbered from 1 to N. The integer T_i (1 <= T_i <= 1000) describes the length of time in days it takes the shoemaker to finish job number i. For each day of delay before starting to work on job number i, the shoemaker must pay a fine of S_i (1 <= S_i <= 10000) cents. Your task is to help the shoemaker, writing a programme to find the sequence of jobs with minimal total fine. Input The input begins with a single positive integer on a line by itself indicating the number of the cases following, each of them as described below. This line is followed by a blank line, and there is also a blank line between two consecutive inputs. First line of input for each case contains an integer N (1 <= N <= 800000). The next N lines each contain two integers: the time T_i and fine S_i of each job in order. Output For each test case, the output must follow the description below. The outputs of two consecutive cases will be separated by a blank line. Your programme should print the sequence of job numbers that has the minimal possible fine. If multiple solutions are possible, print the first lexicographically. Each number in the sequence should be printed on a separate line. Sample Input ------------ 1 4 3 4 1 1000 2 2 5 5 Sample Output ------------- 2 1 3 4