#P5431. 【模板】模意义下的乘法逆元 2
【模板】模意义下的乘法逆元 2
Description
Given positive integers , find their multiplicative inverses modulo .
Since outputting all inverses would be too much, a constant is given. The answer you need to output is:
Output the answer modulo .
Input Format
The first line contains three positive integers , with the meaning as described in the statement.
The second line contains positive integers , the numbers whose inverses you need to compute.
Output Format
Output one integer in one line, representing the answer.
6 233 42
1 4 2 8 5 7
91
Hint
For of the testdata, .
For of the testdata, , , , and is guaranteed to be prime.
Note: The time limit for this problem is relatively strict. Please use faster I/O methods.
Translated by ChatGPT 5
京公网安备 11011102002149号