Counting I guesssss
Complexity\n- Time complexity:\n Add your time complexity here, e.g. O(n) \nO(n + max_num * log(max_num))\n- Space complexity:\n Add your space complexity here,
# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(n + max_num * log(max_num))$$\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(maxnum)$$\n# Code\n```\nclass Solution:\n    def sumOfFlooredPairs(self, nums: List[int]) -> int:\n        MOD = 10**9 + 7\n        max_num = max(nums)\n        freq = [0] * (max_num + 1)\n\n        # Count the occurrences of each number\n        for num in nums:\n            freq[num] += 1\n\n        # Calculate prefix sum of frequencies\n        prefix_sum = [0] * (max_num + 1)\n        for i in range(1, max_num + 1):\n            prefix_sum[i] = prefix_sum[i-1] + freq[i]\n\n        result = 0\n\n        # Calculate the sum of floor divisions\n        for i in range(1, max_num + 1):\n            if freq[i] == 0:\n                continue\n\n            # Iterate over all multiples of i\n            for j in range(i, max_num + 1, i):\n                result += (prefix_sum[min(j + i - 1, max_num)] - prefix_sum[j-1]) * (j // i) * freq[i]\n                result %= MOD\n\n        return result\n\n```
['Python3']