/*
_ __ __ __ ____ ___ _ __
| | /| / / ___ _ / /_ ____ / / / __ \ ___ ___ / _ \ (_) ___ ____ ___ / /
| |/ |/ / / _ `// __// __/ / _ \ / /_/ / / _ \/ -_) / ___/ / / / -_)/ __// -_) /_/
|__/|__/ \_,_/ \__/ \__/ /_//_/ \____/ /_//_/\__/ /_/ /_/ \__/ \__/ \__/ (_)
*/
#pragma GCC optimize("O3")
#pragma GCC optimize ("unroll-loops")
// #pragma GCC target("avx2")
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define ld long double
#define all(v) v.begin(), v.end()
#define allr(v, l, r) v.begin() + l, v.begin() + r + 1
#define rall(v) v.rbegin(), v.rend()
#define rallr(v, l, r) v.rbegin() + ((int)v.size() - 1 - r), v.rbegin() + ((int)v.size() - l)
#define endl "\n"
#define newline cout << endl;
using namespace std;
// constants
const int INF = 1e9;
// functions
// structs
// globals
// notes
/*
-stuff you should look for-
* int overflow, array bounds
* special cases (n=1?)
* do something instead of nothing and stay organized
* WRITE STUFF DOWN
* DON'T GET STUCK ON ONE APPROACH
continue - skip the rest in the loop
*/
void solve()
{
int n, m, q;
cin >> n >> m >> q;
set <int> ps;
for (int i = 1; i <= m; i++)
{
int k;
cin >> k;
ps.insert(k);
ps.insert((k + n) % (2 * n));
}
auto dist = [&](int x, int y)
{
return min(abs(x - y), x + 2 * n - y);
};
while (q--)
{
int u, v;
cin >> u >> v;
auto it = ps.lower_bound(u);
if (it == ps.end())
{
it = ps.begin();
}
int l = *it;
it = ps.upper_bound(u);
if (it == ps.begin())
{
it = ps.end();
}
it--;
int r = *it;
int res = dist(u, v);
res = min(res, dist(v, (l + n) % (2 * n)) + 1 + dist(u, l));
res = min(res, dist(v, (r + n) % (2 * n)) + 1 + dist(u, r));
cout << res << endl;
}
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int testcount = 1;
// cin >> testcount;
while (testcount--)
{
solve();
newline
}
}
/*
$$$$$$$$\ $$$$$$$$\
$$ _____|\____$$ |
$$ | $$ /
$$$$$\ $$ /
$$ __| $$ /
$$ | $$ /
$$$$$$$$\ $$$$$$$$\
\________|\________|
*/