Flying Doors
시간 제한2초메모리 제한1024 MB
움직이는 n개의 문 천장이 주어질 때, Kostya가 어떤 속도로든 모든 문을 통과할 수 있는 시작 높이의 측도를 최소로 만드는 순서를 찾는다.
문제
Artem and Kostya are playing a following game. Artem has doors with free ceiling. The floors of the doors are fixed on zero height, ceiling could change. Each door has two parameters : is the initial height of the ceiling, and is the velocity of the ceiling. If , then the ceiling is moving up meters per second. If , then the ceiling is moving down meters per second until it becomes zero, after that it stops. And if , the ceiling is always fixed at height .
The game proceeds as follows: Artem places these doors at points on -axis with coordinates in some order. Kostya is located at point just before the game. He chooses some height and velocity (here we consider Kostya as a point). Then Artem shoots the starting pistol, and the doors' ceilings begin to move and simultaneously Kostya starts his journey on constant height with constant velocity in the positive direction of -axis. Kostya must fly through all the doors. So, if Kostya flies through some coordinate and the ceiling of the door at coordinate is strictly down Kostya, then Kostya loses.
To make the game more exciting, Kostya decided to choose a randomized strategy. He chooses the height as a uniformly distributed on real number. Then he chooses some which allows him to win, if it is possible. For each arrangement of doors consider the probability of Kostya's win if he uses this strategy. Artem wants to place doors in such order that this probability is minimized. Help Artem to find this minimal probability. To make the answer format more convenient, output the desired probability multiplied by .
입력
The first line of input contains one positive integer () --- the number of doors Artem has.
Next lines contain description of doors, each of them contain two integers (), denoting the initial height and the velocity of the ceiling of the -th door.
출력
In the only line output a real number --- the minimal probability of Kostya's win, multiplied by . The answer will be considered correct if the absolute or relative error is less than . Note that this rule applies to the output value, not to the desired probability.