C. Pyramid
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3
5 3
5 4
5 5
Output
2
3
2
Input
2
5 1
5 2
Output
0
1