import java.util.Scanner object no18{ def main(args:Array[String]):Unit={ val sc = new Scanner(System.in) val n,m = sc.nextInt() val nums = for(i <- 1 to n) yield sc.nextInt() println(nums.max - nums.min) } }