{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"找出以下代码的结果:\n\n\u003cdiv class\u003d\"haveborder\"\u003e\n\t\n``` \nlong long pairsFormLCM( int n ) {\n long long res \u003d 0;\n for( int i \u003d 1; i \u003c\u003d n; i++ )\n for( int j \u003d i; j \u003c\u003d n; j++ )\n if( lcm(i, j) \u003d\u003d n ) res++; // lcm表示最小公倍数\n return res;\n}\n```\n\t\n\u003c/div\u003e\n\n这段代码的直接实现可能会超时。如果你分析一下这段代码,你会发现它实际上是在计算满足 **lcm(i, j) \u003d n** 且 **(i \u0026#8804; j)** 的 **(i, j)** 对的数量。"}},{"title":"输入","value":{"format":"MD","content":"输入以一个整数 **T (\u0026#8804; 200)** 开始,表示测试用例的数量。\n\n每个测试用例以包含一个整数 **n (1 \u0026#8804; n \u0026#8804; 10\u003csup\u003e14\u003c/sup\u003e)** 的行开始。"}},{"title":"输出","value":{"format":"MD","content":"对于每个测试用例,打印出测试用例编号和函数 **pairsFormLCM(n)** 返回的值。"}},{"title":"样例","value":{"format":"MD","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\u003e15\n2\n3\n4\n6\n8\n10\n12\n15\n18\n20\n21\n24\n25\n27\n29\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 2\nCase 2: 2\nCase 3: 3\nCase 4: 5\nCase 5: 4\nCase 6: 5\nCase 7: 8\nCase 8: 5\nCase 9: 8\nCase 10: 8\nCase 11: 5\nCase 12: 11\nCase 13: 3\nCase 14: 4\nCase 15: 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}