硬币 对称博弈

title: 题目
 [Coin Game](https://vjudge.csgrandeur.cn/problem/HDU-3951)
有n个硬币环形摆放,两人轮流取硬币,每次可以取 1 - k 个连续的硬币,你的任务是判断谁能胜出
例如:10枚硬币编号从1到10 K等于3,因为1和10是连续的,你可以拿走连续的10 1 2,但是如果2被拿走了,你不能拿走1 3 4,因为1和3不是连续的。
谁先拿到最后一个硬币谁赢
title: input
2
3 1
3 2
title: output
Case 1: first
Case 2: second
title: 思路
 
首先对于一串硬币, 没有首尾相接的时候:
1 2 3 4 5 6 7 8 9 10 (k = 2)
我们只需要先手把中间的 5 6 拿掉
1 2 3 4     7 8 9 10
之后对称着拿就行, 总是胜的。
k = 1时则只能是奇数时胜。
 
首尾相接后, 第一个操作之后就会化为一串硬币, 同理:
后手只要把中间的拿掉就赢。
 
所有我们只有两种情况能赢:
1. k >= n(一次拿完)
2. k == 1 && n % 2(n为奇数且k为1)
title:代码
~~~ c ++
#include <iostream>
using namespace std;
int main()
{
 
    int T;
    cin >> T;
    for (int kase = 1; kase <= T; kase++)
    {
        int n, k;
        cin >> n >> k;
        if (n <= k || (n % 2 && k == 1))
            cout << "Case " << kase << ": "
                 << "first\n";
        else
            cout << "Case " << kase << ": "
                 << "second\n";
    }
 
    return 0;
}
~~~