#P1022. [NOIP 2000 普及组] 计算器的改良

[NOIP 2000 普及组] 计算器的改良

Description

To accomplish this task well, Mr. ZL first studied some examples of linear equations in one variable:

  • 4+3x=84+3x=8.
  • 6a5+1=22a6a-5+1=2-2a.
  • 5+12y=0-5+12y=0.

Mr. ZL was told by his supervisor that a linear equation in one variable entered into the calculator contains only integers, lowercase letters, and the three mathematical symbols +, -, = (of course, the symbol - can be either a subtraction sign or a unary minus). The equation has no parentheses and no division operator. The letters in the equation denote the unknown.

You may assume that the correctness of the entered equation is verified by another programmer; in other words, every entered linear equation in one variable is valid and has a unique real solution.

Input Format

A linear equation in one variable.

Output Format

The solution of the equation (rounded to three decimal places).

6a-5+1=2-2a

a=0.750

Hint

Translated by ChatGPT 5