Classic
Clean & simple
Crystal
Glassmorphism + Neon
Cyberpunk
Neon glitch art
🚫
违规Action检测
禁止Use右键菜单
⚠️ 此Action已被系统记录
1

A Mathematical Curiosity

📝 Solutions 🔵 仅限 C++
Problems Description
<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>
Input格式
<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>
Output格式
<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>
Sample
Sample Input 1
1 10 1 20 3 30 4 0 0
Sample Output 1
Case 1: 2 Case 2: 4 Case 3: 5
Submit Code
请先Login后Submit

🤖 AI 解题助手

OpenRouter
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这problems题,可以帮你points析思路、提供Code示例。
🔓 完全Free · 无需消耗 Token