Pro.ID22233 TitleA Mathematical Curiosity Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22233 AC2 Submit4 Ratio50.00% 时间&空间限制描述Given two integers n and m, count the number of pairs of integers (a , b) such that 0 < a < b < n and (a2 + b2 + m)/(ab) is an integer. 输入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 < n ≤ 100. 输出Description Given two integers n and m, count the number of pairs of integers (a , b) such that 0 < a < b < n and (a2 + b2 + m)/(ab) is an integer. Input 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 < n ≤ 100. Output 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. Sample Input 10 1 Sample Output Case 1: 2 Source 样例输入10 1 样例输出Case 1: 2 作者 |