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