Concise Binary Search | C++
\nclass Solution {\n    bool good(int x, vector<int> &c, long long k) {\n        long long cnt = 0;\n        for(int i : c) cnt += i / x;\n        return cnt < 
```\nclass Solution {\n    bool good(int x, vector<int> &c, long long k) {\n        long long cnt = 0;\n        for(int i : c) cnt += i / x;\n        return cnt < k ? false : true;\n    }\npublic:\n    int maximumCandies(vector<int>& candies, long long k) {\n        int s = 1, e = 1e9, ans = INT_MIN;\n        while(s <= e) {\n            int m = (s + e) / 2;\n            if(good(m, candies, k)) ans = max(ans, m), s = m + 1;\n            else e = m - 1;\n        }\n        return ans == INT_MIN ? 0 : ans;\n    }\n};\n```
['Binary Search', 'C++']