Zzzz was secretly playing Spider Solitaire. Sometimes he won, sometimes he lost. Feeling someone's gaze, he stopped playing and started coding. Believing he'd evaded suspicion, he resumed the game. Then, during his brief coding stint, he noticed a noticeable improvement in his gaming skills.
Now, Zzzz won't lose in any future games. However, since he can't delete his game records, he believes his poor performances from the past don't prove his current prowess.
The game record looks like this:
Given X and Y, write a program to find the minimum number of times Zzzz must play the game before Z changes.
Each line contains integers X and Y.
On the first line, print the minimum number of rounds Zzzz needs to play. If Z never changes, print -1.
10 8
1
100 80
6
47 47
-1
99000 0
1000
| 編號 | 身分 | 題目 | 主題 | 人氣 | 發表日期 |
|
沒有發現任何「解題報告」
|
|||||