| ||||||||||
| 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 init(int x,int y)
{
if(x%y==0)
return x/y;
else
return x/y+1;
}
int main()
{
int n,k,s,t,r;
scanf("%d%d",&n,&k);
while(k--)
{
scanf("%d%d%d",&s,&t,&r);
printf("%d\n",init(n,s)+(init(init(n,s),t)-1)*r);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator