package main import ( "bufio" "fmt" "strings" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) func min(slices []int) int { var res = 1000000 for _, v := range slices { if v < res { res = v } } return res } func main(){ var m int if sc.Scan() { m, _ = strconv.Atoi(sc.Text()) } arr := make([]string, m) if sc.Scan(){ arr = strings.Fields(sc.Text()) } arr_int := make([]int, m) for i, v := range arr{ arr_int[i], _ = strconv.Atoi(v) } max := arr_int[len(arr_int)-1] - arr_int[0] distances := make([]int, m-1) for i := 0; i < len(arr_int)-1; i++ { distances[i] = arr_int[i+1] - arr_int[i] } fmt.Println(max) fmt.Println(min(distances)) }