[C++] | Prefix Sum
\nclass Solution {\npublic:\n    int sumOfFlooredPairs(vector<int>& nums) \n    {\n     long long mod = 1e9+7;\n     long long h[200002]={0};\n     int mx=INT_M
```\nclass Solution {\npublic:\n    int sumOfFlooredPairs(vector<int>& nums) \n    {\n     long long mod = 1e9+7;\n     long long h[200002]={0};\n     int mx=INT_MIN;\n     for(auto x: nums)\n     {\n         h[x]++;\n         mx=max(mx,x);\n     }\n     vector<int> pfx(2*mx+1,0);\n     for(int i=1;i<=2*mx;i++)\n     {\n         pfx[i]=pfx[i-1]+h[i];\n     }\n     sort(nums.begin(), nums.end());\n     long long s = 0;\n     for(int i=0;i<nums.size();i++)\n     {\n         int l=nums[i], r=2*nums[i]-1, fact=1;\n         while(l<=mx)\n         {\n             s=(s+fact*(pfx[r]-pfx[l-1]))%mod;\n             l=l+nums[i];\n             r=r+nums[i];\n             fact++;\n         }\n     }\n        return s;\n    }\n};\n```
['C', 'Sorting', 'Prefix Sum']