task1.9.cpp 576 B

123456789101112131415161718192021222324
  1. #include <iostream>
  2. #include <vector>
  3. int main() {
  4. int k, l, m;
  5. std::cin >> k >> l >> m;
  6. std::vector<std::pair<int, int>> multiples;
  7. if (k % l == 0) multiples.push_back({k, l});
  8. if (k % m == 0) multiples.push_back({k, m});
  9. if (l % k == 0) multiples.push_back({l, k});
  10. if (l % m == 0) multiples.push_back({l, m});
  11. if (m % k == 0) multiples.push_back({m, k});
  12. if (m % l == 0) multiples.push_back({m, l});
  13. for (const auto& pair : multiples) {
  14. std::cout << pair.first << " " << pair.second << std::endl;
  15. }
  16. return 0;
  17. }