Къде ми е грешката в тази задача и защо judge ми дава 20 точки?
Ето моя код.
https://pastebin.com/3tRu1h9U
Това е условието на задачата.
Problem 1. National Court
Every day thousands of people pass by the reception at "National Court" with various questions to ask and the employees have to help everyone by providing correct information and to answer all questions.
There are 3 employees working on the reception all day long. Each of them can handle different number of people per hour. Your task is to calculate how much time it will take to answer all the questions of a given number of people.
First you will receive 3 lines with integers, representing the count of people that each of the employee can help per hour. On the next line you will receive the total people count as a single integer.
Every fourth hour all the employees have a one-hour break before they start working again. This is the only break they get because they don`t need rest and have no personal life. Calculate the time needed to answer all people`s questions and print it in the following format: "Time needed: {time}h."
Input / Constraints
- On first three lines - each employee`s efficiency - an integer in the range [1 - 100]
- On the fourth line - people count – an integer in the range [0 – 10000]
- Input will always be valid and in the range specified
Output
- Print a single line: "Time needed: {time}h."
- Allowed working time / memory: 100ms / 16MB
Examples
Input |
Output |
Comment |
5 6 4 20 |
Time needed: 2h. |
All employees can answer 15 people per hour. After the first hour there are 5 people left to be answered. All people will be answered in the second hour. |
1 2 3 45 |
Time needed: 10h. |
All employess can answer 6 people per hour. In the first 3 hours they have answered 6 * 3 = 18 people. Then they have a break for an hour. After the next 3 hours there are After the break for an hour, there are only 9 people to answer. So in the 10th hour all of the people questions would be answered. |
3 2 5 40 |
Time needed: 5h. |
|
Благодаря много за помощта.