UVA error output data
#include <iostream>
#include <stdio.h>
#include <map>
#include <string>
#include <string.h>
using namespace std;
map<char,int> mp;
int main()
{
int t,n,c=0;
string s;
cin>>t;
while(t--)
{
cin>>n;
//getchar();
cin>>s;
c++;
mp.clear();
for(int i=0;i<s.size();i++)
{
mp[s[i]]++;
}
if(mp['A']==n)
{
cout<<"Case "<<c<<": ABANDONED\n";
}
else if(mp['A']+mp['B']==n)
{
cout<<"Case "<<c<<": BANGLAWASH\n";
}
else if(mp['A']+mp['W']==n)
{
cout<<"Case "<<c<<": WHITEWASH\n";
}
else if(mp['B']>mp['W'])
{
cout<<"Case "<<c<<": BANGLADESH "<<mp['B']<<" - "<<mp['W']<<"\n";
}
else if(mp['W']>mp['B'])
{
cout<<"Case "<<c<<": WWW "<<mp['W']<<" - "<<mp['B']<<"\n";
}
else if(mp['B']==mp['W'])
{
cout<<"Case "<<c<<": DRAW "<<mp['B']<<" "<<mp['T']<<"\n";// **********it should not be mp['T'] **********
}
}
return 0;
}