{"problem":{"name":"BZOJ3518 点组计数","description":{"content":"平面上摆放着一个 $n\\times m$ 的点阵，如下图是一个 $3\\times 4$ 的点阵图： ![](https://cdn.luogu.com.cn/upload/image_hosting/6tq3jene.png) 现问，有多少个三元点对组 $(a,b,c)$ 满足 $a,b,c$ 三点共线，顺序无关紧要，例如 $(a,b,c)$ 与 $(b,c,a)$ 算一组。答案对 $10^9","description_type":"Markdown"},"platform":"Luogu","limit":{"time_limit":1000,"memory_limit":524288},"difficulty":{"LuoguStyle":"P6"},"is_remote":true,"is_sync":true,"sync_url":null,"sign":"LGP10636"},"statements":[{"statement_type":"Markdown","content":"平面上摆放着一个 $n\\times m$ 的点阵，如下图是一个 $3\\times 4$ 的点阵图：\n\n![](https://cdn.luogu.com.cn/upload/image_hosting/6tq3jene.png)\n\n现问，有多少个三元点对组 $(a,b,c)$ 满足 $a,b,c$ 三点共线，顺序无关紧要，例如 $(a,b,c)$ 与 $(b,c,a)$ 算一组。答案对 $10^9+7$ 取模。\n\n## Input\n\n一行，两个正整数 $n,m$。\n\n## Output\n\n一行一个整数，表示答案对 $10^9+7$ 取模后的结果。\n\n[samples]\n\n## Note\n\n数据保证，$1\\leq n,m\\leq 5\\times 10^4$。","is_translate":false,"language":"English"}],"meta":{"iden":"LGP10636","tags":["数论","O2优化","莫比乌斯反演"],"sample_group":[["3 4","20"]],"created_at":"2026-03-03 11:09:25"}}