Pro.ID22199 TitleGreatest Common Divisor Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22199 AC0 Submit39 Ratio0.00% 时间&空间限制描述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 Sample Output 1 Source 样例输入8 7 5 4 100 样例输出1 作者 |