// 1/8/2010, finished on 3/12/2015
// 2007 World Finals Solution for Jacquard Circuits - Accepted on Live Archive

import java.io.*;
import java.util.*;

public class jacquard {

	private static class pt {

		public long x;
		public long y;

		public pt(long myx, long myy) {
			x = myx;
			y = myy;
		}

		public long latpts(pt other) {
			long dx = Math.abs(other.x - x);
			long dy = Math.abs(other.y - y);
			return gcd(dx, dy);
		}

		public static long gcd(long a, long b) {
			if (a == 0) return b;
			if (b == 0) return a;
			if (a == b) return a;
			if (a>b) return gcd(b, a%b);
			return gcd(a, b%a);
		}
	}

	public static long cross(pt p, pt q)
	{
		return p.x*q.y - p.y*q.x;
	}

	public static void main(String[] args) {

		Scanner fin = new Scanner(System.in);

		int N = fin.nextInt();
		int M = fin.nextInt();
		int caseNum = 1;

		// Go through each case.
		while (N!=0 || M !=0) {

			long firstx = fin.nextLong();
			long firsty = fin.nextLong();

			pt[] array = new pt[N+1];
			array[0] = new pt(0,0);
			for (int i=1; i<array.length-1; i++) {
				long newx = fin.nextLong() - firstx;
				long newy = fin.nextLong() - firsty;
				array[i] = new pt(newx,newy);
			}
			array[array.length-1] = new pt(0,0);

			// Set up our stack of points, to get rid of collinearity.
			Stack<pt> shrinkList = new Stack<pt>();
			shrinkList.push(array[0]);
			shrinkList.push(array[1]);
			pt curVect = new pt(array[1].x-array[0].x, array[1].y-array[0].y);

			// Loop through the rest.
			for (int i=2; i<array.length; i++) {

                // Get previous point.
                pt topPt = shrinkList.peek();
                pt nextVect = new pt(array[i].x-topPt.x, array[i].y-topPt.y);

                // Skip last point, if this forms a straight line.
                if (nextVect.x*curVect.y - nextVect.y*curVect.x == 0L) shrinkList.pop();

                // Set our current vector and then push this new point.
                curVect = new pt(array[i].x-shrinkList.peek().x, array[i].y-shrinkList.peek().y);
                shrinkList.push(array[i]);

			}

			// Copy values back into array w/o collinear points.
			array = new pt[shrinkList.size()];
			for (int i=array.length-1; i>=0; i--)
                array[i] = shrinkList.pop();

			// Divide by gcd.
			long gcdVal = 0;
			for (int i=0; i<array.length-1; i++) {
				long dx = Math.abs(array[i+1].x-array[i].x);
				long dy = Math.abs(array[i+1].y-array[i].y);
				if (i == 0)
					gcdVal = pt.gcd(dx,dy);
				else {
					long tmp = pt.gcd(dx, dy);
					gcdVal = pt.gcd(gcdVal,tmp);
				}
			}

			for (int i=0; i<array.length; i++) {
				array[i].x /= gcdVal;
				array[i].y /= gcdVal;
			}

            // Count lattice points on the boundary.
			long latticePoints = 0;
			for (int i=0; i<array.length-1; i++)
				latticePoints += array[i].latpts(array[i+1]);

            // Get the real area of the polygon, summing the appropriate cross products.
			long area = 0;
			for (int x=0;x+1<array.length;++x)
				area += cross(array[x], array[x+1]);
			area = Math.abs(area);

            // Set up variables for sum...
			long origarea = area;
			long origlat = latticePoints;
			long total = 0;

			// Use Pick's Theorem to add up the lattice points on each level.
			for (int level=1; level<=M; level++) {
				total = total + ((area+2-latticePoints)/2);
				area = origarea*(level+1)*(level+1);
				latticePoints = origlat*(level+1);
			}

            // Output the result.
			System.out.println("Case "+caseNum+": "+total);

            // Get next case.
			N = fin.nextInt();
			M = fin.nextInt();
			caseNum++;
		}
	}
}
