{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e有一个$n\\times m$棋盘,一个棋子想要从位置$(1, 1)$到达位置$(n, m)$。\u003cbr\u003e棋子只有当满足条件$x_1, y_1, x_2, y_2$时才能从位置$(x_1, y_1)$到达位置$(x_2, y_2)$。\u003cbr\u003e不幸的是,棋盘上有一些障碍物。棋子永远不能停留在有障碍物的格子上。\u003cbr\u003e我想让你告诉我,棋子有多少种方式可以实现它的目标。\u003c/div\u003e"}},{"title":"输入","value":{"format":"HTML","content":"输入包括多个测试用例。\u003cbr\u003e对于每个测试用例:\u003cbr\u003e第一行是三个整数,$n, m, r, (1\\leq n, m\\leq 10^{18}, 0 \\leq r\\leq 100)$,表示棋盘的高度,棋盘的宽度和棋盘上的障碍物数量。\u003cbr\u003e然后是$r$行,每行有两个整数,$x, y(1\\leq x\\leq n, 1\\leq y\\leq m)$,表示障碍物的位置。请注意,位置$(1, 1)$上永远没有障碍物。"}},{"title":"输出","value":{"format":"HTML","content":"对于每个测试用例,输出一行 \"Case #x: y\",其中x是从1开始的案例编号。y是取模$110119$后的答案。"}},{"title":"示例","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1 1 0\r\n3 3 0\r\n4 4 1\r\n2 1\r\n4 4 1\r\n3 2\r\n7 10 2\r\n1 2\r\n7 1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: 1\r\nCase #2: 0\r\nCase #3: 2\r\nCase #4: 1\r\nCase #5: 5\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}