CCCGuide

Problem J1: Roller Coaster Ride

2025 · J1 · Original problem · DMOJ

Problem Description

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 Specification

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

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

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

Output Specification

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

Sample Input 1

14
3
2

Output for Sample Input 1

no

Explanation of Output for Sample Input 1

The train has 33 cars and each car holds 22 people. Therefore, 66 people can ride the next train. Since you are the 14th person in line, you will not be on the next train ride.

Sample Input 2

12 
4 
3

Output for Sample Input 2

yes

Explanation of Output for Sample Input 2

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