시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 1024 MB48333069.767%

문제

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 $[a_i, b_i]$. What is the largest finishing time Erik can have while still having a $50\%$ change of winning?

입력

The first line contains an integer $1 \leq N \leq 10^5$, the number of other contestants. Then follows $N$ lines, each with two floating point values $0 \leq a_i \leq 10^5$ and $a_i \le b_i \leq 10^5$ 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 $50\%$ chance of winning. The answer must be with a relative or absolute error of at most $10^{-6}$.

서브태스크

번호배점제한
120

No intervals overlap.

280

No further restrictions.

예제 입력 1

1
1.0 3.0

예제 출력 1

2.0

예제 입력 2

3
0.0 10.0
3.5 6.7
2.2 4.5

예제 출력 2

2.883937700856755

출처

Contest > Swedish Coding Cup > LTH Challenge 2022 D번

  • 문제를 만든 사람: Maj Stenmark

채점 및 기타 정보

  • 예제는 채점하지 않는다.