ENIGMA-0x02 (2024) - J2 (Group Trip to Haroumpia)

View as PDF

Submit solution

Points: 100 (partial)
Time limit: 1.0s
Memory limit: 64M

Authors:
Problem types
Allowed languages
Blockly, C, C++, Java, Pascal, Python

Group Trip to Haroumpia

Totos and Annoula are planning a trip to Haroumpia, where the currency is the hahanolira. They have gathered some money and want to calculate how many hahanoliras they will be able to get in total.
They know that 1 euro is equal to 3 hahanoliras. They also know that the exchange office can give them a maximum of 500 hahanoliras.

Therefore, if their total sum in hahanoliras exceeds this limit, they can only get 500 hahanoliras.

The input is Totos and Annoula's money in euros.

The output is the total amount of their money in hahanoliras.

Examples
1st

Input

50
30

Output

240
2nd

Input

200
100

Output

500
Explanation of the second example:

Totos has 200 euros and Annoula has 100 euros, so together they have 200 + 100 = 300 euros. This corresponds to 300 * 3 = 900 chachanoliras. However, 900 is more than the 500 limit of the exchange office, so they can only get 500 chachanoliras.


Comments

There are no comments at the moment.