(File IO): input: game.in output: game.out
time limit: 1000 ms space constraints: 262144 KB specific restrictions
Goto ProblemSet
Title Description
Xiaoyong and small is indeed good friends, they often play together. Today they play the game is this: there is a paved by a square stone floor, it is high
, the length is
. The following is an example
situation:
now they take turns in length and width, respectively, are placed above
and
rectangular stones, can be placed horizontally heel, but just laying on the floor on two square stone uncovered when someone can not put up his lose.
For example, a particular game might look like, real small stones placed horizontally on the left above, as follows:
then Xiaoyong stones horizontally on the right below, as follows:
The little real stone can not recapture, so he lost . Xiaoyong compare comity, he let small solid first place. Of course, the above method may not be the best, and now if they are very smart, you programmed judge who will win.
Enter
the first line an integer
indicates the number of test data. Then there
lines, each a behavioral test data, test data each has only one integer
。
Output
Output
lines of the corresponding test data output. For each result, if it is, then it wins Xiaoyong output
, or it is a small win real output
.
Sample input
1
1
Sample output
xiaoshi
Data range limit
Problem-solving ideas
optimal strategy game stone is such that, if the first place, to heel, or to be put either of the other methods, then, if the other horizontally, then it just above or just below a stone horizontally as if the other heel, heel also, according to this method, it is easy to get to this conclusion: when n is an odd little real win, win Xiaoyong otherwise.
Code
#include<iostream>
#include<cstring>
#include<string>
#include<cstdio>
#include<algorithm>
#include<iomanip>
#include<cmath>
int c,n;
int main(){
freopen("game.in","r",stdin);
freopen("game.out","w",stdout);
scanf("%d",&c);
for(int i=1;i<=c;i++)
{
scanf("%d",&n);
if(n%2!=0)
printf("xiaoshi\n");
else
printf("xiaoyong\n");
}
}