Two numbers a and B always have a situation of B, a % B, which is inevitable. If a> = B & a <2 * B, then there is only one case, directly to B, a % B. Otherwise, there are multiple cases.
For a/B = 1, only B, a % B can be selected. If a/B> = 2, you can first select who will face the situation like B and a % B.
Obviously, players are smart enough. B. It is clear who wins and loses B. First-hand players must win in a/B> = 2.
[Cpp]
# Include <iostream>
# Include <cstdio>
# Include <cstring>
# Include <algorithm>
# Include <cmath>
# Include <vector>
# Include <string>
# Include <map>
# Define LL long
# Define N 1000000
# Define inf 1 <20
Using namespace std;
Int main (){
Int a, B;
While (scanf ("% d", & a, & B )! = EOF & a + B ){
If (a <B)
Swap (a, B );
Bool stan = true;
While (1 ){
If (B = 0 | a % B = 0 | a/B> = 2) break;
Int t =;
A = B;
B = t-;
Stan =! Stan;
}
If (stan)
Printf ("Stan wins \ n ");
Else www.2cto.com
Printf ("Ollie wins \ n ");
}
Return 0;
}
By ACM_cxlove