Logo
(追記) (追記ここまで)

14543번 - Linear Equation 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB7141119316.940%

문제

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

입력

The first line of input contains a single integer P, (1 ≤ P ≤ 100), which is the number of data sets that follow. Each data set consists of a single line containing one simple linear equation. Each equation will be in the form of ax, followed by a single space, followed by a sign “+”, followed by b, followed by a single space, followed by a sign “=”, followed by a single space, followed by c.

ax + b = c

where x is the variable, and a, b, c are non-negative integers (a, b, c ≤ 109).

출력

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, print "x = solution" where solution is replaced by the appropriate real number, truncated to six digits after the decimal point.

Print a blank line after each data set case.

제한

예제 입력 1

5
2x + 3 = 4
124x + 20 = 160
123456x + 7 = 2000
0x + 2 = 3
0x + 2 = 2

예제 출력 1

Equation 1
x = 0.500000
Equation 2
x = 1.129032
Equation 3
x = 0.016143
Equation 4
No solution.
Equation 5
More than one solution.

힌트

출처

ICPC > Regionals > Africa and Arab > South Africa Regional Contest > Beninese Collegiate Programming Contest > The 2016 Beninese Collegiate Programming Contest A번

  • 잘못된 조건을 찾은 사람: jaehoo1
  • 문제를 다시 작성한 사람: jh05013
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /