#K92392. Maximum Remaining Balance

    ID: 38187 Type: Default 1000ms 256MiB

Maximum Remaining Balance

Maximum Remaining Balance

You are given three integers m, a, and b representing the total amount of money and the prices of two different flavors respectively. Your task is to choose exactly one flavor to buy such that the remaining money after the purchase is maximized. If you cannot afford any flavor, you should not spend any money.

In mathematical terms, if both flavors are affordable (i.e. m \geq a and m \geq b), the maximum remaining balance is given by:

$$ m - \min(a, b) $$

If only one flavor is affordable, the remaining balance is m minus the price of that flavor. If neither flavor is affordable, then the remaining balance is simply m.

Make sure to read the input from stdin and output your answer to stdout.

inputFormat

The input consists of three space-separated integers: m (the total money available), a (the price of the first flavor), and b (the price of the second flavor).

outputFormat

Output a single integer, the maximum remaining balance after buying the best affordable flavor choice. The result should be printed to stdout.## sample

10 2 3
8