Tap here to switch tabs
Problem
Submissions

Problem: Sum of Floored Pairs

Try to solve the Sum of Floored Pairs problem.

Statement

Given an integer array nums, calculate the sum of ⌊\lfloornums[i] // nums[j]⌋\rfloor for all pairs of indices (i,j)(i, j) satisfying 0≤i,j<0 \leq i, j < nums.length.

Since the total sum may be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Sum of Floored Pairs

Try to solve the Sum of Floored Pairs problem.

Statement

Given an integer array nums, calculate the sum of ⌊\lfloornums[i] // nums[j]⌋\rfloor for all pairs of indices (i,j)(i, j) satisfying 0≤i,j<0 \leq i, j < nums.length.

Since the total sum may be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤105\leq 10^5