Challenge 1 - Pizza love
We love pizza. You love pizza. And your friends love pizza too. You are hosting a party tomorrow, and you want to have enough pizza for everyone. Following the widely-known standards, every pizza is cut into 8 slices, and you know the maximum number of pizza slices that each person will eat. You want to know the minimum number of pizzas you need to order so that nobody goes hungry during the party.
In the first line, an integer T indicates the number of cases.
Each case consists of two lines. The first one contains a number N, the number of people attending the party. The second line contains N numbers, representing the maximum number of pizza slices that each guest eats (S).
For each case, a line starting with "Case #x: " followed by the minimum number of pizzas you need to order to ensure that nobody goes hungry.
- 1 ≤ T ≤ 100
- 1 ≤ N ≤ 10000
- 1 ≤ S ≤ 100
3 3 8 8 8 2 5 3 4 3 4 5 6
Case #1: 3 Case #2: 1 Case #3: 3
In the first case, each of the three attendees eats an entire pizza, so the answer is 3.
In the second case, the two attendees eat 8 slices, so a single pizza is enough for them.
In the third case, the answer is 3:
- Attendees #1 and #3 eat an entire pizza together (3+5=8)
- Attendee #2 eats 4 slices of a second pizza
- Attendee #4 eats up to 6 pizza slices, but only 4 remain from the second pizza, so we need another one.
Test your code
You can test your program against both the input provided in the test phase and the input provided in the submit phase. A nice output will tell you if your program got the right solution or not. You can try as many times as you want to. Be careful with extra whitespaces, the output should be exactly as described.
Test your program against the input provided in the test phase
Test your program against the input provided in the submit phase
During the submit phase, in some problems, we might give your program harder inputs. As with the test token, a nice output will tell you if your program got the right solution or not. You can try as many times as you need.
In the actual contest you first need to solve the test phase before submitting the code, you must provide the source code used to solve the challenge and you can only submit once (once your solution is submitted you won't be able to amend it to fix issues or make it faster).
If you have any doubts, please check the info section.