#include #define pii pair #define ll long long using namespace std; ll v[200005]; void solve() { int n, k; cin >> n >> k; for(int i = 1; i <= n; i++) cin >> v[i]; long double mn = 1e18; int minx = 0; for(int x = max(1, k / 2 - 200); x <= min(k - 1, k / 2 + 200); x++) { long double sol = 0; for(int i = 1; i <= n; i++) { sol += ceil(1.0 * v[i] / x); } sol /= (k - x); if(sol < mn) { mn = sol; minx = x; } } cout << minx << " " << k - minx << "\n"; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #ifdef LOCAL freopen("test.in", "r", stdin); freopen("test.out", "w", stdout); #else #endif int T = 1; //cin >> T; while(T--) { solve(); } return 0; }