Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

2673 无辙了,请帮忙!

Posted by ACM30413 at 2005-10-16 21:09:02
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator