#include <bits/stdc++.h>
using namespace std;
int N;
int dist_circle(int a, int b)
{
int d = abs(a - b);
return min(d, 2*N - d);
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m, q;
cin >> n >> m >> q;
N = 2 * n;
vector<int> bf(N, -1);
for (int i = 0; i < m; i++)
{
int k;
cin >> k;
bf[k] = k + n;
bf[k + n] = k;
}
while (q--)
{
int x, y;
cin >> x >> y;
int ans = dist_circle(x, y);
if (bf[x] != -1) {
ans = min(ans,
dist_circle(x, bf[x]) + 1 + dist_circle(bf[x], y)
);
}
if (bf[y] != -1) {
ans = min(ans,
dist_circle(x, bf[y]) + 1 + dist_circle(bf[y], y)
);
}
cout << ans << "\n";
}
return 0;
}