awsmpshk

фигурное катание

Nov 28th, 2021
551
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def list_sum(arr: list) -> float:
  2.     if len(arr) == 1:
  3.         return arr[0]
  4.     else:
  5.         return list_sum(arr[1:]) + arr[0]
  6.  
  7.  
  8. def main() -> None:
  9.     arr: list = [float(item) for item in input().split()]
  10.  
  11.     first: list = arr[0: 6]
  12.     second: list = arr[6: 12]
  13.     third: list = arr[12: 18]
  14.  
  15.     results = [list_sum(first), list_sum(second), list_sum(third)]
  16.     mx, index = 0, 0
  17.     for i in range(3):
  18.         if results[i] >= mx:
  19.             index = i
  20.             mx = results[i]
  21.     if index == 0:
  22.         print('I')
  23.     elif index == 1:
  24.         print('II')
  25.     elif index == 2:
  26.         print('III')
  27.  
  28.  
  29. if __name__ == '__main__':
  30.     main()
RAW Paste Data