Skip to content

Instantly share code, notes, and snippets.

@lazyakshay
Created September 29, 2017 16:07
Show Gist options
  • Save lazyakshay/1faaf3c3604fd59d2dc0e187de81c680 to your computer and use it in GitHub Desktop.
Save lazyakshay/1faaf3c3604fd59d2dc0e187de81c680 to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int c = n%12;
switch(c){
case 0 : cout<<n-11<<" "<<"WS\n"; break;
case 1 : cout<<n+11<<" "<<"WS\n"; break;
case 2 : cout<<n+9<<" "<<"MS\n"; break;
case 3 : cout<<n+7<<" "<<"AS\n"; break;
case 4 : cout<<n+5<<" "<<"AS\n"; break;
case 5 : cout<<n+3<<" "<<"MS\n"; break;
case 6 : cout<<n+1<<" "<<"WS\n"; break;
case 7 : cout<<n-1<<" "<<"WS\n"; break;
case 8 : cout<<n-3<<" "<<"MS\n"; break;
case 9 : cout<<n-5<<" "<<"AS\n"; break;
case 10 : cout<<n-7<<" "<<"AS\n"; break;
case 11 : cout<<n-9<<" "<<"MS\n"; break;
}
}
// cout << "Hello World!" << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment