C++ || Easy Binary Search Solution
\nclass Solution {\npublic:\n    long long repairCars(vector<int>& ranks, int cars) {\n        long long l=1;\n        long long r=1e18;\n        auto isgood=[&
```\nclass Solution {\npublic:\n    long long repairCars(vector<int>& ranks, int cars) {\n        long long l=1;\n        long long r=1e18;\n        auto isgood=[&](const long long mid){\n            long long cnt=0;\n            for(int i=0;i<ranks.size();i++){\n                cnt+=sqrt(mid/ranks[i]);\n            }\n            return cnt>=cars;\n        };\n        while(l<=r){\n            long long mid=(l+(r-l)/2);\n            if(isgood(mid)){\n                r=mid-1;\n            }\n            else{\n                l=mid+1;\n            }\n        }\n        return l;\n    }\n};\n```
['C', 'Binary Tree']