Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long int ll;
- int main()
- {
- //freopen("input.txt","r",stdin);
- // freopen("out.txt","w",stdout);
- ll t,i,j,k,a,b,c,d,e;
- scanf("%lld",&t);
- while(t--)
- {
- ll arr[50];
- cin>>arr[0]>>arr[3]>>arr[5]>>arr[10]>>arr[12]>>arr[14];
- cin>>arr[21]>>arr[23]>>arr[25]>>arr[27];
- cin>>arr[36]>>arr[38]>>arr[40]>>arr[42]>>arr[44];
- arr[4]=(arr[0]-(arr[3]+arr[5]))/2;
- arr[11]=(arr[3]-(arr[10]+arr[12]))/2;
- arr[13]=(arr[5]-(arr[12]+arr[14]))/2;
- arr[22]=(arr[10]-(arr[21]+arr[23]))/2;
- arr[24]=(arr[12]-(arr[23]+arr[25]))/2;
- arr[26]=(arr[14]-(arr[25]+arr[27]))/2;
- arr[37]=(arr[21]-(arr[36]+arr[38]))/2;
- arr[39]=(arr[23]-(arr[38]+arr[40]))/2;
- arr[41]=(arr[25]-(arr[40]+arr[42]))/2;
- arr[43]=(arr[27]-(arr[42]+arr[44]))/2;
- arr[1]=arr[3]+arr[4];
- arr[2]=arr[4]+arr[5];
- arr[6]=arr[10]+arr[11];
- arr[7]=arr[11]+arr[12];
- arr[8]=arr[12]+arr[13];
- arr[9]=arr[13]+arr[14];
- arr[15]=arr[21]+arr[22];
- arr[16]=arr[22]+arr[23];
- arr[17]=arr[23]+arr[24];
- arr[18]=arr[24]+arr[25];
- arr[19]=arr[25]+arr[26];
- arr[20]=arr[26]+arr[27];
- arr[28]=arr[36]+arr[37];
- arr[29]=arr[37]+arr[38];
- arr[30]=arr[38]+arr[39];
- arr[31]=arr[39]+arr[40];
- arr[32]=arr[40]+arr[41];
- arr[33]=arr[41]+arr[42];
- arr[34]=arr[42]+arr[43];
- arr[35]=arr[43]+arr[44];
- cout<<arr[0]<<endl;
- cout<<arr[1]<<" "<<arr[2]<<endl;
- cout<<arr[3]<<" "<<arr[4]<<" "<<arr[5]<<endl;
- cout<<arr[6]<<" "<<arr[7]<<" "<<arr[8]<<" "<<arr[9]<<endl;
- cout<<arr[10]<<" "<<arr[11]<<" "<<arr[12]<<" "<<arr[13]<<" "<<arr[14]<<endl;
- cout<<arr[15]<<" "<<arr[16]<<" "<<arr[17]<<" "<<arr[18]<<" "<<arr[19]<<" "<<arr[20]<<endl;
- cout<<arr[21]<<" "<<arr[22]<<" "<<arr[23]<<" "<<arr[24]<<" "<<arr[25]<<" "<<arr[26]<<" "<<arr[27]<<endl;
- cout<<arr[28]<<" "<<arr[29]<<" "<<arr[30]<<" "<<arr[31]<<" "<<arr[32]<<" "<<arr[33]<<" "<<arr[34]<<" "<<arr[35]<<endl;
- cout<<arr[36]<<" "<<arr[37]<<" "<<arr[38]<<" "<<arr[39]<<" "<<arr[40]<<" "<<arr[41]<<" "<<arr[42]<<" "<<arr[43]<<" "<<arr[44]<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement