function Main(input) { input = input.trim().split("\n"); input.shift(); input.shift(); let n = input.map((s)=>parseInt(s)); console.log(Math.max.apply(0, n) - Math.min.apply(0, n)); } Main(require("fs").readFileSync("/dev/stdin", "utf8"));