func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAXN = 1e5 + 5;   long long n, l[MAXN], r[MAXN], vall[MAXN], valr[MAXN], pos[MAXN], d[MAXN],       tree[4 * MAXN], ind[MAXN];   bool validl[MAXN], validr[MAXN], dead;   pair<long long, long long> sortr[MAXN];   void computeleft() {     l[0] = -1, r[0] = 1, r[n + 1] = -1, l[n + 1] = n;     for (int i = 1; i <= n; ++i) l[i] = i - 1, r[i] = i + 1;     validl[0] = 1, vall[0] = 2 * d[0];     for (int i = 1; i <= n + 1; ++i) {       queue<int> drop;       if ((i > 1) && (pos[r[i - 1]] - pos[l[i - 1]] > 2 * d[i - 1]))         drop.push(i - 1);       while (!drop.empty()) {         int t = drop.front();         drop.pop();         int lt = l[t], rt = r[t];         r[lt] = r[t];         l[rt] = l[t];         if (lt != 0) {           if (pos[r[lt]] - pos[l[lt]] > 2 * d[lt]) drop.push(lt);         }         if (rt != i) {           if (pos[r[rt]] - pos[l[rt]] > 2 * d[rt]) drop.push(rt);         }       }       if (2 * d[i] - (pos[i] - pos[l[i]]) > 0) validl[i] = 1;       vall[i] = 2 * d[i] + pos[l[i]];     }     if (r[0] != n + 1) {       cout <<  0.0 n ;       exit(0);     }   }   void computeright() {     l[0] = -1, r[0] = 1, r[n + 1] = -1, l[n + 1] = n;     for (int i = 1; i <= n; ++i) l[i] = i - 1, r[i] = i + 1;     validr[n + 1] = 1, valr[n + 1] = pos[n + 1] - 2 * d[n + 1];     for (int i = n; i >= 1; --i) {       queue<int> drop;       if ((i < n) && (pos[r[i + 1]] - pos[l[i + 1]] > 2 * d[i + 1]))         drop.push(i + 1);       while (!drop.empty()) {         int t = drop.front();         drop.pop();         int lt = l[t], rt = r[t];         r[lt] = r[t];         l[rt] = l[t];         if (lt != i) {           if (pos[r[lt]] - pos[l[lt]] > 2 * d[lt]) drop.push(lt);         }         if (rt != n + 1) {           if (pos[r[rt]] - pos[l[rt]] > 2 * d[rt]) drop.push(rt);         }       }       if (2 * d[i] - (pos[r[i]] - pos[i]) > 0) validr[i] = 1;       valr[i] = pos[r[i]] - 2 * d[i];     }   }   void init(int l = 0, int r = n, int node = 1) {     if (l == r) {       tree[node] = 1e9 + 5;       return;     }     int mid = (l + r) / 2;     init(l, mid, 2 * node);     init(mid + 1, r, 2 * node + 1);     tree[node] = min(tree[2 * node], tree[2 * node + 1]);   }   int findmin(int a, int b, int l = 0, int r = n, int node = 1) {     if (a == l && b == r) return tree[node];     int mid = (l + r) / 2;     if (b <= mid) return findmin(a, b, l, mid, 2 * node);     if (a >= mid + 1) return findmin(a, b, mid + 1, r, 2 * node + 1);     return min(findmin(a, mid, l, mid, 2 * node),                findmin(mid + 1, b, mid + 1, r, 2 * node + 1));   }   void upd(int v, int x, int l = 0, int r = n, int node = 1) {     if (l == r) {       tree[node] = x;       return;     }     int mid = (l + r) / 2;     if (v <= mid)       upd(v, x, l, mid, 2 * node);     else       upd(v, x, mid + 1, r, 2 * node + 1);     tree[node] = min(tree[2 * node], tree[2 * node + 1]);   }   void findans() {     for (int i = 0; i <= n; ++i)       sortr[i] = pair<long long, long long>(valr[i + 1], i + 1);     sort(sortr, sortr + n + 1);     for (int i = 0; i <= n; ++i) ind[sortr[i].second] = i;     init();     long long best = 1e9 + 5;     for (int i = n; i >= 0; --i) {       if (validr[i + 1]) upd(ind[i + 1], pos[i + 1]);       if (!validl[i]) continue;       int lo = -1, hi = n;       while (lo != hi) {         int mid = (lo + hi + 1) / 2;         if (sortr[mid].first > vall[i])           hi = mid - 1;         else           lo = mid;       }       if (lo != -1) best = min(best, findmin(0, lo) - pos[i]);     }     cout << fixed << setprecision(1) << 0.5 * best << endl;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cin >> n;     for (int i = 0; i < n + 2; ++i) cin >> pos[i];     d[0] = d[n + 1] = 1LL * 1000000 * 1000000 + 5;     for (int i = 1; i <= n; ++i) cin >> d[i];     computeleft();     computeright();     findans();   }   