#include <bits/stdc++.h>
using namespace std;
int n;
int dist(int x, int y){
if(x > y) swap(x, y);
return min(y - x, 2 * n - (y - x));
}
int main(){
cin.tie(0)->sync_with_stdio(0);
int m, q; cin >> n >> m >> q;
set<int> s;
while(m--){
int k; cin >> k;
s.insert(k);
// s.insert(k + n);
}
vector<pair<pair<int, int>, int>> queries;
vector<int> ans(q, 0);
for(int i=0; i<q; i++){
int x, y; cin >> x >> y;
if(x > y) swap(x, y);
int rot = 2 * n - x;
if(2 * n - (y - x) < (y - x)) rot = 2 * n - y;
// cout << "rot = " << rot << " " << dist(x, y) << endl;
queries.push_back({{rot, dist(x, y)}, i});
}
sort(queries.begin(), queries.end());
// todo mundo move 1 no sentido horario
for(auto [x, j] : queries){
auto [i, y] = x;
while(*s.rbegin() + i >= n){
int c = *s.rbegin();
s.erase(c);
s.insert(c - n);
}
// for(auto c : s) cout << c << " ";
// cout << endl;
// todo mundo no set é x + i
assert(y <= n);
ans[j] = y;
for(auto pos : s){
ans[j] = min(ans[j], dist(0, pos + i) + 1 + dist(pos + i + n, y));
ans[j] = min(ans[j], dist(0, pos + i + n) + 1 + dist(pos + i, y));
}
/*
if(y == n){
ans[j] = min(ans[j], 2 * min(*s.begin() + i, n - *s.rbegin() - i) + 1);
continue;
}
if(*s.begin() + i <= y) ans[j] = min(ans[j], 2 * (*s.begin() + i) + n - y + 1);
if(*s.rbegin() + i >= y){
ans[j] = min(ans[j], n - y + 1);
}
*/
}
for(int i=0; i<q; i++) cout << ans[i] << "\n";
return 0;
}