Company: natwest
Difficulty: medium
In a city there are N houses. Noddy is looking for a plot of land in the city on which to build his house. He wants to buy the largest plot of land that will allow him to build the largest possible house. All the houses in the city lie in a straight line and all of them have a house number and a second number indicating the position of the house from the entry point in the city. Noddy wants to find the houses between which he can build the largest possible house. Write an algorithm to help Noddy find the house numbers between which he can build his largest possible house. Input The first line of the input consists of two space-separated integers - num and val , representing the number of houses (N) and the value val where val is always equal to two representing the house number ( H i ) and the position of houses( P i ) for N houses). The next N lines consist of two space-separated integers representing the house number ( H i ) and the position ( P i ), respectively. Output Print two sp