1256 乘法逆元 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注给出2个数M和N(M < N),且M与N互质,找出一个数K满足0 < K < N且K * M % N = 1,如果有多个满足条件的,输出最小的.Input输入2个数M, N中间用空格分隔(1 <= M < N <= 10^9)OutPut输出一个数K,满足0 < K < N且K * M % N = 1,如果有多个满足条件的,输出最小的.Input示例2
The modular modular multiplicative inverse of an integer a modulo m is an integer x such that a-1≡x (mod m). This is equivalent to ax≡1 (mod m). Input There are multiple test cases. The first line of input is an integer T ≍ 2000 indicating the number