Section: 2, Score: 19, Time limit per test: 30 seconds, Memory limit per test: 512MB, Input: stdin, Output: stdout
Everyone loves a good Hackathon. This year, Agoda is planning a party for all Hackathon participants and needs to arrange transportation. Everyone is super excited and starts to queue up with their teammates. There are
Can you help Agoda figure out how many ways to fill the buses?
The first line will have two space-separated integers
The next line contains
The next
Output the number of ways Agoda can fill each bus
8 3
20 30 40 11 29 20 20 10
50 30 20
2
2
3
For the 1st bus with capacity 50, the following teams can be arranged:
- (20, 30)
- (20, 20, 10)
10 5
11 9 11 9 10 8 10 8 10 11
70 30 80 40 10
0
1
0
1
3