func_code_string: #include <bits/stdc++.h>   using namespace std;   int B[300000];   pair<int, int> A[300000];   stack<pair<int, int> > s;   queue<pair<pair<int, int>, int> > q;   int main() {     int N, l, f, i;     long long ta = 0, tb = 0;     scanf( %d , &N);     for (i = 0; i < N; ++i)       scanf( %d , &A[i].first), A[i].second = i, ta += A[i].first;     for (i = 0; i < N; ++i) scanf( %d , &B[i]), tb += B[i];     sort(A, A + N);     sort(B, B + N);     if (ta != tb) {       printf( NO n );       return 0;     }     for (i = 0; i < N; ++i) {       if (A[i].first < B[i])         s.emplace(B[i] - A[i].first, A[i].second);       else {         l = A[i].first - B[i];         while (l && !s.empty()) {           q.emplace(make_pair(s.top().second + 1, A[i].second + 1),                     f = min(l, s.top().first));           s.top().first -= f;           l -= f;           if (!s.top().first) s.pop();         }         if (l) {           printf( NO n );           return 0;         }       }     }     printf( YES n );     printf( %d n , q.size());     while (!q.empty())       printf( %d %d %d n , q.front().first.first, q.front().first.second,              q.front().second),           q.pop();     return 0;   }   