Advertisement
Josif_tepe

Untitled

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