| 比赛 | 啦啦啦,一星期两次的水题赛 | 评测结果 | AAAAAAAAAA |
|---|---|---|---|
| 题目名称 | 阅读大赛 | 最终得分 | 100 |
| 用户昵称 | 奶猹 | 运行时间 | 0.062 s |
| 代码语言 | C++ | 内存使用 | 0.31 MiB |
| 提交时间 | 2014-10-28 18:06:08 | ||
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
int num,n,m;
int s,t,r;
int tmp,tot;
int main()
{
freopen("read.in","r",stdin);
freopen("read.out","w",stdout);
cin>>n>>m;
for(int i=1;i<=m;i++)
{
cin>>s>>t>>r;
num=0;
for (tot=1;num<n;tot++)
{
tmp=tot%(t+r);
if (tmp>=1&&tmp<=t)
num+=s;
}
tot--;
cout<<tot<<endl;
}
return 0;
}