Gahui and Soongsil University Station
Time limit1sMemory limit1024 MB
Sum the vertical drop in cm from the exit to the B6 platform, using stairs at 17cm each and escalator steps at 21cm each.
- Level
Easy2 of 10
- Topics
- Implementation
- Solved
- No attempts yet
Problem
Soongsil University Station is known as the deepest station on Seoul Subway Line 7. The platform is on B6. Gahui was surprised that she had not reached the platform after walking down for more than five minutes from the exit. Gahui wants to know how deep Soongsil University Station is. Find the depth of Soongsil University Station.
The depth is the vertical distance from the exit to the platform.
Input
[Table 1] Description of the input
For every two adjacent floors ordered by depth, one line gives the information in one of the following forms.
Stairx: If you go downxstairs from the {floor1} floor, you reach the {floor2} floor.Esx: If you go down the escalator withxsteps from the {floor1} floor, you reach the {floor2} floor.
Output
Print the answer in cm. If the answer is 5096cm, print 5096.
Constraints
- The height of one escalator step is 21cm, and the height of one stair is 17cm.
- The answer is at most 6425.
- All exits are at the same elevation.
- All platforms are at the same elevation.
- There is no change in elevation within the same platform.
xis an integer.