J. Tic-Tac-Toe on a Graph
time limit per test
1 second
memory limit per test
960 megabytes
input
standard input
output
standard output
Example
Input
8 9
1 2
1 4
1 5
2 3
2 7
3 4
3 5
3 6
4 6
Output
5