#!/usr/bin/env python3 '''Problem B: Cookie Clicker Alpha https://code.google.com/codejam/contest/2974486/dashboard#s=p1''' def solve(c, f, x): rate, total = 2.0, 0 m = x / rate while m <= x: total += (c / rate) rate += f t = total + (x / rate) if m < t: break else: m = t return m for x in range(int(input())): nums = input().split() ans = solve(float(nums[0]), float(nums[1]), float(nums[2])) print('Case #{}: {:.8f}'.format(x + 1, ans))