http://acm.hdu.edu.cn/showproblem.php?pid=1846

最简单的博弈论

#include<iostream>
#include<cmath>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>

using namespace std;

int main()
{
    int C;
    cin>>C;
    while(C--)
    {
        int n,m;
        cin>>n>>m;
        if(n%(m+1)==0)
        {
            cout<<"second"<<endl;
        }
        else
        {
            cout<<"first"<<endl;
        }
    }
    return 0;
}

 

posted on 2012-05-11 08:58  夜->  阅读(137)  评论(0编辑  收藏  举报