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

15340번 - Sim Card 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB77269666090.784%

문제

There are three mobile operators in Iran. Each operator has different prices for call and data usage, given in the table below. All prices are in Rials:

# Name Call (per minute) Data (per megabyte)
1 ParsTel 30 40
2 ParsCell 35 30
3 ParsPhone 40 20

Some foreign students have arrived Iran to participate in the ACM-ICPC, Tehran Site. They already know how many minutes they will call, and how much Internet they will use. For each student, you want to recommend an operator to minimize the total cost of call usage and data usage for that student.

입력

Each line of the input contains the information of one student. For each student, there are two positive integers c and d (1 ≤ c, d ≤ 1000) that show the amount of call (in minutes) and data usage (in megabytes) for the student, respectively. The input terminates with “0 0” that should not be processed.

출력

For each student, print a line containing the minimum total cost of call usage and data usage.

제한

예제 입력 1

10 60
100 20
24 12
900 400
50 50
0 0

예제 출력 1

1600
3800
1200
43000
3000

힌트

출처

ICPC > Regionals > Asia West Continent > Iran > Tehran Site 2017 A번

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

출처

대학교 대회

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

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