object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val Ts = Array.fill(sc.nextInt())(sc.nextInt())
  val sum = Ts.sum
  List.fill(sc.nextInt())(sc.nextInt() -> sc.nextInt()).foreach {
    case (p, x) => println(sum - Ts(p - 1) + x)
  }
}
