0% found this document useful (0 votes)
3 views3 pages

Chairlift Time Calculation Program

This document describes the components and operation of a chairlift, including a rotating cable loop, evenly spaced chairs suspended from the cable, and loading/unloading stations. It presents a problem where two friends riding in chair 56 are asked how much longer their 225-second ride will take after meeting chair 71 traveling in the opposite direction. Without checking her watch, their friend correctly calculates the remaining time of 198.9 seconds based on the chairlift's configuration. The program is then to perform these computations for test cases of chair numbers and times.

Uploaded by

idil
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Chairlift Time Calculation Program

This document describes the components and operation of a chairlift, including a rotating cable loop, evenly spaced chairs suspended from the cable, and loading/unloading stations. It presents a problem where two friends riding in chair 56 are asked how much longer their 225-second ride will take after meeting chair 71 traveling in the opposite direction. Without checking her watch, their friend correctly calculates the remaining time of 198.9 seconds based on the chairlift's configuration. The program is then to perform these computations for test cases of chair numbers and times.

Uploaded by

idil
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

2075 Chairlift

North America Rocky Mountain 2000/2001

A chairlift is used to transport skiers (or summer sightseers) up the mountain. Figure 1 shows the components
of a chairlift, viewed from the air above the chairlift:

A closedloop steel cable is in continuous motion around two rotating wheels (one at the
bottom, one at the top of the mountain).
There are N equally spaced chairs suspended from the cable. N is an even integer, 18 <= N
<= 300. In Figure 1, N = 18. The chairs are shown as short dashes across the cable. You must
understand that Figure 1 is a "snapshot", i.e., that the chairs are in continuous motion along
with the cable.
The circumference of each wheel is equal to the distance between adjacent chairs.
Passengers ride up in the chairs on the "upward bound" side of the lift; the chairs come back
down empty on the "downward bound" side.
The loading station (see Figure 2) is located on the lift's upward bound side, at the point of
tangency between the cable and the wheel at the bottom of the mountain. When a chair goes
by the loading station, passengers will quickly board the chair; the chair doesn't stop (each
chair is actually a bench , it can hold up to 4 people).
The unloading station (see Figure 3) is also located on the lift's upward bound side, at the
point of tangency between the cable and the wheel at the top of the mountain. When a chair
goes by the unloading station, passengers will quickly get off the chair; the chair doesn't stop.

The chairs are numbered in the order in which they appear at the loading station when the lift
is first activated in the morning. That is, they are numbered starting at 1, increasing
sequentially in a direction opposite to the direction of motion. Figure 4 is a reproduction of
Figure 1, showing chair numbers for the case N = 18. (Remember that the figure is just a
"snapshot", the chairs are in continuous motion.)
2075 Chairlift

1/3

Now that you are familiar with the chairlift, it is time to state the problem. Two friends, whom we shall call
Bob and Alice, are out for a day of skiing. They are just riding up in chair 56 and know that the lift has 126
chairs. They also know that the ride from the loading station to the unloading station takes exactly 225.0
seconds. Bob asks Alice: "How much longer will the ride take?" Alice doesn't look at her watch. Instead, she
waits until their chair meets a downward bound empty chair, notes that the number of that chair is 71, and
replies: "We have 198.9 more seconds to go." (An upward bound chair and a downward bound chair "meet"
when they are exactly opposite each other (i.e., both chairs are equidistant from the top of the mountain). At
the instant shown in Figure 4, no two chairs meet, but very soon thereafter, chairs 6 and 7, as well as chairs 5
and 8, etc., would meet.)
Your program will carry out Alice's computations.

Input
The first line of the input file will contain N, followed by T. The constraints on N were previously stated. T
(the time it takes to ride from the loading station to the unloading station) is a floating point number,
measured in seconds, 200.0 <= T <= 999.9. The first line will be followed by one or more additional lines of
input. On each of these additional lines, there will be exactly two integer values in the range 1..N, representing
two distinct chairs. The first of these chairs is the upward bound chair in which Bob and Alice are riding. The
second chair is the downward bound chair they meet when Alice announces the remaining time.

Output
After displaying N and T, the program will produce one line of output, containing the two chair numbers and
the remaining time, for each pair of chairs in the input. Pay attention to all formatting details, such as
punctuation, upper/lower case letters, the alignment of certain words, blank spaces, and the absence of blanks
lines.
Here is a formatting template shown between two lines of the above output:
1234567890123456789012345678901234567890123456789
N = 126, T = 225.0
Chair 56 meets chair 71, remaining time = 198.9

Note in particular, that:


all numerical values are rightjustified in the output fields shown by the formatting template.
floating point values (representing seconds) will be displayed with one digit following the
decimal point.

Sample Input
126 225.0
56 71
31 120
2075 Chairlift

2/3

100 53

Sample Output
Program 1 by team X
N = 126, T = 225.0
Chair 56 meets chair 71, remaining time = 198.9
Chair 31 meets chair 120, remaining time = 65.7
Chair 100 meets chair 53, remaining time = 83.7
End of program 1 by team X

Rocky Mountain 20002001

2075 Chairlift

3/3

You might also like