#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int c,n,m;
cin>>c;
while (c--)
{
cin>>n>>m;
if (n%(m+1)==0)
cout<<"second"<<endl;
else
cout<<"first"<<endl;
system ("pause");
}
}
http://acm.hdu.edu.cn/showproblem.php?pid=1846
这题主要是把规律找出来...........规律就是当n%(m+1)时成立