#include<bits/stdc++.h>
#define deb(x) cout << #x << ": " << x << endl
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
int n;
cin>>n;
int f[n-1];
for(int i=0;i<n-1;i++) cin>>f[i];
int sum=0,status=0;
for(int i=0;i<n-1;i++){
sum+=f[i];
if(abs(sum)==n-1){
status=1;
break;
}
}
if(status==0) cout<<"-1";
else{
cout<<"1 ";
sum=1;
for(int i=0;i<n-1;i++) cout<<sum+f[i]<<" ";
}
return(0);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
268 KB |
Output is correct |
2 |
Incorrect |
0 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
268 KB |
Output is correct |
2 |
Incorrect |
0 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
268 KB |
Output is correct |
2 |
Incorrect |
0 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
268 KB |
Output is correct |
2 |
Incorrect |
0 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |