forked from VibhutiJindal/CodeChef
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Football2
48 lines (45 loc) · 1006 Bytes
/
Football2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include<iostream>
using namespace std;
int main()
{
int t=0,n=0,k=0,j=0;
cin>>t;
int max[t]={0};
for(int i=0;i<t;i++)
{
cin>>n;
int a[n]={0};
int b[n]={0};
int score[n]={0};
for(j=0;j<n;j++)
{
cin>>a[j];
}
for(j=0;j<n;j++)
{
cin>>b[j];
}
for(j=0;j<n;j++)
{
score[j]=((20*a[j])-(10*b[j]));//>0)?((20*a[j])-(10*b[j])):0;
}
int m=score[0];
for(j=0;j<n;j++)
{
if(m<score[j])
{
m=score[j];
}
}
max[k]=m;
k++;
}
for(j=0;j<t;j++)
{
if(max[j]>=0)
cout<<max[j]<<endl;
else
cout<<0<<endl;
}
return 0;
}