Sports Day
InterviewTime limit1sMemory limit512 MB
Given N teams of M members, a people still in the event, and K of them on Junhyeok's team, find the largest and smallest rank his team can have.
- Level
Easy3 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Dankook University Affiliated Software High School (Dankook Sogo) is holding a sports day. The event is a team competition. A total of teams take part, and each team has members. At the end of each round, one of the remaining members is eliminated at random. A team is eliminated when all of its members are eliminated. The final rank of each team is determined by the reverse of the elimination order. The team eliminated last becomes the overall winner.
The event has progressed until people remain in total, and of them are on Junhyeok's team. Junhyeok wants to know the range of ranks his team can still get. The rank that Junhyeok's team can currently have is equal to (the number of remaining teams excluding Junhyeok's team + 1).
Given , , , and , find the largest and smallest ranks Junhyeok's team can currently have.
Input
The first line contains , , , and , separated by spaces.
Output
On the first line, print the largest and smallest ranks Junhyeok's team can have, separated by a space.