submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s640242725
p00004
Wrong Answer
while(True): try: a,b,c,d,e,f= map(float,input().split(" ")) det=a*e-b*d if(det!=0): x=(c*e-b*f)/det y=(a*f-c*d)/det print("{:.3f} {:.3f)".format(x+0,y+0)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s532219268
p00004
Wrong Answer
while(True): try: a,b,c,d,e,f= map(float,input().split(" ")) det=a*e-b*d if(det!=0): x=(c*e-b*f)/det y=(a*f-c*d)/det print("{:.3f} {:.3f)".format(x+0,y+0)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s527742512
p00004
Wrong Answer
while(True): try: a,b,c,d,e,f= map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f)".format(x+0,y+0)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s397334901
p00004
Wrong Answer
# -*- coding: utf-8 -*- import sys for line in sys.stdin: a, b, c, d, e, f = map(int, line.split()) print "%f %f" %((d*c-a*f)/(b*d-a*e), (b*f-c*e)/(b*d-a*e))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s879165143
p00004
Wrong Answer
# -*- coding: utf-8 -*- import sys for line in sys.stdin: a, b, c, d, e, f = map(int, line.split()) print "%f %f" %((b*f-c*e)/(b*d-a*e), (d*c-a*f)/(b*d-a*e))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s841060330
p00004
Wrong Answer
# -*- coding: utf-8 -*- import sys for line in sys.stdin: a, b, c, d, e, f = map(int, line.split()) print "%.3f %.3f" %((b*f-c*e)/(b*d-a*e), (c*d-a*f)/(b*d-a*e))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s687041556
p00004
Wrong Answer
# -*- coding: utf-8 -*- import sys for line in sys.stdin: a, b, c, d, e, f = map(int, line.split()) print "%.3f %.3f" %(round((b*f-c*e)/(b*d-a*e), 3), round((c*d-a*f)/(b*d-a*e), 3))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s716745598
p00004
Wrong Answer
# -*- coding: utf-8 -*- import sys for line in sys.stdin: a, b, c, d, e, f = map(float, line.split()) print "%.3f %.3f" %(round((b*f-c*e)/(b*d-a*e), 3), round((c*d-a*f)/(b*d-a*e), 3))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s738975928
p00004
Wrong Answer
import sys lines = sys.stdin.readlines() for line in lines: a, b, c, d, e, f = map(float, line.split()) if a * e - b * d == 0: break x = (e * c + (-b) * f)/(a * e - b * d) y = ((-d) * c + a * f)/(a * e - b * d) print('%.3f %.3f' % (x , y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s532145081
p00004
Wrong Answer
a,b,c,d,e,f = map(float,input().split(" ")) x,y = 0,0 float(x) float(y) x = (e*c-b*f) / (a*e-b*d) y = ((-(d*c)+a*f) / (a*e-b*d)) print("%.3f" %(x), end="") print(" ", end="") print("%.3f" %(y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s629318369
p00004
Wrong Answer
while True: try: a,b,c,d,e,f = map(float,input().split(" ")) x,y = 0,0 float(x) float(y) x = (e*c-b*f) / (a*e-b*d) y = ((-(d*c)+a*f) / (a*e-b*d)) print("%.3f" %(x), end="") print(" ", end="") print("%.3f" %(y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s669756372
p00004
Wrong Answer
while True: try: a,b,c,d,e,f = map(int,input().split(" ")) x = (e*c-b*f) / (a*e-b*d) y = ((-(d*c)+a*f) / (a*e-b*d)) print("{:.3f} {:.3f}".format(x,y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s926447962
p00004
Wrong Answer
while True: try: a,b,c,d,e,f=map(float,input().split(" ")) if a*e-b*d != 0: x=(c*e-b*f)/(a*e-b*d) y=(a*f-c*d)/(a*e-b*d) print("{:.3f} {:.3f}".format(x,y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s977618316
p00004
Wrong Answer
while True: try: a,b,c,d,e,f=map(float,input().split(" ")) z=a*e-b*d if(z!=0): x=(c*e-b*f)/z y=(a*f-c*d)/z print("{:.3f} {:.3f}".format(x,y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s744573956
p00004
Wrong Answer
while 1: try: a,b,c,d,e,f=map(float,raw_input().split()) print "%.3f"%((e*c-b*f)/(a*e-b*d)),"%.3f"%((c*d-f*a)/(b*d-e*a)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s894746894
p00004
Wrong Answer
def get_input(): while True: try: yield "".join(input()) except EOFError: break if __name__ == "__main__": array = list(get_input()) #print(array) for i in range(len(array)): a,b,c,d,e,f = array[i].split() if int(b)!=0: x = (int(b)*int(f) - int(c)*int(e))/(int(b)*int(d) - int(a)*int(e)) y = -(int(a)/int(b))*x + int(c)/int(b) elif int(b)==0 and int(a)!=0: x = int(c)/int(a) y = -(int(d)/int(e))*x + int(f) print("{0} {1}".format(x,y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s923147426
p00004
Wrong Answer
def get_input(): while True: try: yield "".join(input()) except EOFError: break if __name__ == "__main__": array = list(get_input()) #print(array) for i in range(len(array)): a,b,c,d,e,f = array[i].split() if int(b)!=0: x = (int(b)*int(f) - int(c)*int(e))/(int(b)*int(d) - int(a)*int(e)) y = -(int(a)/int(b))*x + int(c)/int(b) elif int(b)==0 and int(a)!=0: x = int(c)/int(a) y = -(int(d)/int(e))*x + int(f) print("{:.3f} {:.3f}".format(x,y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s554243990
p00004
Wrong Answer
dataset = [] while True: try: dataset.append(input()) except EOFError: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s778489708
p00004
Wrong Answer
import itertools import operator dataset = [] while True: try: dataset.append(input()) except EOFError: break for item in dataset: try: a, b, c, d, e, f = [int(i) for i in item.split()] e = e * (a/d) f = f * (a/d) y = (c - f)/(b-e) x = (c - b*y) / a print("{:.3f} {:.3f}".format(x, y)) except: print("dataset cannot to be converted")
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s140686801
p00004
Wrong Answer
a,b,c,d,e,f = map(int,raw_input().split()) i = d/a j = i*b-e k = i*c-f y = float(k/j) x = float(c-b*y)/a print "%.3f %.3f"%(x,y)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s000173384
p00004
Wrong Answer
import sys for line in sys.stdin: a,b,c,d,e,f = map(float, line.split()) print((c*e-b*f)/(a*e-b*d), (a*f-c*d)/(a*e-b*d))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s135229705
p00004
Wrong Answer
import sys for line in sys.stdin: a,b,c,d,e,f = map(float, line.split()) print(round((c*e-b*f)/(a*e-b*d), 3), round((a*f-c*d)/(a*e-b*d), 3))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s127924884
p00004
Wrong Answer
import sys for line in sys.stdin: a,b,c,d,e,f = map(float, line.split()) x = round((c*e-b*f)/(a*e-b*d), 3) y = round((a*f-c*d)/(a*e-b*d), 3) if x == -0: x = 0 if y == -0: y = 0 print(x, y)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s118876201
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input(). split()) D = (a * e) - (b * d) x = (e * c) - (b * f) y = (a * f) - (d * c) print("%.3f %.3f" % (x / D, y / D)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s820574285
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input(). split()) D = (a * e) - (b * d) x = (e * c) - (b * f) y = (a * f) - (d * c) print("%.3f, %.3f" % (round(x / D, 3), round(y / D, 3))) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s816562157
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input(). split()) D = (a * e) - (b * d) x = (e * c) - (b * f) y = (a * f) - (d * c) print(round(x / D, 3), round(y / D, 3)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s899123959
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input(). split()) D = (a * e) - (b * d) x = (e * c) - (b * f) y = (a * f) - (d * c) x /= D y /= D if x / D == 0: x = 0 if y / D == 0: y = 0 print(round(x, 3), round(y, 3)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s176942518
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(float, input().split()) x = (c*e - b*f) / (a*e - b*d) y = (c*d - a*f) / (b*d - a*e) print("{:.3f} {:.3f}".format(x, y)) except EOFError: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s317034778
p00004
Wrong Answer
import sys for line in sys.stdin: a, b, c, d, e, f = map(float, line.split()) print('{0:.3f} {1:.3f}'.format(round((c * e - b * f) / (a * e - b * d), 3), round((a * f - c * d) / a * e - b * d)))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s732661771
p00004
Wrong Answer
import sys for line in sys.stdin: a, b, c, d, e, f = map(float, line.split()) x = round((c * e - b * f) / (a * e - b * d), 3) y = round((a * f - c * d) / (a * e - b * d), 3) print('{0:.3f} {1:.3f}'.format(x, y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s773072851
p00004
Wrong Answer
import sys line = input() for _ in range(1): a, b, c, d, e, f = map(float, line.split()) x = round((c * e - b * f) / (a * e - b * d), 3) y = round((a * f - c * d) / (a * e - b * d), 3) print('{0:.3f} {1:.3f}'.format(x, y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s507863382
p00004
Wrong Answer
# ????????£???????¨????????§£???????????°?????? # ax + by = c # dx + ey = f import sys def inverse(a, b, d, e): deta = a * e - b * d return (deta, e, -b, -d, a) while True: data = sys.stdin.readline() if data is None or data.strip() == '': break data = data.strip().split(' ') print('data:%s' % data) a, b, c, d, e, f = [float(i) for i in data] inv = inverse(a, b, d, e) print('inv:', inv) x = (inv[1] * c + inv[2] * f) / inv[0] y = (inv[3] * c + inv[4] * f) / inv[0] print('%.4f %.4f' % (x, y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s638624294
p00004
Wrong Answer
# ????????£???????¨????????§£???????????°?????? # ax + by = c # dx + ey = f import sys def inverse(a, b, d, e): deta = a * e - b * d return (deta, e, -b, -d, a) while True: data = sys.stdin.readline() if data is None or data.strip() == '': break data = data.strip().split(' ') a, b, c, d, e, f = [float(i) for i in data] inv = inverse(a, b, d, e) x = (inv[1] * c + inv[2] * f) / inv[0] y = (inv[3] * c + inv[4] * f) / inv[0] print('%.4f %.4f' % (x, y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s846885910
p00004
Wrong Answer
# ????????£???????¨????????§£???????????°?????? # ax + by = c # dx + ey = f import sys def inverse(a, b, d, e): deta = a * e - b * d return (deta, e, -b, -d, a) while True: data = sys.stdin.readline() if data is None or data.strip() == '': break data = data.strip().split(' ') a, b, c, d, e, f = [float(i) for i in data] inv = inverse(a, b, d, e) x = (inv[1] * c + inv[2] * f) / inv[0] y = (inv[3] * c + inv[4] * f) / inv[0] print('%.3f %.3f' % (x, y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s529711455
p00004
Wrong Answer
for i in range(2): inl=map(int, raw_input().split()) x=(inl[2]*inl[4]-inl[5]*inl[1])/(inl[0]*inl[4]-inl[3]*inl[1])+0.000 y=(inl[2]*inl[3]-inl[5]*inl[0])/(inl[1]*inl[3]-inl[4]*inl[0])+0.000 print x,y
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s564303706
p00004
Wrong Answer
# coding: utf-8 # Here your code ! #import math x=2*[0.0] for i in range(2): a,b,c,d,e,f = list(map(float, input().split())) if abs(a)<1e-9 : x[0] = (b*f - e*c)/b*d x[1] = c/b elif abs(b)<1e-9 : x[0] = c/a x[1] = (a*f - d*c)/a*e elif abs(d)<1e-9 : x[0] = (a*c - f*b)/a*e x[1] = f/e elif abs(e)<1e-9 : x[0] = f/d x[1] = (c*d - f*a)/b*d else: x[0] = (b*f - e*c)/(b*d - a*e) x[1] = (c - a*x[0])/b print("%.3f %.3f"%(round(x[0],3), round(x[1],3)))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s093002655
p00004
Wrong Answer
# coding: utf-8 # Here your code ! #import math x=2*[0.0] #for i in range(2): a,b,c,d,e,f = list(map(float, input().split())) if abs(a)<1e-9 : x[0] = (b*f - e*c)/b*d x[1] = c/b elif abs(b)<1e-9 : x[0] = c/a x[1] = (a*f - d*c)/a*e elif abs(d)<1e-9 : x[0] = (a*c - f*b)/a*e x[1] = f/e elif abs(e)<1e-9 : x[0] = f/d x[1] = (c*d - f*a)/b*d else: x[0] = (b*f - e*c)/(b*d - a*e) x[1] = (c - a*x[0])/b print("%.3f %.3f"%(round(x[0],3), round(x[1],3)))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s204814237
p00004
Wrong Answer
import sys for line in sys.stdin: array = [int(x) for x in line.split()] ar1 = array[0:3] ar2 = array[3:] i = ar1[0] ar1 = [x*ar2[0] for x in ar1] ar2 = [x*i for x in ar2] y = (ar1[2] - ar2[2])/(ar1[1]-ar2[1]) ar1 = array[0:3] x = (ar1[2]-ar1[1]*y)/ar1[0] print("%f %f" % (x,y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s495430351
p00004
Wrong Answer
import sys for line in sys.stdin: array = [int(x) for x in line.split()] ar1 = array[0:3] ar2 = array[3:] i = ar1[0] ar1 = [x*ar2[0] for x in ar1] ar2 = [x*i for x in ar2] y = (ar1[2] - ar2[2])/(ar1[1]-ar2[1]) ar1 = array[0:3] x = (ar1[2]-ar1[1]*y)/ar1[0] print("%d %d" % (x,y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s429124488
p00004
Wrong Answer
import sys for line in sys.stdin: array = [int(x) for x in line.split()] ar1 = array[0:3] ar2 = array[3:] i = ar1[0] ar1 = [x*ar2[0] for x in ar1] ar2 = [x*i for x in ar2] y = (ar1[2] - ar2[2])/(ar1[1]-ar2[1]) ar1 = array[0:3] x = (ar1[2]-ar1[1]*y)/ar1[0] print(str(x) + ' ' + str(y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s435720100
p00004
Wrong Answer
import sys for line in sys.stdin: array = [int(x) for x in line.split()] ar1 = array[0:3] ar2 = array[3:] i = ar1[0] ar1 = [x*ar2[0] for x in ar1] ar2 = [x*i for x in ar2] y = (ar1[2] - ar2[2])/(ar1[1]-ar2[1]) ar1 = array[0:3] x = (ar1[2]-ar1[1]*y)/ar1[0] print(str(round(x,3)) + ' ' + str(round(y,3)))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s667300742
p00004
Wrong Answer
import sys for line in sys.stdin: array = [float(x) for x in line.split()] ar1 = array[0:3] ar2 = array[3:] i = ar1[0] ar1 = [x*ar2[0] for x in ar1] ar2 = [x*i for x in ar2] y = (ar1[2] - ar2[2])/(ar1[1]-ar2[1]) ar1 = array[0:3] x = (ar1[2]-ar1[1]*y)/ar1[0] print(str(round(x,3)) + ' ' + str(round(y,3)))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s870317822
p00004
Wrong Answer
import sys for line in sys.stdin: array = [float(x) for x in line.split()] ar1 = array[0:3] ar2 = array[3:] i = ar1[0] ar1 = [x*ar2[0] for x in ar1] ar2 = [x*i for x in ar2] y = (ar1[2] - ar2[2])/(ar1[1]-ar2[1]) ar1 = array[0:3] x = (ar1[2]-ar1[1]*y)/ar1[0] if (x - int(x)) == 0 and (y - int(y)) == 0: print(str(round(x,3)) + '00 ' + str(round(y,3)) + '00') elif (x - int(x)) == 0: print(str(round(x,3)) + '00 ' + str(round(y,3))) elif (x - int(x)) == 0 and (y - int(y)) == 0: print(str(round(x,3)) + ' ' + str(round(y,3)) + '00') else: print(str(round(x,3)) + ' ' + str(round(y,3)))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s545798031
p00004
Wrong Answer
import sys L = sys.stdin.readlines() for line in L: A = line.split() a, b, c, d, e, f = [float(A[i]) for i in range(6)] x = (b * f - c * e) / (b * d - a * e) y = (c * d - a * f) / (b * d - a * e) print("{:.3f}, {:.3f}".format(x, y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s680068963
p00004
Wrong Answer
import sys L = sys.stdin.readlines() for line in L: A = line.split() a, b, c, d, e, f = [float(A[i]) for i in range(6)] x = (b * f - c * e) / (b * d - a * e) y = (c * d - a * f) / (b * d - a * e) print("{:.3f}, {:.3f}".format(x+0, y+0))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s988252379
p00004
Wrong Answer
import sys L = sys.stdin.readlines() for line in L: A = line.split() a, b, c, d, e, f = [float(A[i]) for i in range(6)] x = (b * f - c * e) / (b * d - a * e) y = (c * d - a * f) / (b * d - a * e) if x == 0: x = 0 print("{:.3f}, {:.3f}".format(x+0, y+0))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s404254064
p00004
Wrong Answer
import sys L = sys.stdin.readlines() for line in L: A = line.split() a, b, c, d, e, f = [int(A[i]) for i in range(6)] x = (b * f - c * e) / (b * d - a * e) y = (c * d - a * f) / (b * d - a * e) print("{:.3f}, {:.3f}".format(x+0, y+0))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s786962310
p00004
Wrong Answer
import sys for line in sys.stdin: a, b, c, d, e, f = map(float, line.split()) b /= a c /= a a = 1.0 e -= b*d f -= c*d d = 0 f /= e e = 1.0 c -= b*f print '%.4f %.4f'%(c, f)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s270074769
p00004
Wrong Answer
import sys for line in sys.stdin: a, b, c, d, e, f = map(float, line.split()) b /= a c /= a a = 1.0 e -= b*d f -= c*d d = 0 f /= e e = 1.0 c -= b*f print round(c, 3), round(f, 3)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s752889878
p00004
Wrong Answer
# input inputs = [] while True: try: inputs.append(list(map(float,input().split()))) except EOFError: break # calculation for i in inputs: x=(i[2]*i[4]-i[1]*i[5])/(i[0]*i[4]-i[1]*i[3]) y=(i[0]*i[5]-i[2]*i[3])/(i[0]*i[4]-i[1]*i[3]) print("{0:.3f} {1:.3f}".format(x,y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s574397121
p00004
Wrong Answer
inputs = [] while True: try: inputs.append(list(map(float,input().split()))) except EOFError: break for i in inputs: x=(i[2]*i[4]-i[1]*i[5])/(i[0]*i[4]-i[1]*i[3]) y=(i[0]*i[5]-i[2]*i[3])/(i[0]*i[4]-i[1]*i[3]) print("{0:.3f} {1:.3f}".format(x,y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s078011358
p00004
Wrong Answer
import sys [print("{: .3f} {: .3f}".format((x[4] * x[2] - x[1] * x[5]) / (x[0] * x[4] - x[1] * x[3]), (x[0] * x[5] - x[2] * x[3]) / (x[0] * x[4] - x[1] * x[3]))) for x in [[float(y) for y in x.split()] for x in sys.stdin]]
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s712201325
p00004
Wrong Answer
import sys [print(" ".join(["{: .3f}".format(y).strip() for y in [(x[4] * x[2] - x[1] * x[5]) / (x[0] * x[4] - x[1] * x[3]), (x[0] * x[5] - x[2] * x[3]) / (x[0] * x[4] - x[1] * x[3])]])) for x in [[float(y) for y in x.split()] for x in sys.stdin]]
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s153589672
p00004
Wrong Answer
import sys [print("{0[0]:.3f} {0[1]:.3f}".format([round(y, 3) for y in [(x[4] * x[2] - x[1] * x[5]) / (x[0] * x[4] - x[1] * x[3]), (x[0] * x[5] - x[2] * x[3]) / (x[0] * x[4] - x[1] * x[3])]])) for x in [[float(y) for y in x.split()] for x in sys.stdin]]
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s376381708
p00004
Wrong Answer
[print("{0:.3f} {1:.3f}".format( (k[2] - k[1] * ((k[0] * k[5] - k[2] * k[3]) / (k[0] * k[4] - k[1] * k[3]))) / k[0], ((k[0] * k[5] - k[2] * k[3]) / (k[0] * k[4] - k[1] * k[3]))) ) for i in ["1 2 3 4 5 6", "2 -1 -2 -1 -1 -5"] for k in [[int(float(j)) for j in i.split()]]]
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s067802585
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input().split()) tb, tc = d*b, d*c te, tf = a*e, a*f y = (tc-tf)//(tb-te) x = (c-(y*b))//a print("{0:.3f} {1:.3f}".format(x, y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s745290210
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input().split()) tb, tc = d*b, d*c te, tf = a*e, a*f y = (tc-tf)//(tb-te) x = (c-(y*b))//a print("{0:.3f} {1:.3f}".format(x+0, y+0)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s989513216
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input().split()) tb, tc = d*b, d*c te, tf = a*e, a*f y = (tc-tf)//(tb-te) x = (c-(y*b))//a print("{:.3f} {:.3f}".format(x+0, y+0)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s844221993
p00004
Wrong Answer
while True: try: a, b, c, d, e, f = map(int, input().split()) if ((a*e-b*d)!=0): tb, tc = d*b, d*c te, tf = a*e, a*f y = (tc-tf)//(tb-te) x = (c-(y*b))//a print("{:.3f} {:.3f}".format(x, y)) except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s448937731
p00004
Wrong Answer
import sys for line in sys.stdin: [a,b,e,c,d,f] = [int(x) for x in line.split()] delta = a*d-b*c x = (d*e-b*f)/delta y = (-e*c+a*f)/delta print x,y
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s147204969
p00004
Wrong Answer
import sys for line in sys.stdin: [a,b,e,c,d,f] = [int(x) for x in line.split()] delta = a*d-b*c x = (d*e-b*f)/delta y = (-e*c+a*f)/delta print round(x,4),round(y,4)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s231490030
p00004
Wrong Answer
import sys for line in sys.stdin: [a,b,e,c,d,f] = [int(x) for x in line.split()] delta = a*d-b*c x = (d*e-b*f)/delta y = (-e*c+a*f)/delta print "%.3f %.3f" % (x,y)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s779010567
p00004
Wrong Answer
import sys for line in sys.stdin: [a,b,e,c,d,f] = [float(x) for x in line.split()] delta = a*d-b*c x = (d*e-b*f)/delta y = (-e*c+a*f)/delta print "%.3f %.3f" % (x,y)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s431815139
p00004
Wrong Answer
#coding: utf-8 import sys for line in sys.stdin: l = (map(int,line.split())) a, b, c, d, e, f = l x = float(c*e - b*f) / float(a*e - b*d) y = float(c*d - a*f) / float(b*d - a*e) print round(x,3),round(y,3)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s171443648
p00004
Wrong Answer
#coding: utf-8 import sys for line in sys.stdin: l = (map(int,line.split())) a, b, c, d, e, f = l x = float(c*e - b*f) / float(a*e - b*d) y = float(c*d - a*f) / float(b*d - a*e) print "%.3f" %x , "%.3f" %y
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s360433552
p00004
Wrong Answer
#coding: utf-8 import sys for line in sys.stdin: l = (map(float,line.split())) a, b, c, d, e, f = l x = float(c*e - b*f) / float(a*e - b*d) y = float(c*d - a*f) / float(b*d - a*e) print "%.3f" %x , "%.3f" %y
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s838473406
p00004
Wrong Answer
#coding: utf-8 import sys for line in sys.stdin: l = (map(float,line.split())) a = l[0] b = l[1] c = l[2] d = l[3] e = l[4] f = l[5] x = float(c*e - b*f) / float(a*e - b*d) y = float(c*d - a*f) / float(b*d - a*e) print "%.3f" %x , "%.3f" %y
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s174983889
p00004
Wrong Answer
while True: try: a,b,c,d,e,f = map(int,input().split()) x = (c*e - f*b)/(a*e - b*d) y = (c*d - f*a)/(b*d - e*a) x = round(x,3) y = round(y,3) print("{0:.3f}".format(x),end = ' ') print("{0:.3f}".format(y)) except EOFError: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s784381160
p00004
Wrong Answer
import sys from math import fabs if __name__ == '__main__': epsilon = 1e-10 # ??????????????\?????¨??????????????? for line in sys.stdin: a, b, e, c, d, f = [int(x) for x in line.strip().split(' ')] x = 1/(a*d-b*c) * (d*e - b*f) y = 1/(a*d-b*c) * (-c*e + a*f) # ?¨????????????¨?????? -0.0 ???????????´???????????¶?????? 0.0 ????????? if fabs(x) < epsilon: x = 0.0 if fabs(y) < epsilon: y = 0.0 print('{0:.3f}, {1:.3f}'.format(x, y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s762538878
p00004
Wrong Answer
import sys from math import fabs if __name__ == '__main__': epsilon = 1e-8 # ??????????????\?????¨??????????????? for line in sys.stdin: a, b, e, c, d, f = [int(x) for x in line.strip().split(' ')] x = 1/(a*d-b*c) * (d*e - b*f) y = 1/(a*d-b*c) * (-c*e + a*f) # ?¨????????????¨?????? -0.0 ???????????´???????????¶?????? 0.0 ????????? #if fabs(x) < epsilon: # x = 0.0 #if fabs(y) < epsilon: # y = 0.0 print('{0:.3f}, {1:.3f}'.format(x+0.0, y+0.0))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s267981503
p00004
Wrong Answer
while(1): try: [a,b,c,d,e,f]=map(int,raw_input().split()) det=a*e-d*b x,y=(e*c-b*f)/float(det) ,(-d*c+a*f)/float(det) print '%.3f'%x,'%.3f'%y except: break
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s848424188
p00004
Wrong Answer
while True: try: a,b,c,d,e,f=[int(i) for i in input().split()] except: break x=(c*e-b*f)/(a*e-b*d) y=(c*d-a*f)/(b*d-a*e) print("{0:.3f} {1:.3f}".format(x,y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s931901314
p00004
Wrong Answer
while True: try: a,b,c,d,e,f=[int(i) for i in input().split()] except: break x=(c*e-b*f)/(a*e-b*d) y=(c*d-a*f)/(b*d-a*e) print("{0:.3f} {1:.3f}".format(round(x),round(y)))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s729134667
p00004
Wrong Answer
while True: try: a,b,c,d,e,f=[float(i) for i in input().split()] except: break x=(c*e-b*f)/(a*e-b*d) y=(c*d-a*f)/(b*d-a*e) print("{0:.3f} {1:.3f}".format(x,y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s797930139
p00004
Wrong Answer
# -*- coding:utf-8 -*- import sys def solve_eq(a,b,c,d,e,f): x = ((e*c)-(b*f))/((a*e)-(b*d)) y = ((a*f)-(c*d))/((a*e)-(b*d)) sol = [x,y] return sol array = [] for i in sys.stdin: array.append(i) a = [0]*6 for i in range(len(array)): x = array[i].split() for i in range(len(x)): a[i] = float(x[i]) ans = solve_eq(a[0],a[1],a[2],a[3],a[4],a[5]) print("{0:0.3f}".format(ans[0]), "{0:0.3f}".format(ans[1]))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s017344354
p00004
Wrong Answer
def jisuan(lis): ns = lis.split(" ") for i in range(6): ns[i] = float(ns[i]) a, b, c, d, e, f = ns[0], ns[1], ns[2], ns[3], ns[4], ns[5] x = (c * e - b * f) / (a * e - b * d) y = (c * d - a * f) / (b * d - a * e) return [x, y] while 1: try: inpu = str(input()) except: break nums = inpu.split("\n") for l in range(len(nums)): k0 = jisuan("1 2 3 4 5 6")[0] k1 = jisuan("1 2 3 4 5 6")[1] print("%.3f" % k0, "%.3f" % k1)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s851470424
p00004
Wrong Answer
def jisuan(lis): ns = lis.split(" ") for i in range(6): ns[i] = float(ns[i]) a, b, c, d, e, f = ns[0], ns[1], ns[2], ns[3], ns[4], ns[5] x = (c * e - b * f) / (a * e - b * d) y = (c * d - a * f) / (b * d - a * e) return [x, y] inpu = str(input()) nums = inpu.split("\n") for l in range(len(nums)): k0 = jisuan("1 2 3 4 5 6")[0] k1 = jisuan("1 2 3 4 5 6")[1] print("%.3f" % k0, "%.3f" % k1)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s304639838
p00004
Wrong Answer
def jisuan(lis): ns = lis.split(" ") for i in range(6): ns[i] = float(ns[i]) a, b, c, d, e, f = ns[0], ns[1], ns[2], ns[3], ns[4], ns[5] x = (c * e - b * f) / (a * e - b * d) y = (c * d - a * f) / (b * d - a * e) return [x, y] inpu = str(input()) nums = inpu.split("\n") for l in range(len(nums)): k0 = jisuan(nums[l])[0] k1 = jisuan(nums[l])[1] print("%.3f" % k0, "%.3f" % k1)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s173443861
p00004
Wrong Answer
while 1: try:a,b,c,d,e,f=map(int,input().split()) except:break x=(c*d-a*f)/(b*d-a*e) print("%f %f"%((c-b*x)/a,x))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s365418262
p00004
Wrong Answer
while True: try: a,b,c,d,e,f = map(int, input().split()) except EOFError: break x = c/a + (f*a-c*d)*b / (e*a-d*b) / a y = (f*a - c*d) / (e*a - b*d) print('{:.3f} {:.3f}')
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s938718996
p00004
Wrong Answer
while True: try: a,b,c,d,e,f = map(int, input().split()) except EOFError: break x = c/a + (f*a-c*d)*b / (e*a-d*b) / a y = (f*a - c*d) / (e*a - b*d) print('{:.3f} {:.3f}'.format(x, y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s756434199
p00004
Wrong Answer
from sys import stdin for l in stdin: a,b,c,d,e,f = map(int,l.split()) x = round((c*e-b*f)/(a*e-b*d),3) y = round((c*d-a*f)/(b*d-a*e),3) print("%s %s"%("{0:.3f}".format(x),"{0:.3f}".format(y)))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s621921774
p00004
Wrong Answer
try: while 1: a, b, c, d, e, f = list(map(int, input().split())) s = (a*e-b*d) x = e * c - b * f y = -c * d + a * f print(x/s, y/s) except: pass
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s170228223
p00004
Wrong Answer
import sys nums = [] for line in sys.stdin: nums.append(line) for i in range(len(nums)): input_line = nums[i].split(" ") a = float(input_line[0]) b = float(input_line[1]) c = float(input_line[2]) d = float(input_line[3]) e = float(input_line[4]) f = float(input_line[5]) x = (f * b - e * c)/(b * d - a * e) y = (c - a * x)/b x_out = round(x,3) if int(x_out) == 0: x_out = 0 y_out = round(y,3) if int(y_out) == 0: y_out = 0 print("{0:.3f}".format(x_out) + " " + "{0:.3f}".format(y_out))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s837987682
p00004
Wrong Answer
for i in range(2): k = list(map(float,input().split())) n = k[0]*k[4] -k[1]*k[3] x,y = (k[4]*k[2]-k[1]*k[5])/n,(-k[3]*k[2]+k[0]*k[5])/n if x == 0: x = 0 if y == 0: y = 0 print("{0:0.3f} {1:0.3f}".format(x,y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s554666721
p00004
Wrong Answer
for i in range(2): k = list(map(float,input().split())) n = k[0]*k[4] -k[1]*k[3] x,y = round((k[4]*k[2]-k[1]*k[5])/n,4),round((-k[3]*k[2]+k[0]*k[5])/n,4) if x == 0: x = 0 if y == 0: y = 0 print("{0:0.3f} {1:0.3f}".format(x,y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s761348634
p00004
Wrong Answer
x,y = [0]*2,[0]*2 for i in range(2): k = list(map(float,input().split())) n = k[0]*k[4] -k[1]*k[3] x[i],y[i] = (k[4]*k[2]-k[1]*k[5])/n,(-k[3]*k[2]+k[0]*k[5])/n if x == 0: x = 0 if y == 0: y = 0 for i in range(2): print("{0:0.3f} {1:0.3f}".format(x[i],y[i]))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s030486368
p00004
Wrong Answer
x,y = [0]*2,[0]*2 for i in range(2): k = list(map(float,input().split())) n = k[0]*k[4] -k[1]*k[3] x[i],y[i] = (k[4]*k[2]-k[1]*k[5])/n,(-k[3]*k[2]+k[0]*k[5])/n if x == -0: x = 0 if y == -0: y = 0 for i in range(2): print("{0:0.3f}".format(x[i]),"{0:0.3f}".format(y[i]))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s358406998
p00004
Wrong Answer
x,y = [0]*2,[0]*2 for i in range(2): k = list(map(float,input().split())) n = k[0]*k[4] -k[1]*k[3] x[i] = round((k[4]*k[2]-k[1]*k[5])/n,3) y[i] = round((-k[3]*k[2]+k[0]*k[5])/n,3) if x == -0: x = 0 if y == -0: y = 0 for i in range(2): print("{0:.3f}".format(x[i]),"{0:.3f}".format(y[i]))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s556585344
p00004
Wrong Answer
for i in range(2): k = list(map(float,input().split())) n = k[0]*k[4] -k[1]*k[3] x = round((k[4]*k[2]-k[1]*k[5])/n,3) y = round((-k[3]*k[2]+k[0]*k[5])/n,3) if x == -0: x = 0 if y == -0: y = 0 print("{0:.3f}".format(x),"{0:.3f}".format(y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s179622949
p00004
Wrong Answer
for i in range(2): a,b,c,d,e,f = map(float,input().split()) n = a*e-b*d x = round((e*c-b*f)/n,3) y = round((a*f-d*c)/n,3) if x == -0: x = 0 if y == -0: y = 0 print("{0:.3f}".format(x),"{0:.3f}".format(y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s108245351
p00004
Wrong Answer
for i in range(2): a,b,c,d,e,f = map(float,input().split()) n = a*e-b*d print(n) x = round((e*c-b*f)/n,4) y = round((a*f-d*c)/n,4) if x == -0: x = 0 if y == -0: y = 0 print("{0:.3f}".format(x),"{0:.3f}".format(y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s677061218
p00004
Wrong Answer
ini=map(int, raw_input().split()) x=(ini[2]*ini[4]-ini[1]*ini[5])/(ini[0]*ini[4]-ini[1]*ini[3])*1.0 y=(ini[2]*ini[3]-ini[0]*ini[5])/(ini[1]*ini[3]-ini[0]*ini[4])*1.0 xx=round(x,3) yy=round(y,3) xxx=('%4.3f' % xx) yyy=('%4.3f' % yy) print xxx,yyy
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s455902778
p00004
Wrong Answer
import sys a=[] for i in sys.stdin: a.append(i) for j in a: ini=map(int, j.split()) x=(ini[2]*ini[4]-ini[1]*ini[5])/(ini[0]*ini[4]-ini[1]*ini[3])*1.0 y=(ini[2]*ini[3]-ini[0]*ini[5])/(ini[1]*ini[3]-ini[0]*ini[4])*1.0 xx=round(x,3) yy=round(y,3) xxx=('%4.3f' % xx) yyy=('%4.3f' % yy) print xxx,yyy
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s146086374
p00004
Wrong Answer
import sys a=[] for i in sys.stdin: a.append(i) for j in a: ini=map(int, j.split()) x=(ini[2]*ini[4]-ini[1]*ini[5])/(ini[0]*ini[4]-ini[1]*ini[3])*1.0 y=(ini[2]*ini[3]-ini[0]*ini[5])/(ini[1]*ini[3]-ini[0]*ini[4])*1.0 xx=round(x,3) yy=round(y,3) xxx=('%3.3f' % xx) yyy=('%3.3f' % yy) print xxx,yyy
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s677910527
p00004
Wrong Answer
import sys a=[] for i in sys.stdin: a.append(i) for j in a: ini=map(int, j.split()) x=(ini[2]*ini[4]-ini[1]*ini[5])*1.0/(ini[0]*ini[4]-ini[1]*ini[3])*1.0 y=(ini[2]*ini[3]-ini[0]*ini[5])*1.0/(ini[1]*ini[3]-ini[0]*ini[4])*1.0 xx=round(x,3) yy=round(y,3) xxx=('%3.3f' % xx) yyy=('%3.3f' % yy) print xxx,yyy
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s844424751
p00004
Wrong Answer
lines = [] while 1: try: lines.append(input()) except EOFError: break for l in lines: print(l)
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s944977573
p00004
Wrong Answer
import sys lines = sys.stdin.readlines() for line in lines: a, b, c, d, e, f = map(float, line.split()) A = a * e - b * d if A == 0: break; x = (c * e - b * f) / A y = (a * f - c * d) / A print("%.3f %.3f" %(x,y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s787016119
p00004
Wrong Answer
#_*_ coding:utf-8 _*_ import sys while True: vals = sys.stdin.readline() if(vals is None or vals.strip() == '' ): break a,b,c,d,e,f=list( map(float,vals.strip().split())) temp = a * e - d * b print(temp) x = (c * e - b * f) / temp + 0.0 y = (c * d - a * f) / -temp + 0.0 print('%.3f %.3f' % (x,y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>
s879877865
p00004
Wrong Answer
import sys import random for s in sys.stdin: a,b,c,d,e,f = map(float, s.split()) x = (e*c-b*f)/(a*e-b*d) y = (a*f-d*c)/(a*e-b*d) print('{0:.3f} {1:.3f}'.format(x, y))
1 2 3 4 5 6 2 -1 -2 -1 -1 -5
-1.000 2.000 1.000 4.000
<H1>Simultaneous Equation</H1> <p> Write a program which solve a simultaneous equation:<br> <br> <var> ax + by = c</var><br> <var> dx + ey = f</var><br> <br> The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 &le; <var>a, b, c, d, e, f</var> &le; 1,000). You can suppose that given equation has a unique solution. </p> <H2>Input</H2> <p> The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF. </p> <H2>Output</H2> <p> For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places. </p> <H2>Sample Input 1</H2> <pre> 1 2 3 4 5 6 2 -1 -2 -1 -1 -5 </pre> <H2>Output for the Sample Input 1</H2> <pre> -1.000 2.000 1.000 4.000 </pre> <H2>Sample Input 2</H2> <pre> 2 -1 -3 1 -1 -3 2 -1 -3 -9 9 27 </pre> <H2>Output for the Sample Input 2</H2> <pre> 0.000 3.000 0.000 3.000 </pre>