C++ || EASY TO UNDERSTAND || Ultimate Binary Search Solution
\n#define ll long long int\n#define ld long double\nclass Solution {\npublic:\n    vector<int> successfulPairs(vector<int>& spells, vector<int>& p, long long su
```\n#define ll long long int\n#define ld long double\nclass Solution {\npublic:\n    vector<int> successfulPairs(vector<int>& spells, vector<int>& p, long long success) {\n        sort(p.begin(),p.end());\n        ll n=p.size();\n\n        vector<int> ans;\n        for(int x:spells)\n        {\n            ll up=ceil((success)/(1.0*x));\n            ll idx=lower_bound(p.begin(),p.end(),up)-p.begin();\n            if(idx==n)\n            {\n                ans.push_back(0);\n            }\n            else\n            ans.push_back(n-idx);\n        }\n        return ans;\n    }\n};\n```\n**Please upvote to motivate me in my quest of documenting all leetcode solutions(to help the community). HAPPY CODING:)\nAny suggestions and improvements are always welcome**
[]