HDU 1846 Brave Game

/*

巴什博弈

当取的石子总数为b + 1的倍数时,先取必败,

因为对手每次都能凑出b + 1的倍数,通过取

1......b的一种情况。

*/



#include<stdio.h>



int main()

{

    int a, b, t;

    scanf("%d", &t);

    while(t --)

    {

        scanf("%d%d", &a, &b);

        a = a % (b + 1);

        puts((a) ? "first" : "second");

    }

    return 0;

}

 

你可能感兴趣的:(game)