当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5679:ztr loves chess

题目描述
ztr loves chess. Not long ago he argued with Hillan the Rabbit that a knight is better than a king. To prove his point he tries to show that the knight is very fast but Hillan doesn't accept statements without evidence. He constructed an infinite chessboard for ztr, where he deleted several squares to add some more interest to the game. ztr only needs to count how many different board squares a knight standing on a square with coordinates of (0, 0) can reach in no more than k moves. Naturally, it is forbidden to move to the deleted squares.

ztr doesn't very much like exact sciences himself and he thinks it too simple so he doesn't want to program, that's why he will hardly be able to get ahead of Hillan who has already started solving the problem. Help ztr to solve the problem faster than Hillan.
输入解释
There are T cases $(1<=T<=10)$
For each case:
The first line contains two integers k and n $(0\leq\;k&#8201;\leq\;10^{18},&#8201;0&#8201;\leq\;&#8201;n\leq\;&#8201;440)$ which are correspondingly the maximal number of moves a knight can make and the number of deleted cells. Then follow n lines, each giving the coordinates of a deleted square in the form (xi,&#8201;yi) (|xi|&#8201;≤&#8201;10,&#8201;|yi|&#8201;≤&#8201;10). All the numbers are integer, the deleted squares are different and it is guaranteed that the square (0,&#8201;0) is not deleted.

Please, do not use %lld specificator to read or write 64-bit integers in C++. It is preffered to use cin (also you may use %I64d).
输出解释
You must print the answer on a single line. As it can be rather long, you should print it modulo 1000000007.
输入样例
1
2 7
-1 2
1 2
2 1
2 -1
1 -2
-1 -2
-2 -1
输出样例
9
来自杭电HDUOJ的附加信息
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5679

最后修改于 2020-10-25T23:24:45+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 65536/65536K(Java/Others)