Easy Solution Implemented with more one language.
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# C++ Code\n```\nclass Solution {\npublic:\n    int BS(int t, vector<int>& p, long long success){\n        long long l = 0, r = p.size()-1, mid = -1;\n        while(l<=r){\n            mid = (l+r)/2;\n            if( (long long)t*p[mid] < success )\n                l = mid+1;\n            else\n                r = mid-1;\n        }\n        return l;\n    }\n    vector<int> successfulPairs(vector<int>& spells, vector<int>& potions, long long success) {\n        int n = spells.size(), p = potions.size(), temp;\n        vector<int> ans(n, 0);\n        sort(potions.begin(), potions.end());\n        for(int i=0; i<n; ++i){\n            temp = BS( spells[i] , potions, success );\n            ans[i] = (temp == p) ? 0 : p-temp;\n        }\n        return ans;\n    }\n};\n```\n# Java Code \n```\nclass Solution {\n    public int BS(int t, int[] p, long success){\n        int l = 0, r = p.length-1, mid;\n        while(l<=r){\n            mid = (l+r)/2;\n            if( (long)t*p[mid] < success )\n                l = mid+1;\n            else\n                r = mid-1;\n        }\n        return l;\n    }\n    public int[] successfulPairs(int[] spells, int[] potions, long success) {\n        int n = spells.length, p = potions.length, temp;\n        int[] ans = new int[n];\n        Arrays.sort(potions);\n        for(int i=0; i<n; ++i){\n            temp = BS(spells[i], potions, success);\n            ans[i] = (temp == p)? 0 : p - temp;\n        }\n        return ans;\n    }\n}\n```\n# JavaScript Code\n```\n/**\n * @param {number[]} spells\n * @param {number[]} potions\n * @param {number} success\n * @return {number[]}\n */\nconst BS = ( t, p, success)=>{\n    let l = 0, r = p.length-1, mid;\n    while(l<=r){\n        mid = parseInt( (l+r)/2 );\n        if( t*p[mid] < success ){\n            l = mid+1;\n        }else{\n            r = mid-1;\n        }\n    }\n    return l;\n}\n\nvar successfulPairs = function(spells, potions, success) {\n    let n = spells.length, p = potions.length, temp;\n    let ans = new Array(n);\n    potions.sort((a, b)=> a - b);\n    for(let i=0; i<n; ++i){\n        temp = BS( spells[i], potions, success);\n        console.log(temp);\n        ans[i] = (temp == p)? 0 : p-temp;\n    }\n    return ans;\n};\n```
['C++', 'Java', 'JavaScript']