#include #define all(a) a.begin(),a.end() #define len(a) (int)(a.size()) #define fir first #define sec second #define fi first #define se second #define mp make_pair #define pb push_back using namespace std; typedef pair pii; typedef long long ll; typedef long double ld; template bool umin(T &a, T b) { if (b < a) { a = b; return 1; } return 0; } template bool umax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } #ifdef KIVI #define DEBUG for (int _____DEBUG=1;_____DEBUG;_____DEBUG=0) #define LOG(...) prnt(#__VA_ARGS__" ::",__VA_ARGS__)< auto &prnt(Ts ...ts) { return ((cerr << ts << " "), ...); } #else #define DEBUG while (false) #define LOG(...) #endif const int max_n = -1, inf = 1000111222; const bool DBG = true; mt19937 rng; ld get(vector& a, ll x, ll y) { ld res = 0; for(auto& cr : a) res += (cr + x - 1) / x; res /= (ld)y; return res; } bool brute(vector& a, int k) { vector res(k - 1); for(int x = 1; x < k; x++) res[x - 1] = get(a, x, k - x); bool ok = false; for(int cur = 0; cur < k - 1; cur++) { bool cur_ok = true; for(int i = cur - 1; i >= 0; i--) cur_ok &= res[i] >= res[i + 1]; for(int i = cur + 1; i < k - 1; i++) cur_ok &= res[i] >= res[i - 1]; ok |= cur_ok; } return ok; } void solve() { // if(DBG) { // int n = 10, k = 10; // const ll mx = 10; // vector kek(n); // for(auto& x : kek) x = rng() % mx + 1; // if(!brute(kek, k)) { // cout << n << '\n'; // for(int x = 1; x < k; x++) // cout << get(kek, x, k - x) << ' '; // cout << '\n'; // exit(0); // } else cout << "OK" << endl; // } int n, k; cin >> n >> k; vector a(n); for(int i = 0; i < n; i++) cin >> a[i]; ld ans = 1000111222000111222; int A = 0, B = 0; for(int x = k / 2 - 2000; x < k / 2 + 2000; x++) { int X = x, Y = k - X; if(X > 1 && Y > 1 && umin(ans, get(a, X, Y))) { A = X, B = Y; } } cout << A << ' ' << B << '\n'; } int main() { // freopen("input.txt","r",stdin); // freopen("output.txt","w",stdout); ios_base::sync_with_stdio(0); cin.tie(0); int t = 1; //if(DBG) t = 10000; while(t--) solve(); exit(0); }