#B2613. Catching Up: When Does A Overtake UIM?

    ID: 11252 Type: Default 1000ms 256MiB

Catching Up: When Does A Overtake UIM?

Catching Up: When Does A Overtake UIM?

Little A types at a rate of 120 characters per minute while UIM types at 80 characters per minute. UIM starts typing 12 minutes earlier than Little A. The problem is to determine the time (in minutes) after Little A starts typing when he catches up to UIM's progress.

You can form the equation based on the number of characters typed:

\(120t = 80(t+12)\)

Solve for \(t\) to determine when Little A catches up to UIM.

inputFormat

The input consists of a single line with three space-separated integers:

  • a: Little A's typing speed (in characters per minute).
  • b: UIM's typing speed (in characters per minute).
  • c: The head start time for UIM (in minutes).

It is guaranteed that a > b so that Little A eventually catches up.

outputFormat

Print a single integer representing the number of minutes after Little A starts typing when he catches up with UIM.

sample

120 80 12
24