I. The Keeper vs The Overwriter
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Examples
Input
5 6
1 2
2 3
5 2
5 1
2 4
4 6
Output
2
Input
3 3
1 2
2 3
3 2
Output
0