#P3811. 【模板】模意义下的乘法逆元
【模板】模意义下的乘法逆元
Description
Given positive integers , find the multiplicative inverses modulo for all integers in .
The multiplicative inverse of modulo is defined as the solution to .
Input Format
One line with two positive integers .
Output Format
Output lines, where the -th line denotes the multiplicative inverse of modulo .
10 13
1
7
9
10
8
11
2
5
3
4
Hint
All testdata satisfy , . The input guarantees that is prime.
Translated by ChatGPT 5
京公网安备 11011102002149号