#t152. 身高体重指数排序
身高体重指数排序
BMI Sorting
Problem Description
A person's Body Mass Index (BMI) equals their weight (in kilograms) divided by the square of their height (in meters).
For example, a person weighing with a height of has a BMI of $50\text{ kg} / 1.6\text{ m} / 1.6\text{ m} = 19.53125\text{ kg/m}^2$.
There are now children; the -th child has id , weight , and height .
Sort the children by BMI from highest to lowest. The data guarantees that no two children have exactly the same BMI. Output the ids of the children after sorting.
Input Format
The input has lines:
- The first line is a positive integer , the number of children;
- The second line contains integers , the children's weights in ;
- The third line contains floating-point numbers , the children's heights in .
Output Format
Output one line containing numbers: the ids of the children sorted by BMI from highest to lowest.
Sample Input
3
45 33 39
1.55 1.33 1.44
Sample Output
3 1 2
Sample Explanation
The three children (with ids , , in order) have BMIs (rounded to two decimal places) of , , respectively, so after sorting the output ids are , , .
Constraints
, , , and each has exactly two decimal places.