Marathon
면접 대비시간 제한2초메모리 제한1024 MB
각 경쟁자의 완주 시간이 [a_i, b_i]에서 균등분포를 따를 때, 모든 경쟁자를 이길 확률이 50퍼센트가 되는 에릭의 최대 완주 시간을 구한다.
문제
Erik wants to run a marathon. Most of all, he wants to win the race. To plan his training, he has looked up how the other contestants performed in previous races and made a model to predict his chances of winning. The finishing time for each contestant is distributed uniformly at random in an interval . What is the largest finishing time Erik can have while still having a change of winning?
입력
The first line contains an integer , the number of other contestants. Then follows lines, each with two floating point values and with at exactly one decimal place, the start and end time in seconds for their finishing time.
출력
A single floating point number, the largest finishing time in seconds that Erik needs to have a chance of winning. The answer must be with a relative or absolute error of at most .