Advertisement
Josif_tepe

Untitled

Oct 15th, 2021
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int K, A, B;
  8.     cin >> K >> A >> B;
  9.     if (A == B)
  10.     {
  11.         cout << "NE" << endl;
  12.         return 0;
  13.     }
  14.     int X = 0;
  15.     X = K / (B - A);
  16.     if (K + X * A == X * B)
  17.     {
  18.         cout << X << endl;
  19.     }
  20.     else {cout << "NE" << endl;}
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement