package main import . "fmt" import . "math/big" func main() { a,b,c := new(Rat),new(Rat),new(Rat) d,e,f := new(Rat),new(Rat),new(Rat) Scan(a,b,c,d,e,f) // ax+by=c // dx+ey=f // x=(ec-bf)/(ae-bd) // y=(dc-af)/(bd-ae) ec:=new(Rat).Mul(e,c) bf:=new(Rat).Mul(b,f) ae:=new(Rat).Mul(a,e) bd:=new(Rat).Mul(b,d) dc:=new(Rat).Mul(d,c) af:=new(Rat).Mul(a,f) x:=new(Rat).Quo(new(Rat).Sub(ec,bf), new(Rat).Sub(ae,bd)) y:=new(Rat).Quo(new(Rat).Sub(dc,af), new(Rat).Sub(bd,ae)) Println(x.FloatString(16),y.FloatString(16)) }