← All problemsSign in

Mod Operator

Akshay is interested in mathematics, one day he came across a problem of modulus operator.He has a list of M integers say arr[M] and has to find all integers K such that : - K > 1 - arr[1]%K = arr[2]%K = arr[3]%K = ... = arr[M]%K where '%' is a modulus operator. Help Akshay to find all such K's. ###Input: - First line of input contains an integer M. Then M lines follow each containing one integ

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start