No Advanced DSA| Lower_Bound + Basic Maths
\n\n#define mod 1000000007\nclass Solution {\npublic:\n    int sumOfFlooredPairs(vector<int>& nums) {\n        \n        int n = nums.size();\n        unsigned 
\n```\n#define mod 1000000007\nclass Solution {\npublic:\n    int sumOfFlooredPairs(vector<int>& nums) {\n        \n        int n = nums.size();\n        unsigned long long int ans =0;\n        \n        sort(nums.begin(), nums.end());\n        \n        for(int i=0;i<n;++i){\n            int ind = 0;\n\t\t\t//k denotes the next multiple of nums[i] \n            for(unsigned long long int k = nums[i]; k <= nums[n-1]; k += nums[i]){\n                ind = lower_bound(nums.begin() + ind, nums.end(), k) - nums.begin();\n                // Add 1 for every value greater than or equal to k\n\t\t\t\tans = (ans + n - ind)%mod; \n\t\t\t\t//(n-ind) denotes the number of elements greater than equal to k\n            }\n        }\n        return ans;\n    }\n};\n```\n\n**Update:- The test cases have been updated and the code gives TLE for bigger test cases like [1,1,1,1,11,........,10^5]. Optimisations for the same are welcome, Thank you!**
['Math', 'Binary Tree', 'C++']