Same Modulo !
CodeChefOpen on judge ↗
Anand has a list array[] of H integers. He has to find all integers M such that : M > 1 and array[1]%M =array[2]%M = array[3]%M = ... = array[H]%M where '%' is a modulus operator Help Anand to find all such M's. Input First line of input contains an integer H. Then H lines follow each containing one integer of the list. Input data is such that at least one integer M will always exist. Output
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