Easy C++ solution || commented
\nclass Solution {\npublic:\n    #define ll long long\n    #define MOD 1000000007;\n    int sumOfFlooredPairs(vector<int>& nums) {\n        ll ans=0;\n        l
```\nclass Solution {\npublic:\n    #define ll long long\n    #define MOD 1000000007;\n    int sumOfFlooredPairs(vector<int>& nums) {\n        ll ans=0;\n        long long last=1e5;\n        //store the frequencies as a prefix sum\n        vector<ll> pref(1e5+1,0);\n        for(int i=0;i<nums.size();i++)\n            pref[nums[i]]++;\n        for(int i=1;i<=1e5;i++)\n            pref[i]+=pref[i-1];\n        \n        //now for every num in [1,1e5] calculate its value towards the sum\n        for(ll i=1;i<=1e5;i++)\n        {\n            if(pref[i]-pref[i-1])\n            {\n                ll curr=0;\n                //if this has a count in nums\n                for(ll j=1;i*j<=last;j++)\n                {\n                    ll p=i*j;\n                    ll q=min(i*(j+1) -1,last);\n                    ll cnt=pref[q]-pref[p-1];\n                    curr+=(cnt*j);\n                    curr%=MOD;\n                }\n                ll cnt=pref[i]-pref[i-1];\n                ans+=(curr*cnt);\n                ans%=MOD;\n            }\n        }\n        return (int)ans;\n    }\n};\n```
[]