#include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(i,n) for (int i=0; i<(int)(n); i++) using namespace std; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } typedef long long ll; typedef pair P; using Graph = vector>; //#define INF 10000000 class UnionFind{ public: vector par; UnionFind(int n) : par(n){ for(int i=0; i a; bool isOk(ll key){ ll t = key*m; ll sum = 0; bool res = true; for(int i=0; i> n >> m; a.resize(n); rep(i,n) cin >> a[i]; ll right = 1000000010; ll left = 0; while(right - left > 1){ ll mid = (right + left)/2; if(isOk(mid)) left = mid; else right = mid; } cout << left << endl; }