[Solution] Maximise Set Bits CodeChef Solution | CodeChef Problem Solution 2022
Let denote the number of set bits in .
Given integers and , construct an array of length such that:
- for all ;
Over all such possible arrays, find the maximum value of .
Input Format
- The first line of input contains a single integer - the number of test cases. The description of test cases follow.
Solution Click Below:- CLICK HERE
- The only line of each test case contains integers and - the length of the array and sum of elements respectively.
Output Format
For each test case, output the maximum value of .
No comments:
Post a Comment