电脑游戏AI (CI翻译)
Vasya’s elder brother Petya loves playing computer games. In one of his favourite computer games Petya reached the final level where a fight with the boss take place.
While playing the game Petya found spell scrolls and now he is about to use them. Let’s describe the way fighting goes on this level:
- The boss has two parameters:
$*max*$— the initial amount of health and$*reg*$— regeneration rate per second.
- Every scroll also has two parameters:
$*pow*_{*i*}$— spell power measured in percents — the maximal amount of health counted off the initial one, which allows to use the scroll (i.e. if the boss has more than$*pow*_{*i*}$percent of health the scroll cannot be used); and$*dmg*_{*i*}$the damage per second inflicted upon the boss if the scroll is used. As soon as a scroll is used it disappears and another spell is cast upon the boss that inflicts$*dmg*_{*i*}$of damage per second upon him until the end of the game.
During the battle the actions per second are performed in the following order: first the boss gets the damage from all the spells cast upon him, then he regenerates $*reg*$ of health (at the same time he can’t have more than $*max*$ of health), then the player may use another scroll (no more than one per second).
The boss is considered to be defeated if at the end of a second he has nonpositive ($≤ 0$) amount of health.
Help Petya to determine whether he can win with the set of scrolls available to him and if he can, determine the minimal number of seconds he needs to do it.
Input
输入格式
AI (CI翻译)The first line contains three integers $*N*$, $*max*$ and $*reg*$ ($1 ≤ *N*, *max*, *reg* ≤ 1000$) –– the amount of scrolls and the parameters of the boss. The next $*N*$ lines contain two integers $*pow*_{*i*}$ and $*dmg*_{*i*}$ each — the parameters of the $*i*$-th scroll ($0 ≤ *pow*_{*i*} ≤ 100$, $1 ≤ *dmg*_{*i*} ≤ 2000$).
第一行包含三个整数 $*N*$、$*max*$ 和 $*reg*$($1 ≤ *N*, *max*, *reg* ≤ 1000$)——卷轴数量以及首领的参数。接下来的 $*N*$ 行中,每行包含两个整数 $*pow*_{*i*}$ 和 $*dmg*_{*i*}$,表示第 $i$ 个卷轴的参数($0 ≤ *pow*_{*i*} ≤ 100$,$1 ≤ *dmg*_{*i*} ≤ 2000$)。AI (CI翻译)
Output
输出格式
AI (CI翻译)In case Petya can’t complete this level, output in the single line NO.
如果 Petya 无法完成这一关,单行输出 NO。AI (CI翻译)
Otherwise, output on the first line YES. On the second line output the minimal time after which the boss can be defeated and the number of used scrolls. In the next lines for each used scroll output space-separated number of seconds passed from the start of the battle to the moment the scroll was used and the number of the scroll. Scrolls are numbered starting from 1 in the input order. The first scroll is considered to be available to be used after $0$ seconds.
否则,第一行输出 YES。第二行输出首领被击败所需的最少时间,以及使用的卷轴数量。接下来的每一行中,对于每个使用的卷轴,输出从战斗开始到使用该卷轴时经过的秒数,以及卷轴编号,两者以空格分隔。卷轴按照输入顺序从 1 开始编号。第一个卷轴视为在经过 0 秒后即可使用。AI (CI翻译)
Output scrolls in the order they were used. It is not allowed to use scrolls after the boss is defeated.
按卷轴的使用顺序输出它们。首领被击败后,不允许再使用卷轴。AI (CI翻译)
样例
2 10 3
100 3
99 1
NO
2 100 10
100 11
90 9
YES
19 2
0 1
10 2
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。