原题链接:Problem - 1721C - Codeforces
void solve() {
int n;
cin >> n;
FOR(1, n) cin >> a[i];
FOR(1, n) cin >> b[i];
FOR(1, n) {
int p = lower_bound(b + 1, b + n + 1, a[i]) - a;
cout << a[p] - a[i] << " \n"[i == n];
}
int p = n;
ROF(n, 1) {
mx[i] = b[p] - a[i];
if (a[i] > b[i - 1]) p = i - 1;
}
FOR(1, n) cout << mx[i] << " \n"[i == n];
}