#include #include #include #include #include #include #include #include #include #include #include #define _LL __int64 #define LL long long #define pi acos(-1.0) #define PB push_back() #define MP make_pair() #define BG begin() #define ED end() #define inf 0x3fffffff using namespace std; const int maxn=1000005; int A[maxn]; LL L[maxn]; int B[]={1000,1500,2000,2500}; //scanf("%d",&n); //printf("%d\n",); int main() { #ifndef ONLINE_JUDGE freopen("in.cpp","r",stdin); #endif // ONLINE_JUDGE int t; cin>>t; int a,b; int Cas=0; while(t--){ int cnt=0; for(int i=0;i<4;i++){ scanf("%d%d",&a,&b); int dd=B[i]*0.4; int num=B[i]*(250-a)/250-50*b; if(num