from sys import stdin from collections import deque GI = lambda: int(input()) gi = lambda: list(map(int, input().split())) T = GI() def solve(id): M, R, N = gi() arr = gi() cur = pt = cnt = 0 while cur < M: best = -1 while pt < len(arr) and arr[pt] - R <= cur: best = pt pt += 1 if best == -1: return "IMPOSSIBLE" cnt += 1 cur = arr[best] + R return str(cnt) for i in range(1, T + 1): print("Case #%d: %s" % (i, solve(i))) exit(0)