import scala.annotation.tailrec
import scala.collection.mutable

object Main extends App {
  import scala.io.StdIn._
  val Array(n, m, p) = readLine.trim.split(' ').map(_.toInt)
  val destination = Array.fill(m){(readInt() + n - p) % n}.sorted
  var min = math.min(n - 1, math.min((n - destination.head), destination.last))
  for (i ← destination.indices.tail) {
    if (min > math.min(destination(i - 1) * 2 + (n - destination(i)), destination(i - 1) + (n - destination(i)) * 2)) {
      min = math.min(destination(i - 1) * 2 + (n - destination(i)), destination(i - 1) + (n - destination(i)) * 2)
    }
  }
  println(min * 100)
}
