File.open("ALDS1_1_D-in1.txt", "r") do |file|
  file.each_line do |v|
    arrs << v
  end
end
arr_size = arrs.size
max_diff_val = nil
min_val = nil
t1 = Time.now
arrs.each_with_index do |val, index|
  min_val = val if index == 0
  max_diff_val = val - min_val
  min_val = val if val < min_val
  cal_i += 1
end

t2 = Time.now
puts max_diff_val