Logo
(追記) (追記ここまで)

4573번 - Pizza Pricing 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB25821318484.018%

문제

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:

Menu
Diameter Price
5 inch \2ドル
10 inch \6ドル
12 inch \8ドル

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.

입력

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.

출력

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.

제한

예제 입력 1

3
5 2
10 6
12 8
3
5 2
10 5
12 8
4
1 1
24 33
13 11
6 11
0

예제 출력 1

Menu 1: 12
Menu 2: 10
Menu 3: 24

힌트

출처

ICPC > Regionals > North America > Mid-Central Regional > 2011 Mid-Central Regional Programming Contest C번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /