Test Case for Question #1 in DWITE 2012-2013 High School Round 2
Contest: DWITE 2012-2013 High School Round 2
Question: #1
Input File: DATA1.txt
Output File: OUT1.txt
Input
10 1
10 5
1 10
12 3
1 1
Output
4
8
1
7
1