#T5780. Deliv-e-droid

0
    ID: 1053 传统题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>5780选择结构Junior(初级组)CCC 2023简单

Deliv-e-droid

Deliv-e-droid

题目描述

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 50 points for every package delivered. • Lose 10 points for every collision with an obstacle. • Earn a bonus 500 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. 机器人 Deliv-e-droid 在送快递,如果它成功地将一个快递送达,则它获得 50 元钱,如果未能成功送达,它被扣除 10 元钱。特别地,如果它送达的快递的数量大于未送达的,它会得到 500 元钱的奖励。 现在已知 Deliv-e-droid 送达了 P 个快递,未送达 C 个(0≤P,C≤100),请实现一个程序,求出 Deliv-e-droid 所获得的钱(如果是倒扣的话用负数表示)。

输入格式

The input will consist of two lines. The first line will contain a non-negative integer P, representing the number of packages delivered. The second line will contain a non-negative integer C, representing the number of collisions with obstacles.

输出格式

The output will consist of a single integer F, representing the final score.
5
2
730
0
10
-100

提示

####数据范围与提示 Explanation of Output for Sample Input 1 There are 5 packages delivered, so 5 × 50 = 250 points are gained. There are 2 collisions, so 2 × 10 = 20 points are lost. Since 5 > 2, a bonus 500 points are earned. Therefore, the final score is 250 − 20 + 500 = 730. Explanation of Output for Sample Input 2 There are 0 packages delivered, so 0 × 50 = 0 points are gained. There are 10 collisions, so 10 × 10 = 100 points are lost. Since 0 ≤ 10, no bonus points are earned. Therefore, the final score is 0 − 100 + 0 = −100.

来源

童程童美