Advertisement
Josif_tepe

Untitled

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