#P1992G. Ultra-Meow
Ultra-Meow
Description
K1o0n gave you an array of length , consisting of numbers . Accept it? Of course! But what to do with it? Of course, calculate .
Let be the -th positive (strictly greater than zero) integer in ascending order that is not present in the set . Denote as the sum of , over all distinct subsets of the array .
Examples of values for sets:
- , because is the first positive integer not present in the set;
- , because the first two positive integers not present in the set are and ;
- , because there are no numbers in the empty set, so the first positive integers not present in it are .
The first line contains a single integer () — the number of test cases.
In a single line of each test case, an integer () is entered, the size of the array of gifted numbers.
It is guaranteed that the sum of over all test cases does not exceed .
For each test case, output a single number — . Since it may be very large, output it modulo .
Input
The first line contains a single integer () — the number of test cases.
In a single line of each test case, an integer () is entered, the size of the array of gifted numbers.
It is guaranteed that the sum of over all test cases does not exceed .
Output
For each test case, output a single number — . Since it may be very large, output it modulo .