Submit | All submissions | Best solutions | Back to list |
EVENEGG - Fuad the wild scientist |
Fuad is a wild scientist who lives beside a river in a large cottage alone. One day, while doing his job he found a beautiful and shinning looking egg in a bush. He liked it very much and brought it with him to his house. After two days, a dragon hatched from the egg. He was surprised and afraid. But, the dragon was so cute that he decided to keep it with him at his house.
Within a few days, he came to know that dragons eat much and grow very rapidly. Every day he used to take a walk with the dragon and come back home before evening. The height of his door is only 7 feet. He figured out that if the dragon grows in that rate, one day the dragon will fail to enter the house through that door.
So, he became very worried and ask for help to only neighbour who is you! He ask you what will be the minimum height of the door at Nth day so that the dragon can enter. You have to help him by telling the minimum height of the door on Nth day.
Fuad will make the door higher by using columns of X feet.
Input
The inputs will be initial height of the dragon, (H, 0 < H < 750) and the day, (0 < n < 1,000) on which he wants to know the height of the door, daily growth of the dragon, (G, 0 < G < 950) and the height of columns, (X, 0 < X < 2,000) using which he will make door. All units are in feet.
Output
One integer, the height of the door at Nth day.
Example
Input: 10 2 4 1 16 5 7 10 5 1 1 4 Output: 19 57 7
Added by: | Ruhul |
Date: | 2019-08-05 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | C CPP CPP14 JAVA PYTHON3 |