#pragma GCC optimize "O3" #include using namespace std; using LL=long long; #define FOR(i,l,r) for(int i=(l);i<=(r);++i) #define REP(i,n) FOR(i,0,(n)-1) #define ssize(x) int(x.size()) #ifdef DEBUG auto&operator<<(auto&o,pairp){return o<<"("<decltype(x.end(),o){o<<"{";int i=0;for(auto e:x)o<<","+!i++<sync_with_stdio(0); int n, k; cin >> n >> k; LL h = 0; REP(i, n) { LL x; cin >> x; h = max(h, x); } debug(n, k, h); pair, int> ans = {{h, 1}, -1}; for (LL r = h, l; r >= 1; r = l - 1) { l = (h + r - 1) / r; l = (h + l - 1) / l; debug(l, r, (h + l - 1) / l, (h + r - 1) / r); auto test = [&](LL d) { LL licz = (h + d - 1) / d; LL mian = k - d; if (min(mian, d) < 1 or max(mian, d) > k) return; if (licz * __int128(ans.first.second) < ans.first.first * __int128(mian)) { ans = {{licz, mian}, d}; } debug(d, ans); }; test(l); test(r); } debug(ans); auto [_, d] = ans; cout << d << ' ' << k - d << '\n'; }