Same Modulo !
All submissions for this problem are available.
Anand has a list array of H integers. He has to find all integers M such that :
M > 1 and
array%M =array%M = array%M = ... = array[H]%M
where '%' is a modulus operator
Help Anand to find all such M's.
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 all possible integers M separated by space in increasing order.
2<= H <=100
1< value of each integer <109
All integers will be distinct
Input: 3 38 6 34 Output: 2 4
|Time Limit:||0.8 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions