func_code_string: #include <bits/stdc++.h>   using namespace std;   struct node {     long long st, en;     node() {}     node(long long _st, long long _en) : st(_st), en(_en) {}   };   int main() {     int n, b, t, d;     long long etime[200000];     long long ftime;     int qlen = 0;     cin >> n >> b;     cin >> t >> d;     etime[0] = t + d;     ftime = 1ll * t + d;     int len = 0;     queue<node> ws;     node temp;     cout << etime[0] <<    ;     for (int i = 1; i < n; i++) {       cin >> t >> d;       while (!ws.empty()) {         temp = ws.front();         if (t >= temp.st) {           ws.pop();           len--;         } else           break;       }       if (t < ftime) {         if (len < b) {           ws.push(node(ftime, ftime + d));           len++;           etime[i] = ftime + d;           ftime += d;         } else {           etime[i] = -1;         }       } else {         etime[i] = 1ll * t + d;         ftime = 1ll * t + d;       }       cout << etime[i] <<    ;     }   }   