F. Peter's polygon problem
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
5
4 2 9 1 4
Output
1 5
Input
10
69 42 1 2 1 46 1 2 1 10
Output
1 6