Problem - 1846
#include<bits/stdc++.h>
using namespace std;
int t,n,m;
signed main(){scanf("%d",&t);while(t--){scanf("%d%d",&n,&m);if(n%(m+1)==0) puts("second");else puts("first");}return 0;
}
Problem - 1846
#include<bits/stdc++.h>
using namespace std;
int t,n,m;
signed main(){scanf("%d",&t);while(t--){scanf("%d%d",&n,&m);if(n%(m+1)==0) puts("second");else puts("first");}return 0;
}