✅C++ || Binary Search
Code\n\nclass Solution {\npublic:\n    long long repairCars(vector<int>& v, int cars) {\n        long long i=1,j=100000000000000;\n        long long ans=j;\n   
# Code\n```\nclass Solution {\npublic:\n    long long repairCars(vector<int>& v, int cars) {\n        long long i=1,j=100000000000000;\n        long long ans=j;\n        while(i<=j){\n            long long m=(i+j)/2;\n            long long tt=0;\n            for(int i=0;i<v.size();i++){\n                long long c=sqrt(m/v[i]);\n                tt += c;\n            }\n            if(tt>=cars){\n                ans=m;\n                j=m-1;\n            }\n            else i=m+1;\n        }\n        return ans;\n    }\n};\n```\n![upvote (3).jpg](https://assets.leetcode.com/users/images/83884030-74d1-4086-9b9a-c78d5aec91e7_1679303171.2753437.jpeg)\n
['Binary Search', 'C++']