Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ookay .. I can to tell you the approach (take popcorn .. It'll take a while to sum it up :P)
- ookay .. I can to tell you the approach (take popcorn .. It'll take a while to sum it up :P) let's say you have array of numbers ... and you know that if N is divided by D, you will have a remain (maximal) .. so lets say it is remain X ... so N mod D == X ... you always know, that for each number of tat array, it is true, that M (another N) mod D == X (the same X .. as said in the problem) .. so you know that N%D==X && M%D==X .. which means that N=M%D (a congruence) ... well what does that mean? It means that N-M=0%M (from the formula above) ~~ repeating.. this 'equation' is valid for ALL numbers in the array... so now, you want to cummulate this for all the elements... so you are looking for a divisor of all the differences ... so you are looking for a GREATIST divisor of ALL differences between ALL elements
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement