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

测试数据

Posted by dawei007 at 2010-04-24 18:14:48 on Problem 3619
10 6
1 10 1
1 1 1
6 6 0
10 1 1
7 7 7
100 100 100
-------------
10 6
1 10 1
10
1 1 1
19
6 6 0
2
10 1 1
1
7 7 7
2

#include<stdio.h>
int main()
{
	int n,k;
	scanf("%d %d",&n,&k);
	while(k--)
	{
		int s,t,r,i,j;
		scanf("%d %d %d",&s,&t,&r);
		j=n%(s*t);
		if(j==0)
		{
			i=n/(s*t);
			printf("%d\n",i*(t+r)-r);
		}
		else
		{
			i=n/(s*t);
			int m=0;
			while(m*s<j)
				++m;
			printf("%d\n",i*(t+r)+m);
		}
	}
	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