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 |
Re:发个代码,纪念又一个水题In Reply To:发个代码,纪念又一个水题 Posted by:huangchang9001 at 2011-12-05 22:29:38 > #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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator