Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t,goal[1000],faul[1000],n,res[1000];
- cin>>t;
- for(int i=0;i<t;i++)
- {
- cin>>n;
- for(int j=0;j<n;j++)
- {
- cin>>goal[j];
- }
- for(int j=0;j<n;j++)
- {
- cin>>faul[j];
- }
- for(int j=0;j<n;j++)
- {
- res[j] = (goal[j]*20) - (faul[j]*10);
- }
- sort(res,res+n);
- if(res[n-1]>=0){
- cout<<res[n-1]<<endl;
- }
- else
- cout<<"0"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement