Floating-point precision

What integer can represent their exact combined price?

Examples

Worked example

Input
Two prices are represented as 10 cents and 20 cents.
Expected output
30 cents.

Hints and solution

Hint 1

Write down the starting state and walk through one example by hand.

Reveal worked answer

Adding whole cents gives an exact integer result without a decimal rounding step.

Back to the lesson