C++ Solution using Lower bound + Optimization
```\nint sumOfFlooredPairs(vector& nums) {\n        long long ans=0,mod=1000000007,p=0;\n        sort(nums.begin(),nums.end());\n        int n=nums.size();\n   
```\nint sumOfFlooredPairs(vector<int>& nums) {\n        long long ans=0,mod=1000000007,p=0;\n        sort(nums.begin(),nums.end());\n        int n=nums.size();\n        for(int i=0;i<n;i++)\n        {\n            if(i>0 && nums[i]==nums[i-1])\n            {\n                ans=(ans+p)%mod;\n                continue;\n            }\n            int k=1;\n            p=0;\n            while(nums[i]*k<=nums[n-1])\n            {\n                int l=lower_bound(nums.begin()+i,nums.end(),nums[i]*k)-nums.begin();\n                int r=lower_bound(nums.begin()+l,nums.end(),nums[i]*(k+1))-nums.begin();\n                p=(p+ (long long) k*(r-l) )%mod;\n                if(r==n)\n                    break;\n                k=nums[r]/nums[i];\n            }\n            ans=(ans+p)%mod;\n        }\n        return ans;\n    }
[]