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 |
发个代码,纪念又一个水题#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