Phương trình bậc 2

View as PDF

Submit solution

Points: 0.01
Time limit: 1.0s
Memory limit: 64M
Input: stdin
Output: stdout

Authors:
Problem type

Cho 2 số nguyên a,b (Với 0≤a,b≤10000). Hãy giải phương trình bậc nhất ax+b=0. Nếu ra vô số nghiệm xuất ra 1. Nếu ra vô nghiệm xuẩt ra 2.

Input

Dòng đầu tiên có chứa 2 số nguyên a,b (Với 0≤a,b≤10000).

Output

Một dòng duy nhất là 1 số là giá trị của x. Nếu ra vô số nghiệm xuất ra 1. Nếu ra vô nghiệm xuẩt ra 2.

Simple Input 1

0 0

Simple Output 1

1

Simple Input 2

0 1

Simple Output 2

2

Simple Input 3

2 0

Simple Output 3

0.000000

Simple Input 4

8 6

Simple Output 4

-0.750000


Comments

Please read the guidelines before commenting.


There are no comments at the moment.