22233_AMathematicalCuriosity

2022-5-16 18:21| 发布者: Hocassian| 查看: 22| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506220196500-Problem List-采集的数据-后羿采集器.html

Pro.ID

22233

Title

A Mathematical Curiosity

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22233

AC

2

Submit

4

Ratio

50.00%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    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
    20 3
    30 4
    0 0

    Sample Output

    Case 1: 2
    Case 2: 4
    Case 3: 5

    Source

    样例输入

    10 1
    20 3
    30 4
    0 0

    样例输出

    Case 1: 2
    Case 2: 4
    Case 3: 5

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部