EasyRating 800
Room for Two
Each dormitory room has p people and capacity q. Two friends want to move into the same room. In how many rooms is there space for both?
Input
n, then n lines 'p q'.
Output
One integer.
Sample 1
Input
3 1 1 2 2 3 3
Output
0
Sample 2
Input
3 1 10 0 10 10 10
Output
2
Output appears here