#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 1; i <= n; i++)
#define ii pair<int,int>
#define f first
#define s second
#define pb push_back
#define debug(x) cout<<#x<<' '<<x<<endl;
int n, a[1000010],b[1000010],c[1000010],ans[1000010][3];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
cin>>n;
rep(i,n)cin>>a[i];
rep(i,n-1)cin>>b[i];
rep(i,n-1)cin>>c[i];
rep(i,n-1){
ans[i][0]=min(a[i],b[i]);
b[i]-=ans[i][0];
if(b[i]>0){
a[i+1]-=b[i];
if(a[i+1]<0){
cout<<"NO";
return 0;
}
ans[i][2]=b[i];
}
}
cout<<"YES\n";
rep(i,n-1){
cout<<ans[i][0]<<' '<<ans[i][1]<<' '<<ans[i][2]<<"\n";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Incorrect |
0 ms |
340 KB |
Unexpected end of file - int64 expected |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Incorrect |
0 ms |
340 KB |
Unexpected end of file - int64 expected |
3 |
Halted |
0 ms |
0 KB |
- |