array = [] (gets.to_i + 1).times do array << gets.to_i end array.delete_at(0) array.sort! puts array.last - array.first