C++ || Sieve || prefix sum || easy Swap27 solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n-sieve\n-prefix sum\n Describe your approach to solving the problem. \n\n
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n-sieve\n-prefix sum\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:n*log(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:n\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int sumOfFlooredPairs(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        int n=nums.size();\n        vector<int>arr(200005,0);\n        map<int,int>mp;\n        for(auto it:nums){\n            arr[it]++;\n            mp[it]++;\n        }\n        for(int i=1;i<200005;i++)arr[i]+=arr[i-1];\n        long long ans=0;\n        for(auto it:mp){\n            int j=1;\n            long long sum=0;\n            for(int i=it.first+it.first;i<200005;i+=it.first){\n                sum+=(arr[i-1]-arr[i-it.first-1])*j;\n                sum%=1000000007;\n                j++;\n            }\n            ans+=(sum*it.second);\n            ans%=1000000007;\n        }\n        return ans;\n    }\n};\n```
['C++']