#include<iostream> #include<string> #include<cstdio> using namespace std; double ans; void yuan1(string s) { if(s=="m") ans=ans*1000; if(s=="dm") ans=ans*100; if(s=="cm") ans=ans*10; if(s=="um") ans=ans*0.001; if(s=="nm") ans=ans*1e-6; } void yuan2(string s) { if(s=="m") ans=ans/1000; if(s=="dm") ans=ans/100; if(s=="cm") ans=ans/10; if(s=="um") ans=ans/0.001; if(s=="nm") ans=ans/1e-6; } int main() { int cnt=1; int t; string s1,s2,s3; double a,b,c; scanf("%d",&t); while(t--){ cin>>a>>s1>>b>>s2>>c>>s3; //cout<<s1<<" "<<s2<<" "<<s3<<" "<<endl; ans=a*c/b; //cout<<ans<<endl; yuan1(s1); yuan2(s2); printf("Case %d: %.2lfpx ",cnt++,ans); } return 0; }