F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Pizza Pricing

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 386    Accepted Submission(s): 258


Problem 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 12-inch pizza is the best value. However, if the 10-inch had been sold for $5, it would have been the best value, at approximately 6.4¡é per square inch.
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
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-18 18:55:27, Gzip enabled