#include #include #include #define ll long long #define eps 1e-9 #define PI 2 * acos (0.0) using namespace std; int ori[5]; int red[5]; int main() { // freopen("0.in","r",stdin); // freopen("0.out","w",stdout); /* cout << fixed << setprecision(4); std::ios::sync_with_stdio(false); */ ori[0]=1000; ori[1]=1500; ori[2]=2000; ori[3]=2500; red[0]=400; red[1]=600; red[2]=800; red[3]=1000; int a,b,c,d,e,x,y,z,n,t; scanf("%d",&t); for(y=1;y<=t;y++) { printf("Case #%d: ",y); z=0; for(a=0;a<4;a++) { scanf("%d %d",&c,&d); x=(ori[a]/250)*(250-c) - 50*d; x=max(red[a],x); z=z+x; } cout<