func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long INF = 1e18;   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long n, m, cl, ce, v;     cin >> n >> m >> cl >> ce >> v;     vector<long long> data_l(cl), data_e(ce);     for (long long i = 0; i < cl; i++) {       long long k;       cin >> k;       data_l[i] = k - 1;     }     for (long long i = 0; i < ce; i++) {       long long k;       cin >> k;       data_e[i] = k - 1;     }     sort((data_l).begin(), (data_l).end());     sort((data_e).begin(), (data_e).end());     vector<long long> r_data_l = data_l;     vector<long long> r_data_e = data_e;     for (long long i = 0; i < r_data_l.size(); i++) r_data_l[i] *= -1;     for (long long i = 0; i < r_data_e.size(); i++) r_data_e[i] *= -1;     sort((r_data_l).begin(), (r_data_l).end());     sort((r_data_e).begin(), (r_data_e).end());     long long q;     cin >> q;     vector<long long> ans(q);     for (long long i = 0; i < q; i++) {       long long x1, y1, x2, y2;       cin >> x1 >> y1 >> x2 >> y2;       x1--;       y1--;       x2--;       y2--;       swap(x1, y1);       swap(x2, y2);       if (y1 == y2) {         ans[i] = abs(x2 - x1);         continue;       }       long long lift_time = (abs(y2 - y1) - 1) / v + 1;       long long left_l = -1, right_l = -1, left_e = -1, right_e = -1;       vector<long long>::iterator it =           lower_bound((r_data_l).begin(), (r_data_l).end(), -x1);       if (it != r_data_l.end()) left_l = -(*it);       it = lower_bound((data_l).begin(), (data_l).end(), x1);       if (it != data_l.end()) right_l = *it;       it = lower_bound((r_data_e).begin(), (r_data_e).end(), -x1);       if (it != r_data_e.end()) left_e = -(*it);       it = lower_bound((data_e).begin(), (data_e).end(), x1);       if (it != data_e.end()) right_e = *it;       long long ans1 =           (left_l == -1 ? INF                         : abs(left_l - x1) + abs(left_l - x2) + abs(y1 - y2));       long long ans2 =           (right_l == -1 ? INF                          : abs(right_l - x1) + abs(right_l - x2) + abs(y1 - y2));       long long ans3 =           (left_e == -1 ? INF : abs(left_e - x1) + abs(left_e - x2) + lift_time);       long long ans4 =           (right_e == -1 ? INF                          : abs(right_e - x1) + abs(right_e - x2) + lift_time);       ans[i] = min(min(ans1, ans2), min(ans3, ans4));     }     for (long long i = 0; i < q; i++) cout << ans[i] << endl;     return 0;   }   