Sim Card
InterviewTime limit2sMemory limit512 MB
For each student, compute the smallest total cost of call minutes and data across the three fixed operator price plans.
- Level
Easy1 of 10
- Topics
- Implementation, Brute force, Math
- Solved
- No attempts yet
Problem
Iran has three mobile operators. Each operator charges a different price for calls and for data, as listed in the table below. All prices are in Rials.
Several foreign students came to Iran for a programming contest. Each student already knows how many minutes of calls and how many megabytes of data they will use. For each student, recommend the operator that makes the total of the call charge and the data charge as small as possible.
Input
Each line of the input holds the information of one student: two positive integers and (), the call time in minutes and the data usage in megabytes. The input ends with a line 0 0, which you do not process.
Output
For each student, print the minimum total of the call charge and the data charge on its own line, in input order.