#P1956. Sum
Sum
Description
Given a sequence and .
Let , then:
$$\mathit{Answer}=\min\{S_{i,j}\bmod p\ |\ S_{i,j}\bmod p\ge k\}$$where , and $\{S_{i,j}\bmod p\ |\ S_{i,j}\bmod p\ge k\}\ne\varnothing$.
Input Format
The first line contains three positive integers .
The second line contains positive integers, denoting .
Output Format
Output one positive integer on a single line, which is .
7 2 17
12
13
15
11
16
26
11
2
Hint
Constraints
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号