Linear equation

Linear equation. Write a program that solves a linear equation ax = b in integers. Given two integers a and b (a may be zero), print a single integer root if it exists and print “no solution” or “many solutions” otherwise.

Input

Output

1
-2

-2

2
-1

no solution

5
15

3

-5
30

-6

-7
-7

1

 

Leave a Reply

Your email address will not be published. Required fields are marked *