func_code_string: #include <bits/stdc++.h>   using namespace std;   long long a[100100], b[100100];   int main() {     ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);     long long n, m, cl, ce, v, x1, y1, x2, y2, q, mi;     cin >> n >> m >> cl >> ce >> v;     for (long long i = 0; i < cl; i++) cin >> a[i];     for (long long i = 0; i < ce; i++) cin >> b[i];     cin >> q;     while (q--) {       mi = 1e18;       cin >> x1 >> y1 >> x2 >> y2;       swap(x1, y1);       swap(x2, y2);       if (x1 > x2) swap(x1, x2), swap(y1, y2);       long long t = abs(y1 - y2);       if (t == 0) {         cout << abs(x1 - x2) << endl;         continue;       }       long long p = lower_bound(a, a + cl, x1) - a;       if (p != cl) {         if (a[p] <= x2)           mi = min(mi, x2 - x1 + t);         else           mi = min(mi, a[p] - x1 + a[p] - x2 + t);       }       p = upper_bound(a, a + cl, x1) - a;       if (p != 0) mi = min(mi, x2 - a[p - 1] + x1 - a[p - 1] + t);       p = lower_bound(b, b + ce, x1) - b;       if (p != ce) {         if (b[p] <= x2)           mi = min(mi, x2 - x1 + (t % v == 0 ? (t / v) : (t / v + 1)));         else           mi = min(mi,                    b[p] - x2 + b[p] - x1 + (t % v == 0 ? (t / v) : (t / v + 1)));       }       p = upper_bound(b, b + ce, x1) - b;       if (p != 0)         mi = min(mi, x2 - b[p - 1] + x1 - b[p - 1] +                          (t % v == 0 ? (t / v) : (t / v + 1)));       cout << mi << endl;     }     return 0;   }   