Problem:
Simultaneous Equation

Write a program which solve a simultaneous equation:

ax + by = c

dx + ey = f

The program should print x and y for given a, b, c, d, e and f (-1,000 ≤ a, b, c, d, e, f ≤ 1,000). You can suppose that given equation has a unique solution.

Input

The input consists of several data sets, 1 line for each data set. In a data set, there will be a, b, c, d, e, f separated by a single space. The input terminates with EOF.

Output

For each data set, print x and y separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places.

Sample Input 1

1 2 3 4 5 6
2 -1 -2 -1 -1 -5

Output for the Sample Input 1

-1.000 2.000
1.000 4.000

Sample Input 2

2 -1 -3 1 -1 -3
2 -1 -3 -9 9 27

Output for the Sample Input 2

0.000 3.000
0.000 3.000

Solution in C# (judge verdict: Wrong Answer)

using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;


public class my
{
	
	private static StringBuilder sb = new StringBuilder();
	
	public static void Main()
	{
		string s;

		while( null != ( s = Console.ReadLine() ) ){
			//var t = Array.ConvertAll(s.Split(' '), x=>double.Parse(x));
			var t = s.Split(' ');
			
			double[,] A = new double[2, 3];
			
			// Equation
			A[0, 0] = int.Parse(t[0]);
			A[0, 1] = int.Parse(t[1]);
			A[0, 2] = int.Parse(t[2]);
			A[1, 0] = int.Parse(t[3]);
			A[1, 1] = int.Parse(t[4]);
			A[1, 2] = int.Parse(t[5]);
			
			// delete b
			A[1,0] *= A[0,1] / A[1,1];
			A[1,2] *= A[0,1] / A[1,1];
			A[1,1] *= A[0,1] / A[1,1];
			A[0,0] -= A[1,0];
			A[0,1] -= A[1,1];
			A[0,2] -= A[1,2];
			
			// divited by a
			A[0,1] /= A[0,0];
			A[0,2] /= A[0,0];
			A[0,0]  = 1.0;
			
			// delete d
			//A[1,1] -= A[0,1] * A[1,0] / A[0,0];
			A[1,2] -= A[0,2] * A[1,0];
			A[1,0]  = 0;
			
			// divited by e
			//A[1,0] /= A[1,1];
			A[1,2] /= A[1,1];
			A[1,1]  = 1.0;
			
			// display
			sb.AppendLine(
				string.Format("{0:F3} {1:F3}", 
							  Math.Round(A[0,2], 3, MidpointRounding.AwayFromZero), 
							  Math.Round(A[1,2], 3, MidpointRounding.AwayFromZero)) );
		}
		
		my.Flush();
	}
	
	private static int CountChar(string s, char c)
	{
		return s.Length - s.Replace(c.ToString(), "").Length;
	}
	
	private static void Flush()
	{
		Console.Write(sb);
		sb.Length = 0;
	}
	
	private static void AppendLine(int v)
	{
		sb.AppendLine(v.ToString());
	}
	
	private static void AppendLine(long v)
	{
		sb.AppendLine(v.ToString());
	}
	
	private static void AppendLine(string[] v)
	{
		sb.AppendLine(string.Join(" ", v));
	}

	private static void Swap(ref string a, ref string b) 
	{
		string tmp = a;
		a = b;
		b = tmp;
	}
	
	private static void Swap(ref int a, ref int b) 
	{
		int tmp = a;
		a = b;
		b = tmp;
	}
	
	private static int[] GetIntArray()
	{
		return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
	}
	
	private static void WriteArray(int[] a)
	{
		Console.WriteLine(string.Join(" ", Array.ConvertAll( a, x=>x.ToString() ) ) );
	}
	
	private static void WriteArray(long[] a)
	{
		Console.WriteLine(string.Join(" ", Array.ConvertAll( a, x=>x.ToString() ) ) );
	}
	
	private static int GetInt()
	{
		return int.Parse(Console.ReadLine());
	}
	
	private static long GetLong()
	{
		return long.Parse(Console.ReadLine());
	}
}