Dia, Sam, and Robert are the three students of a same class. You know their marks in ‘N’ subjects. Your job is to find their ranks according to their score.
Input
N, integer denoting number of subjects.
3 array of integers, denoting marks of Dia, Sam and Robert respectively in N subjects.
Output
Ranks
Example
Input
3
23 34 23
32 53 23
55 22 67
Output
3 2 1
It’ll s better if you can please display in which round the prob. is asked , that’ll help us in better way , since we’re overhyped about the difficulty level.
Thankyou
it would be a big help if you can do so.
n = int(input())
inp = []
for i in range(n):
nos = list(map(int, input().split()))
inp.append(nos)
res = []
for i in inp:
res.append(sum(i))
print(res)
for i in range(n):
if res[i] == min(res):
res[i] = 3
elif res[i] == max(res):
res[i] = 1
else:
res[i] = 2
res = [str(i) for i in res]
print(” “.join(res))
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
d=sum(a)
e=sum(b)
f=sum(c)
h=[d,e,f]
g=[]
for i in h:
if i is max(h):
g.append(1)
elif i is min(h):
g.append(3)
else:
g.append(2)
print(g)