package main import ( "bufio" "fmt" "os" "strconv" ) func main() { var N, K int _, _ = fmt.Scan(&N, &K) sc := bufio.NewScanner(os.Stdin) sc.Split(bufio.ScanWords) max, min := 1, 1000 for i := 0; i < N; i++ { sc.Scan() n, _ := strconv.Atoi(sc.Text()) if n > max { max = n } if n < min { min = n } } fmt.Println(max - min) }