Problem list
Log in
#r03610 · CCC 2025 Junior

Roller Coaster Ride

Bronze V 2.0 s 256 MB

You are spending the day at the CEMC’s funfair. One of the rides at the funfair is a roller coaster which has one train with a number of cars. Each car holds the same number of people.

When you arrive at the roller coaster, you see that there is a line. Your job is to determine whether or not you will be on the next train ride, assuming that every car is fully occupied for every ride.

Input

The first line of input contains a positive integer, $N$, representing your place in line. For example, if $N$ is $5$ then you are the fifth person in line.

The second line contains a positive integer, $C$, representing the number of cars the train has.

The third line contains a positive integer, $P$, representing the number of people a single car holds.

Output

Output either yes or no, indicating whether or not you will be on the next train ride.

Example 1

Input
14
3
2
Output
no

The train has (3) cars and each car holds (2) people. Therefore, (6) people can ride the next train. Since you are the 14th person in line, you will not be on the next train ride.

Example 2

Input
12
4
3
Output
yes

The train has $4$ cars and each car holds $3$ people. Therefore, $12$ people can ride the next train. Since you are the 12th person in line, you will be on the next train ride.

Source
CCC 2025 Junior
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code