Pro.ID21168 TitlePizza Pricing Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21168 AC7 Submit8 Ratio87.50% 时间&空间限制描述Pizza has always been a staple on college campuses. After the downturn in the economy, it is more important than ever to get the best deal, namely the lowest cost per square inch. Consider, for example, the following menu for a store selling circular pizzas of varying diameter and price:
One could actually compute the costs per square inch, which would be approximately 10.2¢, 7.6¢, and 7.1¢ respectively, so the Your task is to analyze a menu and to report the diameter of the pizza that is the best value. Note that no two pizzas on a menu will have the same diameter or the same inherent cost per square inch. 输入The input contains a series of one or more menus. Each menu starts with the number of options N, 1 ≤ N ≤ 10, followed by N lines, each containing two integers respectively designating a pizza's diameter D (in inches) and price P (in dollars), with 1 ≤ D ≤ 36 and 1 ≤ P ≤ 100. The end of the input will be designated with a line containing the number 0. 输出Description Pizza has always been a staple on college campuses. After the downturn in the economy, it is more important than ever to get the best deal, namely the lowest cost per square inch. Consider, for example, the following menu for a store selling circular pizzas of varying diameter and price:
One could actually compute the costs per square inch, which would be approximately 10.2¢, 7.6¢, and 7.1¢ respectively, so the Your task is to analyze a menu and to report the diameter of the pizza that is the best value. Note that no two pizzas on a menu will have the same diameter or the same inherent cost per square inch. Input The input contains a series of one or more menus. Each menu starts with the number of options N, 1 ≤ N ≤ 10, followed by N lines, each containing two integers respectively designating a pizza's diameter D (in inches) and price P (in dollars), with 1 ≤ D ≤ 36 and 1 ≤ P ≤ 100. The end of the input will be designated with a line containing the number 0. Output For each menu, print a line identifying the menu number and the diameter D of the pizza with the best value, using the format shown below. Sample Input 3
5 2
10 6
12 8
3
5 2
10 5
12 8
4
1 1
24 33
13 11
6 11
0 Sample Output Menu 1: 12
Menu 2: 10
Menu 3: 24 Source 样例输入3
5 2
10 6
12 8
3
5 2
10 5
12 8
4
1 1
24 33
13 11
6 11
0 样例输出Menu 1: 12
Menu 2: 10
Menu 3: 24 作者 |