经典简约
清爽简洁,回归本真
液态水晶
毛玻璃+霓虹光带
赛博朋克
霓虹故障艺术风
🚫
违规操作检测
禁止使用右键菜单
⚠️ 此操作已被系统记录
1

A Mathematical Curiosity

📝 题解 🔵 仅限 C++
题目描述
<div class="panel_content">Given two integers n and m, count the number of pairs of integers (a,b) such that 0 &lt; a &lt; b &lt; n and (a^2+b^2 +m)/(ab) is an integer.<br /> <br /> This problem contains multiple test cases!<br /> <br /> The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks.<br /> <br /> The output format consists of N output blocks. There is a blank line between output blocks.<br /> </div>
输入格式
<div class="panel_content">You will be given a number of cases in the input. Each case is specified by a line containing the integers n and m. The end of input is indicated by a case in which n = m = 0. You may assume that 0 &lt; n &lt;= 100.</div>
输出格式
<div class="panel_content">For each case, print the case number as well as the number of pairs (a,b) satisfying the given property. Print the output for each case on one line in the format as shown below.<br /> </div>
样例
样例输入 1
1 10 1 20 3 30 4 0 0
样例输出 1
Case 1: 2 Case 2: 4 Case 3: 5
提交代码
请先登录后提交

🤖 AI 解题助手

DeepSeek
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这道题,可以帮你分析思路、提供代码示例。
⚠️ 请先登录后使用