Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int K, A, B;
- cin >> K >> A >> B;
- int rezultat = -1;
- for(int den = 0; den <= 10000; den++) {
- if(K + den * A == B * den) {
- rezultat = den;
- break;
- }
- }
- if(rezultat == -1) {
- cout << "NE" << endl;
- }
- else {
- cout << rezultat << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement