SP58 PICAD - Crime at Piccadily Circus

Description

Sherlock Holmes is carrying out an investigation into the crime at Piccadily Circus. Holmes is trying to determine the maximal and minimal number of people staying simultaneously at the crime scene at a moment when the crime could have been commited. Scotland Yard has already carried out a thorough investigation already, interrogated everyone seen at the crime scene and determined what time they appeared at the crime scene and what time they left. Doctor Watson offered his help to process the data gathered by Scotland Yard and find the numbers interesting Sherlock Holmes, but he has some difficulties. Help him! ### Task Write a program which - reads from standard input the time interval during which the crime was commited and the data gathered by Scotland Yard, - finds the minimal and the maximal number of people present simultaneously in the time interval when the crime could have been commited, (these numbers can be zero, though it would seem strange that noone was present at the crime scene when the crime was commited, but that's the type of crime Holmes and Watson have to deal with) - writes the outcome to standard output.

Input Format

Ten test cases (given one under another, you have to process all!). The first line of each test case consists of two integer numbers _p_ and _k_, _0

Output Format

For every test case your program should write to the standard output only one line with two integers separated by a single space: the minimal and maximal number of people staying simultaneously at the crime scene, in the interval between moment _p_ and _k_, (inclusive).