#P2022E. Cats or dogs?
Cats or dogs?
Cats or dogs?
Time limit: 1 seconds
Memory limit: 512 megabytes
Problem Statement
Frank is doing a research on how animals make humans closer. To describe the distance of two people and about an animal, he creates a formula: if has a favorability for this animal and has a favorability for the same kind animal. And then he starts from the most common animals: dogs and cats.
After a long and difficult statistical investigation, he surveyed people about their favorability for cats and their favorability for dogs. He quickly finds that it is easy to calculate the maximum distance about cats or dogs among these people. For example, if he needs to find the maximum distance about cat, he just need to find the maximum and the minimum , then the maximum distance among these people is .
For further research, he wants to find the maximum distance about both cats and dogs, so he improvs the formula: if has a favorability for cats and for dogs and has a favorability for cats and for dogs.
Now, Frank is going to find the maximum distance among these people. It seems very easy too, so Frank gives this problem to you.
Input
The first line contains one integer .
In the following lines, each line contains two integers denoting the favorability for cats and for dogs.
Output
Print a single integer, denoting the answer to the question.
3
0 3
3 1
4 10
4