Advertisement
Josif_tepe

Untitled

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