文章
12
粉丝
0
获赞
12
访问
619
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin>>n;
long long free_time = 0;
for(int i = 0 ; i < n; i++){
long long a,b,t;
cin>>a>>t>>b;
long long start_time = max(a,free_time);
if(start_time > a+b){
cout<<-1<<' ';
}
else{
cout<<start_time<<' ';
free_time = start_time + t;
}
}
cout<<'\n';
}
登录后发布评论
暂无评论,来抢沙发