import strutils proc getInt: int = stdin.readLine.parseInt let N, K = getInt() var nMax = 0 nMin = int.high for i in 0 ..< N: let n = getInt() nMax = max(n, nMax) nMin = min(n, nMin) echo nMax - nMin