|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||71||69||68||97.143%|
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)|
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.
10 60 100 20 24 12 900 400 50 50 0 0
1600 3800 1200 43000 3000