Python - 8 lines frequency prefix sum
\nclass Solution:\n    def sumOfFlooredPairs(self, nums: List[int]) -> int:\n        ans, hi, n, c = 0, max(nums)+1, len(nums), Counter(nums)\n        pre = [0]
```\nclass Solution:\n    def sumOfFlooredPairs(self, nums: List[int]) -> int:\n        ans, hi, n, c = 0, max(nums)+1, len(nums), Counter(nums)\n        pre = [0] * hi\n        for i in range(1, hi):\n            pre[i] = pre[i-1] + c[i]\n        for num in set(nums):\n            for i in range(num, hi, num):\n                ans += c[num] * (pre[-1] - pre[i-1])\n        return ans % (10**9 + 7)\n```
['Python', 'Python3']