#P3403. 跳楼机
跳楼机
Description
srwudi's home is a skyscraper with floors. Because more and more newbies are coming to learn, srwudi modified an elevator so that visitors can go upstairs more easily.
After the modification, the elevator can move in the following four ways:
- Move up floors;
- Move up floors;
- Move up floors;
- Return to the first floor.
One day at noon, DJL arrived at srwudi's home. He is now on the first floor, and the elevator happens to be on the first floor as well. DJL wants to know how many floors he can reach by taking the elevator.
Input Format
The first line contains an integer , the number of floors of the skyscraper.
The second line contains three positive integers, which are .
Output Format
Output a single integer, the number of floors DJL can reach.
15
4 7 9
9
33333333333
99005 99002 100000
33302114671
Hint
Reachable floors include: .
, .
Translated by ChatGPT 5
京公网安备 11011102002149号