문제
One of the farming chores Farmer John dislikes the most is hauling around lots of cow manure. In order to streamline this process, he comes up with a brilliant invention: the manure teleporter! Instead of hauling manure between two points in a cart behind his tractor, he can use the manure teleporter to instantly transport manure from one location to another.
Farmer John's farm is built along a single long straight road, so any location on his farm can be described simply using its position along this road (effectively a point on the number line). A teleporter is described by two numbers
Farmer John decides to build a teleporter with the first endpoint located at
Please help FJ determine the minimum possible sum of the
Problem credits: Brian Dean
입력
The first line of input contains
출력
Print a single number giving the minimum sum of
예제
3
-5 -7
-3 10
-2 7
10
In this example, by setting