大概就是对每一行先找到最大的减小误差,然后代入消元
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<map>
#include<set>
#define ll long long
#define db double
#define inf 2139062143
#define MAXN 200100
#define rep(i,s,t) for(register int i=(s),i##__end=(t);i<=i##__end;++i)
#define dwn(i,s,t) for(register int i=(s),i##__end=(t);i>=i##__end;--i)
#define ren for(register int i=fst[x];i;i=nxt[i])
#define Fill(x,t) memset(x,t,sizeof(x))
#define pls(a,b) (a+b)%MOD
#define mns(a,b) (a-b+MOD)%MOD
#define mul(a,b) (1LL*(a)*(b))%MOD
using namespace std;
inline int read()
{
int x=,f=;char ch=getchar();
while(!isdigit(ch)) {if(ch=='-') f=-;ch=getchar();}
while(isdigit(ch)) {x=x*+ch-'';ch=getchar();}
return x*f;
}
int n;db a[][];
void Gauss()
{
int pos;rep(i,,n-)
{
pos=n;rep(j,i,n-)if(fabs(a[j][i])>fabs(a[pos][i])) pos=j;
if(pos==n) {puts("No Solution");exit();}
if(pos!=i) rep(j,,n) swap(a[i][j],a[pos][j]);
dwn(j,n,i) rep(k,i+,n-) a[k][j]-=a[k][i]/a[i][i]*a[i][j];
}
dwn(i,n-,) {rep(j,i+,n-) a[i][n]-=a[j][n]*a[i][j];a[i][n]/=a[i][i];}
}
int main()
{
n=read();rep(i,,n-) rep(j,,n) a[i][j]=read();Gauss();
rep(i,,n-) printf("%.2lf\n",a[i][n]);
}