Java|SimpleSolution:165ms|with|Explanation
\n\n/*\nHow did you solve it \n 1. its math solution , we bascailly count the quotient for each number \n \n example if we have 2,5,9 in input \n \n our range w
```\n\n/*\nHow did you solve it \n 1. its math solution , we bascailly count the quotient for each number \n \n example if we have 2,5,9 in input \n \n our range will be till 9\n \n    0 1 2 3 4 5 6 7 8 9 \n 2      1   1   1   1\n 5            1\n 9                    1\n -------------------------\n    0 0 1   2 3 4   5 6      \n\nonce we have this acculmutaed array which gives us count of quotient till one number , \nnow i loop over number and add the count on each number and return the sum \n\nexample in this example i will take  ( 1 from 2 position, 3 from 5 position , 6 from 9th position ), return 10 as result \n*/\n\n\nclass Solution {\n\tpublic int sumOfFlooredPairs(int[] nums) {\n\t\tlong mod = 1000000007;\n\t\tArrays.sort(nums);\n\t\tint max = nums[nums.length - 1];\n\t\tint[] counts = new int[max + 1];\n\t\tlong[] qnts = new long[max + 1];\n\t\tfor (int k : nums)\n\t\t\tcounts[k]++;\n\t\tfor (int i = 1; i < max + 1; i++) {\n\t\t\tif (counts[i] == 0)\n\t\t\t\tcontinue;\n\t\t\tint j = i;\n\t\t\twhile (j <= max) {\n\t\t\t\tqnts[j] += counts[i];\n\t\t\t\tj = j + i;\n\t\t\t}\n\t\t}\n\t\tfor (int i = 1; i < max + 1; i++)\n\t\t\tqnts[i] = (qnts[i] + qnts[i - 1]) % mod;\n\t\tlong sum = 0;\n\t\tfor (int k : nums)\n\t\t\tsum = (sum + qnts[k]) % mod;\n\t\treturn (int) sum;\n\t}\n}\n```
[]