# Poj Solution 1914

```http://poj.org/problem?id=1914

//* @author popop0p0popo
import java.util.*;
import java.io.*;
import java.text.*;
import java.math.*;

public class Main{
public static void main(String[] args){
int n=scanner.nextInt();
BigInteger[][] a;
BigInteger[] b;
BigInteger aa,aa1,aa2,aa3;
for (int i=0;i< n ;i++ ){
a=new BigInteger[3][3];
b=new BigInteger[3];
for (int j=0;j< 3 ;j++ ){
for (int k=0;k< 3 ;k++ ){
a[j][k]=scanner.nextBigInteger();
}
b[j]=scanner.nextBigInteger();
}

System.out.println(aa1+" "+aa2+" "+aa3+" "+aa);
if (aa.equals(BigInteger.ZERO)){
System.out.println("No unique solution");
}
else{
DecimalFormat df=new DecimalFormat("0.000");
BigDecimal x1=new BigDecimal(aa1.toString());
BigDecimal x2=new BigDecimal(aa2.toString());
BigDecimal x3=new BigDecimal(aa3.toString());
BigDecimal x=new BigDecimal(aa.toString());
BigDecimal xx1=x1.divide(x,6,BigDecimal.ROUND_HALF_UP);
BigDecimal xx2=x2.divide(x,6,BigDecimal.ROUND_HALF_UP);
BigDecimal xx3=x3.divide(x,6,BigDecimal.ROUND_HALF_UP);
System.out.println("Unique solution: "+df.format(xx1)+" "+df.format(xx2)+" "+df.format(xx3));
}
System.out.println();
}
}
}

```
This entry was posted in poj. Bookmark the permalink.