J1. Roller Coaster Ride
의견: 0
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.
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 either yes or no, indicating whether
or not you will be on the next train ride.
14
3
2noThe 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.
12
4
3yesThe 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.
평가 및 의견
J1. Roller Coaster Ride
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
J1. Roller Coaster Ride