Problems
Extreme Temperatures
Extreme Temperatures
Kristen is a meteorologist, who is monitoring extreme temperatures in the forest of Palaiseau. She has collected temperature measurements at various times over several days. Help her find out what the lowest and highest temperatures were in her entire dataset.
Input
The input is formed of n (1 ≤ n ≤ 1000) lines, each line i (1 ≤ i ≤ n) being a space-separated list of ki
(2 ≤ ki
≤ 100) tokens:
- the first token is the date of the measurement, in the form YYYY-MM-DD;
- for j (2 ≤ j ≤
ki
), the j-th entry is an integer temperature measurementtij
(-50 ≤tij
≤ 50).
Output
The output should contain a single line with two integers: the lowest and highest temperatures in the entire dataset, in this order.
Input example #1
2020-01-15 5 4 6 8 12 13 12 9 7 2020-01-16 6 3 4 6 10 12 11 7
Output example #1
3 13