// No.135 とりあえず1次元の問題 package main import ( "bufio" "fmt" "math" "os" "sort" "strconv" ) var sc = bufio.NewScanner(os.Stdin) var wr = bufio.NewWriter(os.Stdout) func next() string { sc.Scan() return sc.Text() } func nextInt() int { i, _ := strconv.Atoi(next()) return i } func nextFloat() float64 { f, _ := strconv.ParseFloat(next(), 64) return f } func nextInts(n int) []int { ret := make([]int, n) for i := 0; i < n; i++ { ret[i] = nextInt() } return ret } func nextFloats(n int) []float64 { ret := make([]float64, n) for i := 0; i < n; i++ { ret[i] = nextFloat() } return ret } func nextStrings(n int) []string { ret := make([]string, n) for i := 0; i < n; i++ { ret[i] = next() } return ret } func main() { sc.Split(bufio.ScanWords) var n = nextInt() var x = nextInts(n) sort.Ints(x) ans := math.MaxInt64 for i := 1; i < n; i++ { diff := int(math.Abs(float64(x[i]) - float64(x[i-1]))) if diff > 0 { ans = min(ans, diff) } } if ans == math.MaxInt64 { fmt.Println(0) } else { fmt.Println(ans) } }