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:
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
Sign-in question: Just two mins directly.
ac code.
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int a,b;
int main()
{
while(cin>>a>>b)
{
if(a==0&&b==0)
return 0;
else
{
long long ans=min(min(30*a+40*b,35*a+30*b),40*a+20*b);
cout<<ans<<endl;
}
}
return 0;
}
An APDU can be a command or a response to a command. The general format of the command APDU: CLA INS P1 P2 P2 Data P3 Data The general format for responding to APDUs: Data, SW1, SW1, SW2 The meaning o...
An APDU can be a command or a response to a command. The general format of the command APDU: CLA INS P1 P2 P3 Data The general format of the response APDU: Data SW1 SW2 The meaning of each byte is as ...
First of all, please make sure that you have set up EPC and ENB, and they can be connected (if the MME is connected, there will be a related display, and the ENB side will also display mme is associat...
//SIM card initialization...
6,SIMcard The main content of the SIM card includes the change of the status of the SIM card information. Among them, the state change is mainly reported from the Modem to the RIL daemon and finally r...
http://acm.csu.edu.cn:20080/csuoj/problemset/problem?pid=2027 Give full play to your English reading level, probably the three major operators. Only one operator can be used. You call and surf the Int...
Sim card operator obtains 1. Description SIM (Subscriber Identification Module): Subscriber identification module, the card is mainly used as the unique identity of the user. When the status of the SI...
// Get the TelephonyManager instance object final TelephonyManager tm = (TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE); // Get the number of SIM cards final int num...
How to use the development board to implement SIM function Directory name How to use the development board to implement SIM function Introduction Material preparation step common problem Related infor...
Why can't 80% of the code farmers can't do architects? >>> step: Enter Camera App -> Switch to VIDEO mode -> Turn on the flash -> Press POWER key lock screen -> Press ...