sort and count values in range using binary search
\nfrom collections import Counter\nimport bisect\n\nclass Solution:\n    def sumOfFlooredPairs(self, nums: List[int]) -> int:\n        n = len(nums)\n        ct
```\nfrom collections import Counter\nimport bisect\n\nclass Solution:\n    def sumOfFlooredPairs(self, nums: List[int]) -> int:\n        n = len(nums)\n        ctr = Counter(nums)\n        nums.sort()\n        res = 0\n        for el in ctr:\n            mul = 1\n            while el * mul <= nums[-1]:\n                res += ctr[el] * (bisect.bisect_left(nums, el * (mul + 1)) - bisect.bisect_left(nums, el * mul)) * mul\n                mul += 1\n        return res % (10 ** 9 + 7)\n```
['Python']