22199_GreatestCommonDivisor

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

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

Pro.ID

22199

Title

Greatest Common Divisor

Title链接

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

AC

0

Submit

39

Ratio

0.00%

时间&空间限制

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

    Give two relatively prime integers a and b with a > b, and another three integers m, n and p.
    Calculate gcd( am - bm , an - bn ) mod p.

    输入

    A line contains five unsigned 32-bit integers a, b, m, n and p. ( p > 1 )

    Multiple inputs. Process to the end of file.

    输出

    Description
    Give two relatively prime integers a and b with a > b, and another three integers m, n and p.
    Calculate gcd( am - bm , an - bn ) mod p.
    Input

    A line contains five unsigned 32-bit integers a, b, m, n and p. ( p > 1 )

    Multiple inputs. Process to the end of file.

    Output

    For each case, output a line contains the calculate result.

    Sample Input

    8 7 5 4 100
    11 5 6 3 20

    Sample Output

    1
    6

    Source

    样例输入

    8 7 5 4 100
    11 5 6 3 20

    样例输出

    1
    6

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部