{"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 Matt喜欢字母L。\u003cbr\u003e\u003cbr\u003e 如果且仅如果存在x,y满足以下条件,点集P就是(a, b)-L:\u003cbr\u003e\u003cbr\u003e \u003cb\u003eP \u003d {(x, y), (x + 1, y), . . . , (x + a, y), (x, y + 1), . . . , (x, y + b)}(a, b ≥ 1)\u003c/b\u003e\u003cbr\u003e\u003cbr\u003e 如果且仅如果Q是一个(a, b)-L集合并且gcd(a, b) \u003d 1,那么点集Q就是好的。\u003cbr\u003e\u003cbr\u003e Matt得到了一个点集S,请帮他找到有序对集合(A, B)的数量,满足以下条件:\u003cbr\u003e\u003cbr\u003e \u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/6cdc466e4f1314d324205f95a7ca622a?v\u003d1710410110\"\u003e\u003c/div\u003e"}},{"title":"输入","value":{"format":"HTML","content":"第一行只包含一个整数T,表示测试用例的数量。\u003cbr\u003e\u003cbr\u003e 对于每个测试用例,第一行包含一个整数N (0 ≤ N ≤ 40000),表示点集S的大小。\u003cbr\u003e\u003cbr\u003e 接下来的N行,每行包含两个整数x\u003csub\u003ei\u003c/sub\u003e, y\u003csub\u003ei\u003c/sub\u003e,表示S中第i个点的坐标 (1 ≤ x\u003csub\u003ei\u003c/sub\u003e, y\u003csub\u003ei\u003c/sub\u003e ≤ 200)。保证所有的(x\u003csub\u003ei\u003c/sub\u003e, y\u003csub\u003ei\u003c/sub\u003e)都是不同的。"}},{"title":"输出","value":{"format":"HTML","content":"对于每个测试用例,输出一行“Case #x: y”,其中x是案例编号(从1开始),y是有序对的数量。"}},{"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\u003e2\r\n6\r\n1 1\r\n1 2\r\n2 1\r\n3 3\r\n3 4\r\n4 3\r\n9\r\n1 1\r\n1 2\r\n1 3\r\n2 1\r\n2 2\r\n2 3\r\n3 1\r\n3 2\r\n3 3\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: 2\r\nCase #2: 6\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"提示","value":{"format":"HTML","content":"在第二个示例中,Matt可以选择的有序对集合有:\u003cbr\u003eA \u003d {(1, 1), (1, 2), (1, 3), (2, 1)} 和 B \u003d {(2, 2), (2, 3), (3, 2)}\u003cbr\u003eA \u003d {(2, 2), (2, 3), (3, 2)} 和 B \u003d {(1, 1), (1, 2), (1, 3), (2, 1)}\u003cbr\u003eA \u003d {(1, 1), (1, 2), (2, 1), (3, 1)} 和 B \u003d {(2, 2), (2, 3), (3, 2)}\u003cbr\u003eA \u003d {(2, 2), (2, 3), (3, 2)} 和 B \u003d {(1, 1), (1, 2), (2, 1), (3, 1)}\u003cbr\u003eA \u003d {(1, 1), (1, 2), (2, 1)} 和 B \u003d {(2, 2), (2, 3), (3, 2)}\u003cbr\u003eA \u003d {(2, 2), (2, 3), (3, 2)} 和 B \u003d {(1, 1), (1, 2), (2, 1)}\u003cbr\u003e因此,答案是6。\u003cbr\u003e"}}]}