#include using namespace std; int main() { unsigned long long C; cin >> C; int N; cin >> N; vector v(N); for (int n = 0; n < N; n++) { cin >> v[n]; } sort(v.begin(), v.end()); // for (int i = 0; i < N; i++) { // cout << v[i] << " "; // } // cout << endl; for (int i = 0; i < N; i++) { if (C % v[i] == 0) { unsigned long long div_res = C / v[i]; bool res = binary_search(v.begin(), v.end(), div_res); if (res == 0) { continue; } else { cout << v[i] << " " << div_res << endl; break; } } } return 0; }