Badawy's first words were "AND 0 SUM BIG", so he chose to take care of the accompanying issue. Given two integers n and k, count the number of varieties of length n with the end goal that: every one of its components are integers somewhere in the range of 0 and 2k−1 (comprehensive
Correct answer will be upvoted else downvoted. Computer science.
Child Badawy's first words were "AND 0 SUM BIG", so he chose to take care of the accompanying issue. Given two integers n and k, count the number of varieties of length n with the end goal that:
every one of its components are integers somewhere in the range of 0 and 2k−1 (comprehensive);
the bitwise AND of every one of its components is 0;
the amount of its components is just about as extensive as could be expected.
Since the appropriate response can be exceptionally enormous, print its remaining portion when isolated by 109+7.
Input
The principal line contains an integer t (1≤t≤10) — the number of experiments you wanted to settle.
Each experiment comprises of a line containing two integers n and k (1≤n≤105, 1≤k≤20).
Output
For each experiment, print the number of clusters fulfilling the conditions. Since the appropriate response can be exceptionally huge, print its leftover portion when isolated by 109+7.
Step by step
Solved in 3 steps with 1 images