forked from aviraw/CodeChef
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Football
42 lines (40 loc) · 952 Bytes
/
Football
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
#include<iostream>
using namespace std;
int main()
{
int t,n,a[50]={0},b[50]={0},score[50]={0},max[50]={0},k=0;
cin>>t;
for(int i=0;i<t;i++)
{
cin>>n;
for(int j=0;j<n;j++)
{
cin>>a[j];
}
for(int j=0;j<n;j++)
{
cin>>b[j];
}
for(int j=0;j<n;j++)
{
score[j]=((20*a[j])-(10*b[j])>0)?((20*a[j])-(10*b[j])):0;
}
max[k]=score[0];
for(int j=0;j<n;j++)
{
if(max[k]<=score[j])
{
max[k]=score[j];
}
else
max[k]=0;
}
k++;
}
for(int j=0;j<k;j++)
{
cout<<max[j]<<endl;
}
return 0;
}
//https://www.codechef.com/problems/MSNSADM1