Statues

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.

Input

The input consists of several test cases. Each test case consists of a
number N of statues such that 2 ≤ N ≤ 1000, followed by N lines
describing the statues. Each statue is described as id, x, y, z where id
is an integer identifier and (x, y, z) is the dimensions of the cuboid,
satisfying 1 ≤ x, y, z ≤ 1000.

Output

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.

Problem information

Author: Anders Jonsson

Generation: 2026-01-25T13:57:51.103Z

© Jutge.org, 2006–2026.
https://jutge.org
