func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m, s, ans;   int ar[5005];   int cnt[5005];   int ar2[5005];   vector<pair<pair<int, int>, pair<int, int> > > v;   int main() {     scanf( %d%d , &n, &m);     for (int i = 1; i <= n; i++) ar[i] = 1000000000;     for (int i = 0; i < m; i++) {       int t, l, r, x;       scanf( %d%d%d%d , &t, &l, &r, &x);       if (t == 1)         for (int j = l; j <= r; j++) cnt[j] += x;       else {         for (int j = l; j <= r; j++) ar[j] = min(ar[j], x - cnt[j]);       }       v.push_back(pair<pair<int, int>, pair<int, int> >(pair<int, int>(t, x),                                                         pair<int, int>(l, r)));     }     for (int i = 1; i <= n; i++)       if (max(ar[i], -ar[i]) > 1000000000) {         printf( NO n );         exit(0);       }     for (int i = 1; i <= n; i++) ar2[i] = ar[i];     for (int i = 0; i < m; i++) {       int t = v[i].first.first;       int x = v[i].first.second;       int l = v[i].second.first;       int r = v[i].second.second;       if (t == 1) {         for (int j = l; j <= r; j++) ar2[j] += x;       } else {         int mx = -1000000000;         for (int j = l; j <= r; j++) mx = max(mx, ar2[j]);         if (mx != x) {           printf( NO n );           exit(0);         }       }     }     printf( YES n );     for (int i = 1; i <= n; i++) printf( %d  , ar[i]);     printf(  n );     return 0;   }   