CCC '23 J1 - Deliv-e-droid
View as PDFCanadian 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:
- Gain 
points for every package delivered.
 - Lose 
points for every collision with an obstacle.
 - Earn a bonus 
points if the number of packages delivered is greater than the number of collisions with obstacles.
 
Your job is to determine the final score at the end of a game.
Input Specification
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.
Output Specification
The output will consist of a single integer , representing the final score.
Sample Input 1
5
2
Sample Output 1
730
Explanation for Sample 1
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 
.
Sample Input 2
0
10
Sample Output 2
-100
Explanation for Sample 2
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 
.
Comments