对于任意状态(x,y)如果x>=2*y则先手必胜。原因很简单,假设m=x%y,如果(y,m)是必胜状态,则先手只用取到y+m,由于y
#include
#include
#include
#define LL unsigned long long
#define sswap(a,b) (a^=b^=a^=b)
using namespace std;
LL n,m,T,pos;
char s[3][20]={"Stan wins","Ollie wins"};
int main(){
scanf("%llu",&T);
while(T--){
scanf("%llu%llu",&n,&m);
if(n0){
pos^=1;
if(n>=m*2)break;
n-=m;
sswap(n,m);
}
printf("%s\n",s[pos]);
}
return 0;
}