UVA 12293 - Box Game Shipu Ahamed - 01 Sep 2020 Problem PDFSolution:/*#include int main() { long long n; while(scanf("%lld",&n)==1) { if(n==0) break; else { int p=1; while(p #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define MP make_pair #define PB push_back #define foreach(e,x) for(__typeof(x.begin()) e=x.begin(); e!=x.end(); ++ e) using namespace std; typedef pair PII; typedef long long LL; typedef unsigned long long ULL; typedef long double LD; int N; char buf[20]; void solve() { scanf("%d%s", &N, buf); if (buf[0] == 'A') { -- N; if (N % 3 == 0) puts("Bob"); else puts("Alice"); } else { if (N % 3 == 0) puts("Alice"); else puts("Bob"); } } int main() { int T; scanf("%d", &T); for(int i = 1; i <= T; ++ i) { printf("Case %d: ", i); solve(); } return 0; } https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/12293/12293.cpp