#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m, q;
cin >> n >> m >> q;
vector<vector<int>> adj(2 * n);
for (int i = 0; i < 2 * n; ++i) {
adj[i].push_back((i - 1 + 2 * n) % (2 * n));
adj[i].push_back((i + 1) % (2 * n));
}
for (int i = 0, k; i < m; ++i) {
cin >> k;
adj[k].push_back(k + n);
adj[k + n].push_back(k);
}
auto sssp = [&](int u) {
vector<int> dist(2 * n, inf);
queue<int> q;
q.push(u);
dist[u] = 0;
while (!q.empty()) {
int u = q.front();
q.pop();
for (int &i : adj[u]) {
if (dist[u] + 1 < dist[i]) {
dist[i] = dist[u] + 1;
q.push(i);
}
}
}
return dist;
};
vector<vector<int>> dist(2 * n);
for (int i = 0; i < 2 * n; ++i) {
dist[i] = sssp(i);
}
while (q--) {
int x, y;
cin >> x >> y;
cout << dist[x][y] << '\n';
}
}