| 比赛 | 16暑期热身练习 | 评测结果 | AWAWAAAWWW |
|---|---|---|---|
| 题目名称 | 阅读大赛 | 最终得分 | 50 |
| 用户昵称 | 5458 | 运行时间 | 0.031 s |
| 代码语言 | C++ | 内存使用 | 0.28 MiB |
| 提交时间 | 2016-07-01 10:59:52 | ||
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
freopen("read.in","r",stdin);
freopen("read.out","w",stdout);
int n,k,s,t,r;//n页的书
cin>>n>>k;
for(int i=0;i<k;i++){
int p=n,tt=0;
cin>>s>>t>>r;
int cs=(p/(s*t));
tt+=cs*(t+r);
p-=cs*(s*t);
while(p>0){
tt++;
p-=s;
}
cout<<tt<<endl;
}
return 0;
}