[Solution] Chef And Array Construction CodeChef Solution
Problem
Given two positive integers and , let denote the set of all the arrays of size such that each element of the array lies in the range . Since there are such arrays, the size of is .
Let denote the bitwise AND of all elements of the array in the set, where .
Find the value . Since the answer can be huge, output the answer modulo .
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- The first and only line of each test case contains two integers and , the size of the array, and the maximum limit of elements.
Output Format
For each test case, print the value . Since the answer can be huge, output the answer modulo .
👇👇👇👇👇
Explanation:
Test case : The set contains . The array . Thus, sum of all elements of is .
Test case : The set contains . The array . Thus, sum of all elements of is .
No comments:
Post a Comment