Square Counting

A simple polygon with vertices having integer coor- dinates is placed on a checker board. Determine the number of light and dark squares completely encom- passed by the polygon. Input The input will contain several test cases (at most 25). Each test case starts with an integer N, the number of vertices (3 ≤ N ≤ 100) of the polygon. Then N lines follow, each containing two integers x and y, describing the coordinates of the polygon vertices (0 ≤ x ≤ 10000,0 ≤ y ≤ 10000). The input ends with a case when N equals 0, which should not be processed. You can assume that the top left corner has coordinate (0,0). The picture above corresponds to the first sample input. Output For each test case, output a line containing two space separated integers, the number of light and dark squares completely encompassed by the polygon in descending order. Sample Input 11 21 64 10 1 15 3 13 8 15 11 99 11 5 7 11 17 48 4 00 01 11 10 0 Sample Output 27 25 10