L. Leadfoot
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
5
1 1
2 2
4 6
6 4
12 3
Output
1
1
4
16
1024