What to do next ?

0

0 votes
Easy
Problem

Having done the easiest problem of the CFRESH Prelims you must be wondering which problem to do next.

So here comes a problem for you to solve

Lets define a function f(m) as f(m)=1Σm * 2Σ(m-1) * 3Σ(m-2)...... * mΣ1 . Lets define another function F(m) as F(m)=f(m)f(m) . Lets define another function G(l,r) as G(l,r)=F(l) * F(l+1) * F(l+2) * .... * F(r-1) * F(r).

NOTE: Σk is defined as sum of first k natural numbers.

INPUT
First line of input contains T no of test cases
Each of the next t lines contain two integers l and r

OUTPUT
You need to output the value of G(l,r)%1000000007 for each test case in a separate line.

CONSTRAINTS
1<=T<=100000
1<=l<=100000
1<=r<=100000
It is guaranteed that l<=r.

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?