Knights of the Round Table

题目描述

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=861&page=show_problem&problem=4729 [PDF](https://uva.onlinejudge.org/external/128/p12864.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12864/1f8ea01a95cc2461d76f0ed3412070c69aa62cbc.png)

输入输出格式

输入格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12864/a13df229b10c3933dd857a71d7231ad08f6e5a38.png)

输出格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12864/9f991ddab99a2fb469e0ab2b8fbc65569560859e.png)

输入输出样例

输入样例 #1

3 1
1 2
5 4
5 5
1 2
2 3
3 4
8 3
3 3
4 8
2 4

输出样例 #1

2
1
2