C++ || BINARY SEARCH
\nclass Solution {\npublic:\n    \n    int maximumCandies(vector<int>& candies, long long k) {\n        long long l=1,h=0;\n        for(int& t:candies)\n       
```\nclass Solution {\npublic:\n    \n    int maximumCandies(vector<int>& candies, long long k) {\n        long long l=1,h=0;\n        for(int& t:candies)\n            h+=t;\n        int ans=0;\n        while(l<=h)\n        {\n            long long mid=l+(h-l)/2;\n            long long val=0;\n            for(auto t:candies)\n                val+=(t/mid);\n            if(val>=k)\n            {\n                ans=mid;\n                l=mid+1;\n            }\n            else h=mid-1;\n        }\n        return ans;\n    }\n};\n```
['Binary Search', 'C', 'C++']