Tudor is managing his Roombas!
Tudor has a total of
Unfortunately, Tudor also has
Tudor is going to let his Roombas clean his room, and he wonders: how many times will any Roomba run over a cord? Note that if a Roomba runs over the end of a cord, it still counts.
Constraints
Subtask 1 [5%]
Subtask 2 [10%]
Subtask 3 [15%]
Subtask 4 [70%]
No additional constraints.
Input Specification
The first line contains
The next
The next
Output Specification
On one line, output the number of times any Roomba will run over a cord.
Sample Input
3 3
7 2
7 5
5 7
3 1
7 5
4 5
Sample Output
4
Explanation
The Roombas are shown going left to right, and the cords from the bottom up. There are four points of intersection.
Comments
Notice how roombas move horizontally like rows and cords are vertical like columns. Coincidence? I think not!
Uh... it is, lol.
#define int long long
That's so cringe.
no u
inspire my grad quote