GCD Of Differences

Computer Mathematics Hard 2 views
Back to Questions

Problem Description

Given n numbers, print gcd of all |ai-a1|.

Input Format

n then n integers.

Output Format

One integer.

Sample Test Case

Input:
4 6 10 14 18
Output:
4

Constraints

n>=2

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next