#C11985. Total Life-Force Extension

    ID: 41361 Type: Default 1000ms 256MiB

Total Life-Force Extension

Total Life-Force Extension

This problem requires you to compute the total life-force extension achieved by casting a magical spell consecutively. With each subsequent cast, the spell's effectiveness is reduced by half.

Given two integers \( N \) and \( X \), where \( N \) is the number of times the spell is cast consecutively and \( X \) is the initial life-force extension (in hours), the total extension is computed as follows:

\( total = X + \frac{X}{2} + \frac{X}{2^2} + \dots + \frac{X}{2^{N-1}} \)

Return the integer part of the sum as the final result.

inputFormat

The input begins with an integer \( T \) representing the number of test cases. Each of the following \( T \) lines contains two space-separated integers \( N \) and \( X \), where \( N \) is the number of consecutive casts and \( X \) is the initial life-force extension.

outputFormat

For each test case, output a single line containing the total life-force extension (as an integer).

## sample
1
1 100
100

</p>