Թաքցված խնդիր
|Այս խնդիրը թաքցված է խմբագրական խրհրդի անդամի կողմից քանի որ կամ այն ոչ ճիշտ լեզվով է գրված,|կամ թեստային տվյալներն են սխալ, կամ խնդրի ձևակերպումը պարզ չէ։|

ACM0310 - EQUATION

You have been asked to write a program that can solve a linear equation.

Input.

The first line of input contains a single integer P, (1 ≤ P ≤ 1000), which is the number of data sets that follow. Each data set consists of two lines containing each, one member of the equation. All equations are composed of strings of less than 200 characters.

Each line of each equation will be in the form of ax, followed by a single space, followed by a sign “+”, followed by a single space, followed by by, followed by a single space, followed by a sign “=”, followed by a single space, followed by c.

ax + by = c

where x and y are the variables (real number) and a, b, c are positive integers.

Output.

For each data set, generate two lines of output. The first line will contain “Equation n” where n is the number of the data set. The second line will contain the following answer:

• If the equation has no solution, print "No solution.".
• If the equation has infinitely many solutions, print "More than one solution.".
• If the equation has exactly one solution for (x,y), print "x = solution1", followed by two spaces, followed by "y = solution2" where solution1 and solution2 are replaced by the appropriate reals numbers (printed to six decimals).

Print a blank line after each data set case output.

Sample test.

 N stdin stdout 1 52x + 3y = 43x + 2y = 6124x + 20y = 1602x + 4y = 5123x + 321y = 12312x + 21y = 122x + 3y = 40x + 0y = 4123456x + 7y = 2000123456x + 7y = 2000 Equation 1x = 2.000000 y = 0.000000 Equation 2x = 1.184210 y = 0.657894 Equation 3x = 1.000000 y = 0.000000 Equation 4No solution. Equation 5More than one solution.

 Ավելացրեց. Հրանտ Հովհաննիսյան Ամսաթիվ. 2016-07-25 Ժամանակի սահմանափակումը. 1s Ծրագրի տեքստի սահմանափակումը. 50000B Memory limit: 1536MB Cluster: Cube (Intel G860) Լեզուներ. Բոլորը բացի ASM32 ASM64 GAWK CLPS CLOJURE D ERL FSHARP FORTRAN GOSU HASK ICON ICK NEM NIM OBJC-CLANG PICO PIKE PYPY PY_NBC RUST SCM guile CHICKEN SED TCL WHITESPACE Աղբյուրը. Togolese Collegiate Programming Contest, 2016