Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n=int(input())
- ludzie={}
- testy={}
- ltesty={}
- for i in range(n):
- a=input().split()
- name=a.pop(0)
- #print(name)
- suma=0
- for j in a:
- suma+=float(j.split(":")[1])
- #if j.split(":")[0] in testy.keys:
- testy[j.split(":")[0]]=testy.get(j.split(":")[0],0)+float(j.split(":")[1])
- ltesty[j.split(":")[0]]=ltesty.get(j.split(":")[0],0)+1
- #else
- #print(suma/len(a))
- ludzie[name]=suma/len(a)
- #print(testy)
- #print(ltesty)
- for i in sorted(ludzie.keys()):
- print(i, ludzie[i])
- for i in sorted(testy.keys()):
- print(i, testy[i]/ltesty[i])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement