BlueBook - Equation

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 16M

Problem type
BlueBook

Given the real coefficients a and b (-1\,000 \le a, b \le 1\,000), solve for x in the following equation.

\displaystyle ax + b = 0

Be sure to output "indeterminate" and "undefined" whenever appropriate. Remember \dfrac 0 0 is indeterminate, and something like \dfrac 4 0 is undefined.

Output the value of x rounded to two decimal places.

Input Specification

The input consists of two real numbers, a and b. a and b will be on separate lines, with a first, and b second.

Output Specification

Output the value of x according to the given values and equation. Be sure to output indeterminate and undefined whenever appropriate.

Sample Input 1

10
5

Sample Output 1

-0.50

Sample Input 2

13.5555
1.244685

Sample Output 2

-0.09

Sample Input 3

0
0

Sample Output 3

indeterminate

Sample Input 4

0
4

Sample Output 4

undefined

Comments

There are no comments at the moment.