#include int pole[18]; int i,j,k,x; int N,num,ok; int poc,poc2; int cislo; int aaa(int cis) { if (cis <= 20) { if (pole[cis-2] == 1) return(1); else return(0); } return(0); } int main() { scanf("%d\n",&N); for (i = 0; i < N; i++) { for (x = 0; x < 18; x++ ) pole[x] = 0; printf("Scenerio %d:\n",i+1); scanf("%d\n",&num); for (j = 0; j < num; j++ ) { scanf("%d",&cislo); getchar(); pole[cislo-2] = 1; } poc = 0; for (j = 0; j < 18; j++){ if (pole[j] == 1) poc++; /* printf("%d",pole[j]);*/ } /* printf("%d", poc); */ if ((poc % 2) == 0) printf("There is no winning move.\n"); else { printf("The winning moves are:"); poc2 = 0; ok = 0; for (j = 0; j < 18; j++) { poc2 = 0; if (pole[j] == 1) { poc2++; for (k = 2; k <= 20; k++) { if (aaa((j+2)*k) == 1) poc2++; if (aaa((j+2)+k) == 1 && aaa(k) != 1) poc2++; for (x = 2; k <= 20; k++) { if (aaa((j+2)*x+k) == 1 && aaa(k) != 1) poc2++; } } } if ((poc2 % 2) != 0) { printf(" %d",j+2); } } printf(".\n"); } } return(0); }