-
Notifications
You must be signed in to change notification settings - Fork 0
/
q100.cpp
53 lines (51 loc) · 916 Bytes
/
q100.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
ıllıllı 𝔻𝓎Rr𝕠𝐭𝐇 ıllıllı
*/
#include <bits/stdc++.h>
using namespace std;
#define N 1000005
#define mod 1000000007
#define ll long long int
#define pb push_back
#define mk make_pair
double pi=3.141592653589793238;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int T=1;
//cin>>T;
while(T--){
int n,x;
cin>>n;
double a[n][n],b[n][n],w[n][n];
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
a[i][j]=b[i][j]=0.0;
cin>>x;
w[i][j]=(double)x;
if(i==j)a[i][j]=w[i][j];
}
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(i==j)continue;
a[i][j]=(w[i][j]+w[j][i])/2;
b[i][j]=w[i][j]-a[i][j];
}
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cout<<fixed<<setprecision(10)<<a[i][j]<<" ";
}
cout<<"\n";
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cout<<fixed<<setprecision(10)<<b[i][j]<<" ";
}
cout<<"\n";
}
}
return 0;
}
/*_*/