Michelangelo wants to bring some order to his tool shed and decides to order his statues by size. Each statue approximates a cuboid (the 3D equivalent of a rectangle) described by the dimension of each side. The size of a statue is equal to the volume of the corresponding cuboid.
The input consists of several test cases. Each test case consists of a number of statues such that , followed by lines describing the statues. Each statue is described as where is an integer identifier and is the dimensions of the cuboid, satisfying .
For each test case, output the identifiers of the statues in order of increasing size. In case the size is equal, print the identifiers in increasing order. Print a blank line between each test case.
Author: Anders Jonsson
Generation: 2026-01-25T13:57:51.103Z
© Jutge.org, 2006–2026.
https://jutge.org