题意:整本书N页,k组,s页/分钟,一次持续t分钟,需休息r分钟
/*
* POJ_3619_1.cpp
*
* Created on: 2013年11月26日
* Author: Administrator
*/
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
int n, k;
while (scanf("%d%d", &n, &k) != EOF) {
while (k--) {
int s, t, r;
scanf("%d%d%d", &s, &t, &r);
int page = 0, time = 0, rtime = 0;
while (true) {
page += s;
time++;
rtime++;
if (page >= n) {
break;
}
if (rtime % t == 0) {//***每t分钟休息r分钟
time += r;
}
}
printf("%d\n", time);
}
}
return 0;
}