import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.PrintWriter

var X: Int = 0

fun solve() {
    X = inf.readLine()!!.toInt()
    val k = inf.readLine()!!.toInt()
    val r = inf.readLine()!!.split(' ').map(String::toInt).toIntArray()
    val q = inf.readLine()!!.toInt()
    var cur = G(0, X, 0, X)
    var ri = 0
    var rPrev = 0
    for (i in 0 until q) {
        val (t, a) = inf.readLine()!!.split(' ').map(String::toInt)
        while (ri < r.size && r[ri] <= t) {
            cur = compute(cur, r[ri] - rPrev, ri % 2)
            rPrev = r[ri++]
        }
        println(compute(cur, t - rPrev, ri % 2).calc(a))
    }
}

fun compute(g: G, t: Int, sign: Int): G {
    if (sign == 1) {
        if (g.ansMin + t >= X) return G(X, X, X, X)
        if (g.ansMax + t <= X) return G(g.aMin, g.aMax, g.ansMin + t, g.ansMax + t)
        return G(g.aMin, X + g.aMin - g.ansMin - t, g.ansMin + t, X)
    } else {
        if (g.ansMax - t <= 0) return G(X, X, 0, 0)
        if (g.ansMin - t >= 0) return G(g.aMin, g.aMax, g.ansMin - t, g.ansMax - t)
        return G(t + g.aMin - g.ansMin, g.aMax, 0, g.ansMax - t)
    }
}

data class G(val aMin: Int, val aMax: Int, val ansMin: Int, val ansMax: Int) {
    fun calc(a: Int) = when (a) {
        in 0..aMin -> ansMin
        in aMin..aMax -> a - aMin + ansMin
        else -> ansMax
    }
}

fun main(args: Array<String>) {
    solve()
    ouf.close()
}

val inf = BufferedReader(InputStreamReader(System.`in`))
val ouf = PrintWriter(System.out)