fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. long long a, b;
  6.  
  7. int main()
  8. {
  9. ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  10.  
  11. cin >> a >> b;
  12. if (a == 0 && b == 0)
  13. cout << "INFINITE SOLUTIONS";
  14. else if ((a == 0 && b != 0) || (b % a != 0))
  15. cout << "NO SOLUTION";
  16. else
  17. cout << -b/a;
  18. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
INFINITE SOLUTIONS