Tryhard 1 Точки

## 1.Number Beggars

Your task here is pretty simple: given a list of numbers and a number of beggars, you are supposed to return a list with the sum of what each beggar brings home, assuming they all take regular turns, from the first to the last.

For example: [1,2,3,4,5] for 2 beggars will return a result of 9 and 6, as the first one takes [1,3,5], the second collects [2,4].

The same list with 3 beggars would produce a better outcome for the second beggar: 5, 7 and 3, as they will respectively take [1, 4], [2, 5] and [3].

Also note that not all beggars have to take the same amount of "offers", meaning that the length of the list is not necessarily a multiple of n; length can be even shorter, in which case the last beggars will of course take nothing (0).

### Input

You will receive 2 lines of input: a single string containing the numbers separated by a comma and a space ", ". On the second line you will receive the number of beggars.

### Output

Print a list of all the sums that each beggar got.

INPUT                  OUTPUT |         INPUT                      OUTPUT

1, 2, 3, 4, 5             [9, 6]      |         3, 4, 5, 1, 29, 4          [3, 4, 5, 1, 29, 4]

2                                           |        6

Тагове:
1
vigyriousx 10 Точки
``````coins = [int(num) for num in input().split(", ")]
beggars = int(input())
count = 0
beggars_list = [0] * beggars
for coin in coins:
beggars_list[count] += coin
count += 1
if count >= beggars:
count = 0
print(beggars_list)``````

Ето и моето решение на задачката. 100/100

1
Ina_K 3 Точки

Много леко и добро решение. Браво!

1
Julianh12 2 Точки
```coins=[int(num) for num in input().split(", ")]
number_beggars=int(input())
list_beggers=[0]*number_beggars
count=0
for i in range(len(coins)):
list_beggers[count]+=coins[i]
count+=1
if count>=number_beggars:
count=0
print(list_beggers)
```
0
D1mitroV 5 Точки

Просто перфектно,много хитро решение..Поздравления

1