#include #include auto input(){ int count; std::cin >> count; std::vector nums; for (int i = 0; i> num; nums.emplace_back(num); } return nums; } auto algo(std::vector &nums, int pool_size){ int second_num = 0; int first_num = 0; for (size_t i=0; i< nums.size(); i++){ if (pool_size%nums[i] == 0) { first_num = nums[i]; second_num = pool_size / nums[i]; break; } } // for (int i = 0; i ab; if (first_num > second_num){ ab.first = second_num; ab.second =first_num; } else { ab.first = first_num; ab.second =second_num; } return ab; } int main(){ int pool_size; std::cin >> pool_size; std::vector nums = input(); std::pair ab = algo(nums,pool_size); std::cout << ab.first << " " << ab.second << std::endl; return 0; }