Advertisement
George_Ivanov05

0.4

Jul 4th, 2021
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. coins = [int(num) for num in input().split(", ")]
  2. beggars = int(input())
  3. count_beggars = 0
  4. beggars_list = [0] * beggars
  5. for coin in coins:
  6.     beggars_list[count_beggars] += coin
  7.     count_beggars += 1
  8.     if count_beggars >= beggars:
  9.         count_beggars = 0
  10. print(beggars_list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement