#include #include #include #include #include #include #include #include #include #include using namespace std; #define N #define M #define WATCH(x) cout << (#x) << ": " << (x) << endl #define fWATCH(x, y) cout << x << ": " << y << endl #define tWATCH(x, y, z) cout << x << ": " << y << ", " << z << endl #define INFO(x) cout << "[ " << x << " ]\n" #define nINFO(n, x) cout << "[ " << to_string() << ": " << x << " ]\n" #define SUM(vec, fn) accumulate(vec.begin(), vec.end(), 0, fn) template struct Pair { T1 x; T2 y; }; struct Range { int from; int to; }; using Str = string; template using Vec = vector; using StrVec = vector; using nMap = map; template using xMap = map; // #define FOR(from, to, what) for (auto i = from; i < to; i++) { what(i); } // #define FOR(from, to, from2, to2, what) for (auto j = from; j < to; j++) { for (auto i = from; i < to; i++) { what(i, j); } } typedef long int32; typedef unsigned long uint32; typedef long long ll; typedef unsigned long long uint64; #define toS(x) to_string(x) int main() { //cin.tie(); int32 area; ll len; cin >> area; cin >> len; ll n; Vec vec; for (ll i = 0; i < len; i++) { cin >> n; vec.push_back(n); } sort(vec.begin(), vec.end()); for (int i = 0; i < len; i++) { if (area % vec[i] == 0) { ll x = area / vec[i]; if (x < vec[i]) { cout << toS(x) << " " << toS(vec[i]) << "\n"; } else { cout << toS(vec[i]) << " " << toS(x) << "\n"; } break; } } return 0; }