| 比赛 | 16暑期热身练习 | 评测结果 | WWWWWWWWWW |
|---|---|---|---|
| 题目名称 | 阅读大赛 | 最终得分 | 0 |
| 用户昵称 | W | 运行时间 | 0.004 s |
| 代码语言 | C++ | 内存使用 | 0.31 MiB |
| 提交时间 | 2016-07-01 11:29:38 | ||
#include<stdio.h>
int main(){
//freopen ("read.in", "r", stdin);
//freopen ("read.out", "w", stdout);
int n,k,i,v,t,w,ts;
scanf("%d%d",&n,&k);
for(i=0;i<k;i++){
scanf("%d%d%d",&v,&t,&w);
ts=n/v;
if(n%v!=0)ts++;
if(ts%t==0){
ts+=(ts/t)*w;
ts-=w;
}
else ts+=(ts/t)*w;
printf("%d\n",ts);
}
return 0;
}