21647_SpeedReading

2022-5-16 18:20| 发布者: Hocassian| 查看: 25| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-89505718836699-Problem List-采集的数据-后羿采集器.html

Pro.ID

21647

Title

Speed Reading

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21647

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    All K ( 1 ≤ K ≤ 1,000 ) of the cows are participating in Farmer John's annual reading contest. The competition consists of reading a single book with N ( 1 ≤ N ≤ 100,000 ) pages as fast as possible while understanding it.

    Cowihas a reading speed Si ( 1 ≤ Si ≤ 100 ) pages per minute, a maximum consecutive reading time Ti ( 1 ≤ Ti ≤ 100 ) minutes, and a minimum rest time Ri ( 1 ≤ Ri ≤ 100 ) minutes. The cow can read at a rate of Sipages per minute, but only for Timinutes at a time. After she stops reading to rest, she must rest for Riminutes before commencing reading again.

    Determine the number of minutes (rounded up to the nearest full minute) that it will take for each cow to read the book.

    输入

    * Line 1:   Two space-separated integers: N and K

    * Lines 2..K+1:   Line i+1 contains three space-separated integers: Si , Ti , and Ri

    输出

    Description

    All K ( 1 ≤ K ≤ 1,000 ) of the cows are participating in Farmer John's annual reading contest. The competition consists of reading a single book with N ( 1 ≤ N ≤ 100,000 ) pages as fast as possible while understanding it.

    Cowihas a reading speed Si ( 1 ≤ Si ≤ 100 ) pages per minute, a maximum consecutive reading time Ti ( 1 ≤ Ti ≤ 100 ) minutes, and a minimum rest time Ri ( 1 ≤ Ri ≤ 100 ) minutes. The cow can read at a rate of Sipages per minute, but only for Timinutes at a time. After she stops reading to rest, she must rest for Riminutes before commencing reading again.

    Determine the number of minutes (rounded up to the nearest full minute) that it will take for each cow to read the book.

    Input

    * Line 1:   Two space-separated integers: N and K

    * Lines 2..K+1:   Line i+1 contains three space-separated integers: Si , Ti , and Ri

    Output

    * Lines 1..K:   Line i should indicate how many minutes (rounded up to the nearest full minute) are required for cow i to read the whole book.

    Sample Input

    10 3
    2 4 1
    6 1 5
    3 3 3

    Sample Output

    6
    7
    7

    Source

    样例输入

    10 3
    2 4 1
    6 1 5
    3 3 3

    样例输出

    6
    7
    7

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部