21793_Warcraf

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

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

Pro.ID

21793

Title

Warcraft

Title链接

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

AC

10

Submit

15

Ratio

66.67%

时间&空间限制

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

    Have you ever played the Warcraft? It doesn't matter whether you have played it! We will give you such an experience. There are so many Heroes in it, but you could only choose one of them. Each Hero has his own skills. When such a Skill is used , it costs some MagicValue, but hurts the Boss at the same time. Using the skills needs intellegence, one should hurt the enemy to the most when using certain MagicValue.

    Now we send you to complete such a duty to kill the Boss(So cool~~). To simplify the problem : you can assume the LifeValue of the monster is 100, your LifeValue is 100, but you have also a 100 MagicValue! You can choose to use the ordinary Attack (which doesn't cost MagicValue), or a certain skill (in condition that you own this skill and the MagicValue you have at that time is no less than the skill costs), there is no free lunch so that you should pay certain MagicValue after you use one skill! But we are good enough to offer you a "ResumingCirclet" (with which you can resume the MagicValue each seconds), But you can't own more than 100 MagicValue and resuming MagicValue is always after you attack. The Boss is cruel, be careful!

    输入

    There are several test cases, intergers n, t and q ( 0 < n ≤ 100, 1 ≤ t ≤ 5, q > 0 ) in the first line which mean you own n kinds of skills, and the "ResumingCirclet" helps you resume t points of MagicValue per second and q is of course the hurt points of LifeValue the Boss attack you each time (we assume when fighting in a second the attack you show is before the Boss). Then n lines follow, each has 2 intergers ai and bi ( 0 < ai, bi ≤ 100 ). which means using i skill costs you ai MagicValue and costs the Boss bi LifeValue. The last case is n=t=q=0.

    输出

    Description

    Have you ever played the Warcraft? It doesn't matter whether you have played it! We will give you such an experience. There are so many Heroes in it, but you could only choose one of them. Each Hero has his own skills. When such a Skill is used , it costs some MagicValue, but hurts the Boss at the same time. Using the skills needs intellegence, one should hurt the enemy to the most when using certain MagicValue.

    Now we send you to complete such a duty to kill the Boss(So cool~~). To simplify the problem : you can assume the LifeValue of the monster is 100, your LifeValue is 100, but you have also a 100 MagicValue! You can choose to use the ordinary Attack (which doesn't cost MagicValue), or a certain skill (in condition that you own this skill and the MagicValue you have at that time is no less than the skill costs), there is no free lunch so that you should pay certain MagicValue after you use one skill! But we are good enough to offer you a "ResumingCirclet" (with which you can resume the MagicValue each seconds), But you can't own more than 100 MagicValue and resuming MagicValue is always after you attack. The Boss is cruel, be careful!

    Input

    There are several test cases, intergers n, t and q ( 0 < n ≤ 100, 1 ≤ t ≤ 5, q > 0 ) in the first line which mean you own n kinds of skills, and the "ResumingCirclet" helps you resume t points of MagicValue per second and q is of course the hurt points of LifeValue the Boss attack you each time (we assume when fighting in a second the attack you show is before the Boss). Then n lines follow, each has 2 intergers ai and bi ( 0 < ai, bi ≤ 100 ). which means using i skill costs you ai MagicValue and costs the Boss bi LifeValue. The last case is n=t=q=0.

    Output

    Output an interger min (the minimun time you need to kill the Boss) in one line. But if you die (the LifeValue is no more than 0), output "My god"!

    Sample Input

    4 2 25
    10 5
    20 10
    30 28
    76 70
    4 2 25
    10 5
    20 10
    30 28
    77 70
    0 0 0

    Sample Output

    4
    My god

    Hint

    When fighting, you can only choose one kind of skill or just to use the  ordinary attack in the whole second, the ordinary attack costs the Boss 1 points of LifeValue, the Boss can only use ordinary attack which costs a whole second at a time. Good Luck To You!

    Source

    样例输入

    4 2 25
    10 5
    20 10
    30 28
    76 70
    4 2 25
    10 5
    20 10
    30 28
    77 70
    0 0 0

    样例输出

    4
    My god

    提示

    When fighting, you can only choose one kind of skill or just to use the  ordinary attack in the whole second, the ordinary attack costs the Boss 1 points of LifeValue, the Boss can only use ordinary attack which costs a whole second at a time. Good Luck To You!


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部