Question: Find Subsets Arya has recently learned that Natural numbers are from 1 to N . Now since she is very curious she thought of a

Find Subsets
Arya has recently learned that Natural numbers are from 1 to N. Now since she is very curious she thought of a problem which she can't solve since she is just a little girl. The problem is obviously going to be easy as asked by a little girl. Now as you are very intelligent can you help the little girl? subset.
Since the answer could be very large print it modulo 109+7.
Note: In all the subsets the numbers are sorted.
Input format
The first line contains T, the number of test cases.
In each of the test case, the first line contains two space-separated integers N,Q.
In each of the Q query you are given two space-separated integers i, p
Output format
For each test case print the required answer modulo 109+7
Constraints
1T5
1N3000
1Q105
1i,pN
 Find Subsets Arya has recently learned that Natural numbers are from

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!