🔥O(1) SC || ✅Easy & Clean Code✅ || 🌟Binary Search💯
Complexity\n- Time complexity:\nO(nlogn)\n\n- Space complexity:\nO(1)\n\n# Code\n## Please Upvote if u found my Solution useful\uD83E\uDD17\n\nclass Solution {\
# Complexity\n- Time complexity:\nO(nlogn)\n\n- Space complexity:\nO(1)\n\n# Code\n## Please Upvote if u found my Solution useful\uD83E\uDD17\n```\nclass Solution {\npublic:\n    int mod = 1e9 + 7;\n    int sumOfFlooredPairs(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        int n = nums.size(), i = 0;\n        long sum = 0;\n        while(i < n){\n            auto x = upper_bound(nums.begin(),nums.end(),nums[i]);\n            int j = x - nums.begin(), k = i, c = 2;\n            long tmp_sum = 0, duplicates = x - (nums.begin() + i);\n            i = j;\n            while(j < n){\n                int y = nums[k] * c;\n                int ind = upper_bound(nums.begin(),nums.end(),y - 1) - nums.begin();\n                tmp_sum = (tmp_sum + (ind - j) * (c - 1)) % mod;\n                j = ind;\n                c++;\n            }\n            tmp_sum = tmp_sum * duplicates + (duplicates * duplicates);\n            sum = (sum + tmp_sum) % mod;\n        }\n        return sum;\n    }\n};\n```
['Array', 'Math', 'Binary Search', 'C++']