TouchStone
  Please Login
Login Sign Up
距离明年CSP第一轮: ??天 距离CSP第二轮: ??天 距离NOIP还有: ??天
 Homepage  Problem Set  Examinations  Submissions  Discussions  Statistics
  • Home
  • Problem Set
  • P4649
  • Problem
  • P4649【CQOI2018】破解D-H协议
    Limits : Time Limit : - MS   Memory Limit : - KB
    Judgment Tips : 1s,512m
    Description

    Input Format

    AC

    Output Format

    AC

    Sample Input

    3 31 

    27 16 
    21 3 
    9 26

    Sample Output


    21 
    25

    Hint

    30% 2≤A,B,P≤1000
    100% 2≤A,B<P<2^31 2≤g<20 1≤n≤20