Straightforward cpp solution :)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int minimumTime(vector<int>& nums1, vector<int>& nums2, int x) \n    {\n        int n = nums1.size();\n        vector<int> indices(n);\n        int s = 0;\n        int d = 0;\n        for(int i=0; i<n; i++)\n        {\n            indices[i] = i;\n            s += nums1[i];\n            d += nums2[i];\n        }\n        if(s<=x)\n        {\n            return 0;\n        }\n        sort(indices.begin() , indices.end() , [&](const int a , const int b)\n        {\n            return nums2[a]<nums2[b];\n        });\n        vector<int> dp(n+1);\n        int r = n+1;\n        for(int i=1; i<=n; i++)\n        {\n            for(int j=i; j>0; j--)\n            {\n                dp[j] = max(dp[j] , dp[j-1]+nums2[indices[i-1]]*j + nums1[indices[i-1]]);\n            }\n        }\n        for(int t=0; t<=n; t++)\n        {\n            if(s + d*t - dp[t] <=x)\n            {\n                return t;\n            }\n        }\n    return -1;\n    }\n};\n```
['C++']