Data analysts at Amazon are analyzing time-series data. It was concluded that the data of the n
th item was dependent on the data of some x
th day if there is a positive integer k
such that floor(n / k) = x
where floor()
represents the largest integer less than or equal to z
.
Given n
, find the sum of all the days' numbers on which the data of the x
th (0 β€ x
< n
) will be dependent.
Function Description
Complete the function getDataDependenceSum
in the editor below.
getDataDependenceSum
takes the following arguments:
long int n
: the day to analyze the data dependency for
Returns
long int
: the sum of days on which the data is dependent
Input Format For Custom Testing
The first line contains a long integer, n
.
π·, As always, a supa huge TY to tomtom, spike and aikay! You three da best 4ever!! π‘ π‘ π‘
Example 1:
Input: n = 13
Output: 29
Explanation:The data of then = 13
th day is dependent on[0, 1, 2, 3, 4, 6, 13]
obtained fork = [14, 13, 6, 4, 3, 2, 1]
.
Example 2:
Input: n = 1
Output: 1
Explanation:The only dependency is1
.
Example 3:
Input: n = 5
Output: 8
Explanation:Hence, the answer is 0 + 1 + 2 + 5 == 8 :)
n
β€ 10^10
input:
output: