for _ in range(int(input())): H, n = map(int, input().split()) print('%.2f' % (H * 2 * (1 - 0.5 ** (n - 1)) + H))