Python3 代码
s = input()
sum = 0
count = 0
for i in range (5):
n = list(map(float, input().split()))
for j in range (i + 1, 11 - i):
sum += n[j]
count += 1
if s == "S":
print (f'{sum:.1f}')
if s == "M":
print (f'{sum/count:.1f}')