C++
\nusing LL = long long ;\nclass Solution {\n    int maxN = 1e5 ;\n    int M = 1e9 + 7 ;\npublic:\n    int sumOfFlooredPairs(vector<int>& nums) {\n        int n 
```\nusing LL = long long ;\nclass Solution {\n    int maxN = 1e5 ;\n    int M = 1e9 + 7 ;\npublic:\n    int sumOfFlooredPairs(vector<int>& nums) {\n        int n = nums.size() ;\n        vector<int>count(maxN + 1) ;\n        vector<LL>presum(maxN + 1) ;\n        for(auto& x : nums)\n            count[x]++ ;\n        for(int i = 1; i <= maxN; i++)\n            presum[i] = presum[i-1] + count[i] ;\n        \n        LL ret = 0 ;\n        unordered_set<int>visited ;\n        for(auto& x : nums){\n            if(visited.count(x))\n                continue ;\n            visited.insert(x) ;\n            LL ans = 0 ;\n            int  k = 0;\n            for(k = 1; x*k+x-1 <= maxN; k++){\n                ans = ans + (presum[x*k+x-1] - presum[x*k-1])*k%M ;\n                ans %= M ;\n            }\n            if(x*k-1<=maxN){\n                ans = ans + (presum[maxN] - presum[x*k-1])*k % M ;\n                ans %= M ;\n            }\n            ret = ret + ans * count[x] % M ;\n            ret %= M ;\n        }\n        return ret ;\n    }\n};\n```
[]