#include <bits/stdc++.h> using namespace std; int main (){
int r1,r2,r3,r4,r5,r,R1,R2,R3,R4,R5,t1,t2,t3,t4;
cin>>r1>>r2>>r3>>r4>>r5;
R1=r1/3;
R2=(r2+R1)/3;
R3=(r3+R2)/3;
R4=(r4+R3)/3;
R5=(r5+R1+R4)/3;
t1=R1+R2+R5;
t2=R2+R3;
t3=R3+R4;
t4=R4+R5;
r=r1%3+(r2+R1)%3+(r3+R2)%3+(r4+R3)%3+(r5+R1+R4)%3;
cout<<t1<<" "<<t2<<" "<<t3<<" "<<t4<<" "<<R5<<endl;
cout<<r;
return 0;
}```c #include <bits/stdc++.h> using namespace std; int main (){
int r1,r2,r3,r4,r5,r,R1,R2,R3,R4,R5,t1,t2,t3,t4;
cin>>r1>>r2>>r3>>r4>>r5;
R1=r1/3;
R2=(r2+R1)/3;
R3=(r3+R2)/3;
R4=(r4+R3)/3;
R5=(r5+R1+R4)/3;
t1=R1+R2+R5;
t2=R2+R3;
t3=R3+R4;
t4=R4+R5;
r=r1%3+(r2+R1)%3+(r3+R2)%3+(r4+R3)%3+(r5+R1+R4)%3;
cout<<t1<<" "<<t2<<" "<<t3<<" "<<t4<<" "<<R5<<endl;
cout<<r;
return 0;
}