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 huangchang9001 at 2011-12-05 22:29:38 on Problem 3619
#include<stdio.h>
int N,K,S,T,R;
void main(){
	scanf("%d%d",&N,&K);
	while(K--){
		scanf("%d%d%d",&S,&T,&R);
		printf("%d\n",N%(S*T)==0?(T+R)*(N/(S*T))-R:(T+R)*(N/(S*T))+(N%(S*T))/S+(((N%(S*T))%S)==0?0:1));
	}
}

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