#P3598. Koishi Loves Number Theory
Koishi Loves Number Theory
Description
Koishi loves number theory.
Her friend Flandre, to check whether her love for number theory is true, gave her a problem.
Given .
Given and numbers , compute modulo .
As usual, the naive Koishi pretended she could not solve it and came to ask you, hoping you can give the answer within 1 second.
Input Format
The first line contains two integers and . The next line contains integers representing .
Output Format
One integer, the answer.
3 5
1 2 4 5 0
44044
Hint
denotes the least common multiple of several numbers.
Constraints:
- For of the testdata, , , .
- For another of the testdata, , , .
- For another of the testdata, , , .
- For of the testdata, , , , and .
Translated by ChatGPT 5
京公网安备 11011102002149号