//HDU 4788 - Hard Disk Drive
//By Pan Zhongfu 2016/10/23
//problem: http://acm.hdu.edu.cn/showproblem.php?pid=4788
#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int T, m;
string s;
double r;
int main()
{
scanf("%d", &T);
for(int t = 1; t <= T; t++)
{
r = 1;
cin >> m >> s;
if(s == "[YB]")
{
s = "[ZB]";
r *= 1000.0/1024.0;
}
if(s == "[ZB]")
{
s = "[EB]";
r *= 1000.0/1024.0;
}
if(s == "[EB]")
{
s = "[PB]";
r *= 1000.0/1024.0;
}
if(s == "[PB]")
{
s = "[TB]";
r *= 1000.0/1024.0;
}
if(s == "[TB]")
{
s = "[GB]";
r *= 1000.0/1024.0;
}
if(s == "[GB]")
{
s = "[MB]";
r *= 1000.0/1024.0;
}
if(s == "[MB]")
{
s = "[KB]";
r *= 1000.0/1024.0;
}
if(s == "[KB]")
{
s = "[B]";
r *= 0.9765625;
}
if(s == "[B]")
r = (1 - r) * 100;
printf("Case #%d: %.2f%%\n", t, r);
}
return 0;
}