Fun Theory
CodeChefOpen on judge ↗
Consider the set of non negative integer values of X which satisfy the equation AX = C (mod M), given that A and M are coprime. Find the sum of the least K values in this set. Print the answer modulo 109 + 7. If the number of terms in this sequence is less than K, output 0. Input The first line of the input contains an integer T denoting the number of test cases. The next T lines contains four
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start