T = int(input()) for case in range(1, T+1): N, M, K = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) # Compute the maximum distance between all points in A and B max_distance = 0 for a in A: for b in B: distance = abs(a-b) if distance > max_distance: max_distance = distance # Compute the minimum time for the fastest horse to travel the max distance min_time = float('inf') for c in C: time = max_distance / c if time < min_time: min_time = time # Compute the optimal speed for each horse to minimize the total time speeds = [0] * K for i in range(K): speed = C[i] * min_time if A[0] <= B[0]: # Horses should run from left to right if speed <= A[-1]: speeds[i] = speed else: speeds[i] = B[0] + (max_distance - B[0] + A[-1]) / 2 else: # Horses should run from right to left if speed <= B[-1]: speeds[i] = speed else: speeds[i] = A[0] + (max_distance - A[0] + B[-1]) / 2 # Print the result speeds_str = " ".join([f"{speed:.9f}" for speed in speeds]) print(f"Case #{case}: {speeds_str}")