Canadian Computing Competition: 2023 Stage 1, Junior #1
In the game, Deliv-e-droid, a robot droid has to deliver packages while avoiding obstacles. At the end of the game, the final score is calculated based on the following point system:
Your job is to determine the final score at the end of a game.
The input will consist of two lines. The first line will contain a non-negative integer, , representing the number of packages delivered. The second line will contain a non-negative integer, , representing the number of collisions with obstacles.
The output will consist of a single integer, , representing the final score.
There are packages delivered, so points are gained. There are collisions, so points are lost. Since , a bonus points are earned. Therefore, the final score is .
There are packages delivered, so points are gained. There are collisions, so points are lost. Since , no bonus points are earned. Therefore, the final score is .
No comments yet. Be the first to comment!