prefix sum for couting frequency otherwise brute force
\nclass Solution {\npublic:\n    int sumOfFlooredPairs(vector<int>& a) \n    {\n        int n=a.size();\n        int fre[200005]; memset(fre,0,sizeof(fre));\n  
```\nclass Solution {\npublic:\n    int sumOfFlooredPairs(vector<int>& a) \n    {\n        int n=a.size();\n        int fre[200005]; memset(fre,0,sizeof(fre));\n        map<int,int> mp;\n        for(int i=0;i<n;i++)\n            mp[a[i]]++,fre[a[i]]++;\n        for(int i=1;i<200005;i++)\n            fre[i]+=fre[i-1];\n        long long ans=0,mod=1e9+7;\n        for(auto i:mp)\n        {\n            long long cnt=0;\n            for(int j=2*i.first-1,div=1;j<200005;j+=i.first,div++)\n                cnt+=div*(fre[j]-fre[j-i.first]);\n            ans=(ans+cnt*i.second)%mod;\n        }\n        return ans;\n    }\n};\n```
['C', 'Prefix Sum', 'C++']