| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
2673 无辙了,请帮忙!#include<iostream>
using namespace std;
//WA
int main()
{
int d,s,mint,m,t,x,a;
while(cin>>t>>x)
{
cin>>m;
if(m==0) {cout<<t*x<<endl;continue;}
mint=100000000;
while(m--)
{
cin>>d>>s;
a=(d-1)/s;
if(mint>a) mint=a;
}
if(mint>t) mint=t;
cout<<mint*x<<endl;
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator