VERY BASIC AND EASY IMPLEMENTATION BINARY SEARCH SOLUTION 
IntuitionApproach
Apply binary search on time the low will be 1 as 1 car and min time coud be 1 for least case and h max could be 1001e51e5 where only i mechani
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->
1. Apply binary search on time the low will be 1 as 1 car and min time coud be 1 for least case and h max could be 100*1e5*1e5 where only i mechanic with r 100 has to repair 1e5 cars.
2. If for the given mid value the no of cars that cvan get repaired is >= cars that could be a potential answer and we will sharch for lower answers if possible else we will try for higher time.
3. tc=log(1e14) for bs * ranks.size() for for loop * log(1e12) for worst case sqrt finction approx 50*40*1e5 2*1e7 approx
       DO UPVOTE THE SOLUTION PLEASE. 
# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
    O(N*(LOG(N)*LOG(N)))
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
    O(1)
# Code
```cpp []
class Solution {
public:
    bool calc(long long mid,vector<int>& ranks, int cars)
    {
        int c=0;
        for(int i=0;i<ranks.size();i++)
        {
            long long x=mid/ranks[i];
            long long p=sqrt(x);
            c+=p;
            if(c>=cars)return true;
        }
        return false;
    }
    long long repairCars(vector<int>& ranks, int cars) {
        long long l=1,h=1e14,ans=0;;
        while(l<=h)
        {
            long long mid=(l+h)/2;
            bool a=calc(mid,ranks,cars);
            if(a==true)
            {
                ans=mid;
                h=mid-1;
            }
            else l=mid+1;
        }
        return ans;
    }
};
```
['Array', 'Binary Search', 'C++']