n, m, p = gets.chomp.split.map(&:to_i)
arr, arr2 = [0], [0]
m.times{
    diff = gets.to_i - p
    diff += n if diff < 0
    arr << diff
    arr2 << n - diff
}
arr.sort!
arr2.sort!.reverse!
min = nil
arr.zip(arr2){|a, b|
    x, y = [a, b].minmax
    cost = x * 2 + y
    min = cost if min.nil? || min > cost
}
puts min * 100


