P3054 [USACO12OPEN] Running Laps S

Description

Bored with horse racing, Farmer John decides to investigate the feasibility of cow racing as a sport. He sets up his N cows (1

Input Format

\* Line 1: Three space-separated integers: N, L, and C. (1

Output Format

\* Line 1: The total number of crossing events during the entire race.

Explanation/Hint

There are 4 cows running 2 laps on a circular track of length 100. The speeds of the cows are 20, 100, 70, and 1. The race lasts 2 units of time, since this is the time it takes the fastest cow (cow 2) to finish. Within that time, there are 4 crossing events: cow 2 overtakes cows 1 and 4, and cow 3 overtakes cows 1 and 4.