#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9 + 7;
signed main() {
cin.tie(0); ios::sync_with_stdio(false);
int N, M, Q;
cin >> N >> M >> Q;
vector<bool> phriend(2*N);
for(int i = 0; i < M; i++) {
int k; cin >> k;
phriend[k] = phriend[k+N] = 1;
}
vector<int> L(2*N), R(2*N);
int pr = -1;
for(int i = 0; i < 2*N; i++) {
if (phriend[i]) pr = i;
L[i] = pr;
}
for(int i = 0; i < 2*N; i++) {
if (phriend[i]) break;
L[i] = pr;
}
pr = -1;
for(int i = 2*N-1; i >= 0; i--) {
if (phriend[i]) pr = i;
R[i] = pr;
}
for(int i = 2*N-1; i >= 0; i--) {
if (phriend[i]) break;
R[i] = pr;
}
function<int(int, int)> dist = [&](int a, int b) {
if (a > b) swap(a, b);
return min(b-a, 2*N-b+a);
};
for(int i = 0; i < Q; i++) {
int x, y;
cin >> x >> y;
if (x > y) swap(x, y);
cout << min({dist(x,y), 1+dist(x,L[x])+dist((L[x]+N)%(2*N),y), 1+dist(x,R[x])+dist((R[x]+N)%(2*N),y), 1+dist(y,L[y])+dist((L[y]+N)%(2*N),x), 1+dist(y,R[y])+dist((R[y]+N)%(2*N),x)}) << '\n';
}
}