#include #include #include #include #include #include using namespace std; int fenshu(int x){ int minimal=x/250*100; int stime,ftry; scanf("%d%d",&stime,&ftry); return max(x/250*(250-stime)-50*ftry,minimal); } void dit(int id){ int sum=0; sum+=fenshu(1000); sum+=fenshu(1500); sum+=fenshu(2000); sum+=fenshu(2500); printf("Case #%d: %d\n",id,sum); } int main() { int T;scanf("%d",&T);for(int i=1;i<=T;++i)dit(i); }