t = int(input())
for i in range(t):
    [p, q] = [int(x) for x in input().split()]
    print((n + q + 1) * q / (q + 1))

f576265d5422f4516ff8acf9a94fdfa346983f26
<mask token>

<mask token>
for i in range(t):
    [p, q] = [int(x) for x in input().split()]
    print((n + q + 1) * q / (q + 1))

t = int(input())
for i in range(t):
    [p, q] = [int(x) for x in input().split()]
    print((n + q + 1) * q / (q + 1))
