Divisors counting - MarisaOJ: Marisa Online Judge

Divisors counting

Time limit: 1000 ms
Memory limit: 256 MB
Let $f(x)$ be the number of positive divisors of an integer $x$. You are given $q$ queries, each of the form $(l, r)$. Calculate: $$f(l) + f(l + 1) + ... + f(r)$$ ### Input - The first line contains an integer $q$. - The next $q$ lines, each line contains 2 integers $l, r$, a query. ### Output - Print $q$ lines, the answers to $q$ queries. ### Constraints - $1 \le q \le 10^5$. - $1 \le l, r \le 10^6$. ### Example Input: ``` 1 1 4 ``` Output: ``` 8 ```