truly loves arrangements of positive integers, in this way his instructor (Yeltsa Kcir) gave him an issue about a grouping that comprises of just extraordinary numbers. We should call a positive number uncommon on the off chance that it very well may be composed as an amount of various
Correct and detailed answer will upvoted else downvote.
Theofanis truly loves arrangements of positive integers, in this way his instructor (Yeltsa Kcir) gave him an issue about a grouping that comprises of just extraordinary numbers.
We should call a positive number uncommon on the off chance that it very well may be composed as an amount of various non-negative forces of n. For instance, for n=4 number 17 is uncommon, in light of the fact that it tends to be composed as 40+42=1+16=17, yet 9 isn't. Theofanis requests that you assist him with tracking down the k-th exceptional number in case they are arranged in expanding request. Since this number might be too huge, output it modulo 109+7.
Input :The primary line contains a solitary integer t (1≤t≤104) — the number of experiments. The solitary line of each experiment contains two integers n and k (2≤n≤109; 1≤k≤109).
Output :For each experiment, print one integer — the k-th exceptional number in expanding request modulo 109+7.
Step by step
Solved in 4 steps with 1 images