GeorgiLukanov87

hard_beggars

Jun 2nd, 2022 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. coins = list(map(int, input().split(",")))
  2. beggars = int(input())
  3. list_of_beggars = [0] * beggars
  4. counter_beggars = 0
  5. for coin in coins:
  6.     list_of_beggars[counter_beggars] += coin
  7.     counter_beggars += 1
  8.     if counter_beggars >= beggars:
  9.         counter_beggars = 0
  10. print(list_of_beggars)
Add Comment
Please, Sign In to add comment