#include <bits/stdc++.h>
using namespace std;
main(){
int n,a,b,c,d,e,f;
cin>>n;
for(int i=1;i<=n;i++)
{cin>>a>>b>>c>>d>>e>>f;
cout<<(c*e-b*f)/(a*e-b*d)<<" "<<(c*d-a*f)/(b*d-a*e)<<endl;}
}
#include <bits/stdc++.h>
using namespace std;
main(){
int n,a,b,c,d,e,f;
cin>>n;
for(int i=1;i<=n;i++)
{cin>>a>>b>>c>>d>>e>>f;
cout<<(c*e-b*f)/(a*e-b*d)<<" "<<(c*d-a*f)/(b*d-a*e)<<endl;}
}
google 搜尋 克拉馬公式