
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Find the minimum and maximum in one iteration. Let them be mn and mx.
Try all the numbers in the range [1, mn] and check the largest number which divides both of them.