Solve the rational equation (ax + b) / (cx + d) = 0 in integers.
Four numbers are entered: a, b, c, and d. c and d are not both zero.
Output all integer solutions if their number is finite; output "NO" if there are none; output "INF" if there are infinitely many.
Input #1
1 1 2 2
Output #1
NO
Input #2
2 -4 7 1
Output #2
2
Sign in to submit your solution and save your progress.