![](https://csdnimg.cn/release/download_crawler_static/3534862/bg2.jpg)
1001 Coin Game
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Problem Description
After hh has learned how to play Nim game, he begins to try another
coin game which seems much easier.
The game goes like this:
Two players start the game with a circle of n coins.
![](https://csdnimg.cn/release/download_crawler_static/3534862/bg3.jpg)
They take coins from the circle in turn and every time they could
take 1~K continuous coins.
(imagining that ten coins numbered from 1 to 10 and K equal to 3,
since 1 and 10 are continuous, you could take away the continuous 10
, 1 , 2 , but if 2 was taken away, you couldn't take 1, 3, 4,
because 1 and 3 aren't continuous)
The player who takes the last coin wins the game.
Suppose that those two players always take the best moves and never
make mistakes.
Your job is to find out who will definitely win the game.
Input
The first line is a number T(1<=T<=100), represents the number of
case. The next T blocks follow each indicates a case.
Each case contains two integers N(3<=N<=10
9
,1<=K<=10).
Output
For each case, output the number of case and the winner "first" or
"second".(as shown in the sample output)
Sample Input
2
3 1
3 2
Sample Output
Case 1: first
Case 2: second
1002 Fruit Ninja
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Problem Description
Fruit Ninja is a popular classic game. During the game, fruits will
up to the air, and your aim is cut as more fruits as possible with a
line.
![](https://csdnimg.cn/release/download_crawler_static/3534862/bg4.jpg)
Even if the line touch a point of a fruit, the fruit also be cut.
Input
The first line is a number T(1<=T<=30), represents the number of
case. The next T blocks follow each indicates a case.
The first line of each case contains one integer N (1<=N<=10)
Then N lines follow, each line contains a integer K(3<=K<=10),
represent the number points of the fruit, then K*2 integers follow,
each two integers represent one point of the fruit.(with
anticlockwise order)
I promise all fruits are convex polygon, and any two fruit have no
common point.
Output
For each case, output the number of case and the maximum fruits you
could cut with a line.(as shown in the sample output)
Sample Input
2
3
3 0 0 1 0 1 1
3 1 2 2 1 2 2
3 3 1 3 0 4 0
3
4 0 0 1 0 1 1 0 1
4 2 0 3 0 3 1 2 1
4 0 99 1 99 1 100 0 100
Sample Output
Case 1: 3
Case 2: 2
![](https://csdnimg.cn/release/download_crawler_static/3534862/bg5.jpg)
1003 I'll play a trick on you
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Problem Description
Please look the picture carefully. Then I'll give you two integers
and your task is output the third one.
Please never doubt the picture.
Input
The first line is a number T(1<=T<=30), represents the number of
case. The next T blocks follow each indicates a case.
Each case contains two integers A,B (1<=B<=A<=10
100
)
Output