Advertisement
rahat62

MSNSADM1

Aug 2nd, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.  
  6.     int t,goal[1000],faul[1000],n,res[1000];
  7.  
  8.     cin>>t;
  9.  
  10.     for(int i=0;i<t;i++)
  11.     {
  12.         cin>>n;
  13.  
  14.         for(int j=0;j<n;j++)
  15.         {
  16.             cin>>goal[j];
  17.         }
  18.  
  19.  
  20.         for(int j=0;j<n;j++)
  21.         {
  22.             cin>>faul[j];
  23.         }
  24.  
  25.  
  26.         for(int j=0;j<n;j++)
  27.         {
  28.             res[j] = (goal[j]*20) - (faul[j]*10);
  29.         }
  30.  
  31.         sort(res,res+n);
  32.  
  33.  
  34.         if(res[n-1]>=0){
  35.  
  36.         cout<<res[n-1]<<endl;
  37.         }
  38.  
  39.         else
  40.  
  41.             cout<<"0"<<endl;
  42.     }
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49. return 0;
  50.  
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement