Safari
시간 제한0.5초메모리 제한1024 MB
각 동물이 정해진 시간 구간에 나타나고 L1 거리로 이동할 때, 동물을 관찰한 시간의 합의 최댓값을 구한다.
문제
Safari is a journey that involves going into nature to watch wild animals. Typically, safari participants travel through vast grasslands in four-wheel-drive cars, shortly 4WD cars. Imagine you are on safari in a 4WD car .
Animals appear in specific places on the grassland, where you can consider the places as the points on the plane. There are animals, indicated as to , in which the animal appears at the point in the plane. Each animal appears only in its own certain time interval. Specifically, the animal appears in the time interval . So, when the car stays at for the duration , you have the opportunity to observe the animal for the time period . Note that if you observe an animal during , the length of time when you observe it is .
The car departs from the starting point at time and it moves at speed . Thus time has passed when moves distance . The distance is measured in the -metric. That is, the distance between points and is . It always takes as long as the distance while the car moves from to . Also, the car may stay at a point as long as you need, if necessary. When your safari tour ends at the last sighting point of an animal, you want to know the longest possible time for which you observe the animals.
For example, the figure below shows six animals, indicated as to , which appear at the coordinates , , , , , , respectively, of points in the plane. Let us also indicate as to the points of animals. The time intervals when the animals appear are also displayed. First, consider the case the car is driving along the blue path. The car departs from at time and arrives at the point at time . Departing from it immediately at time , the length of time when you observe the animal is . Afterward, you arrive at the point at time and stay there during . Next, you arrive at the point at time and observe the animal during . Then the total length of time when you observe the animals is . Secondly, consider the case the car is driving along the red path. At first, you arrive at the point at time and stay during . Departing from it at time , you arrive at the point at time and stay during . Then you arrive at the point at time and observe the animal during . In this case, the total length of time when you observe the animals is , which is longer than the blue path and actually, the length of the longest time when you can observe the animals.

Given coordinates of points and time intervals for the appearances of animals, write a program to output the length of the longest possible time when you observe the animals.
입력
Your program is to read from standard input. The input starts with a line containing one integer (), where is the number of animals. The animals are numbered from to . In the following lines, the -th line contains two integers and that represent the coordinate of the point in the plane where the animal appears (). Note that the car is located at at time . The given points containing are all distinct. In the following lines, the -th line contains two integers and that represent the duration when the animal appears at ().
출력
Your program is to write to standard output. Print exactly one line. The line should contain the length of the longest time when you can observe the animals.