## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

# [Solution] LCM Sum (easy version) Codeforces Solution

E1. LCM Sum (easy version)
time limit per test
3.5 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

This version of the problem differs from the next one only in the constraint on

$t$. You can make hacks only if both versions of the problem are solved.

You are given two positive integers $l$ and $r$.

Count the number of distinct triplets of integers $\left(i,j,k\right)$ such that $l\le i and $\mathrm{lcm}\left(i,j,k\right)\ge i+j+k$.

Here $\mathrm{lcm}\left(i,j,k\right)$ denotes the least common multiple (LCM) of integers $i$$j$, and $k$.

Solution Click Below:-  👉
👇👇👇👇👇

Input

Each test contains multiple test cases. The first line contains the number of test cases $t$ ($\mathbf{1}\le \mathbf{t}\le \mathbf{5}$). Description of the test cases follows.

The only line for each test case contains two integers $l$ and $r$ ($1\le l\le r\le 2\cdot {10}^{5}$$l+2\le r$).

Output

For each test case print one integer — the number of suitable triplets.