C++ || Sort and Lower Bound
Code\n\nclass Solution {\npublic:\n    vector<int> successfulPairs(vector<int>& s, vector<int>& p, long long success) {\n        int n = s.size(), m = p.size();
# Code\n```\nclass Solution {\npublic:\n    vector<int> successfulPairs(vector<int>& s, vector<int>& p, long long success) {\n        int n = s.size(), m = p.size();\n        sort(p.begin(), p.end());\n        vector<int> res(n);\n        for (int i = 0; i < n; i += 1) {\n            long long x = (success + s[i] - 1) / s[i];\n            if (x > p.back()) continue;\n            auto it = lower_bound(p.begin(), p.end(), (int)x);\n            res[i] = m - (it - p.begin());\n        }\n        return res;\n    }\n};\n```
['C++']