static int countDivisibles(int a, int b, int k)
return (b / k) - (a / k) + 1;
return (b / k) - (a / k);
public static void Main()
t = Int32.Parse(Console.ReadLine());
for (int i = 0; i < t; i++)
a = Int32.Parse(Console.ReadLine());
b = Int32.Parse(Console.ReadLine());
k = Int32.Parse(Console.ReadLine());
r = countDivisibles(a, b, k);
Console.WriteLine("CASE " + (i + 1) + ": " + r);