Advertisement
Josif_tepe

Untitled

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