Advertisement
stupid_pro

Untitled

Oct 18th, 2021
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4.     int a, b; //нод и нок
  5.     cin >>a >>b; //нод и нок
  6.     for (int i=a; i<b; i++){
  7.         for (int j=a+1; j<b; j++) {
  8.             if (i % a == 0 && j % a == 0) {
  9.                 cout << i << " " << j;
  10.                 break;
  11.             }
  12.             if (i==b-1 && j==b-1) cout<< -1;
  13.             }
  14.         }
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement