The key parameters of the “gradual square pyramid” from the figures are stair depth (x) and stair height (y). Given the (x1,y1), (x2,y2), …, (xn,yn) pair sequence (n ≤ 20; xi < 100, yi < 10, i=1, …,n), find out the optimal succession that minimize the volume of the pyramid.
The first line of the input contains the number of the given test cases, after which each line contains a test case: the value of n, followed by pairs of integers representing the stair height and depth, separated by white characters: n y1 x1 y2 x2 … yn xn.
A line for each test case written to the standard output: the indexes of the height-depth pairs in the correct order, separated by spaces.
Output for Sample Input
|University of Debrecen; Faculty of Informatics; v. 03/01/2019|