# This does not check positions of cars; need another program for that # Two positive integers bounded by 250: INT(1,250,m) SPACE INT(1,250,n) NEWLINE SET(onecount=0,twocount=0) REPI(i,m) REPI(j,n, SPACE) # this means space-separated items, but not trailing INT(-2,2^31-1,x) # any non-negative integer value (32-bit) SET(grid[i,j] = x) IF (x == -1) SET(onecount=onecount+1) ELSE IF(x == -2) SET(twocount=twocount+1) END END END NEWLINE END # Make sure there are an even number of filled slots since each car uses 2: SET(k = m*n - onecount - twocount) ASSERT(k % 2 == 0) # Exactly one empty space: ASSERT(onecount == 1) # Row, col of goal cell must be within the bounds: INT(1,m,x) SPACE INT(1,n,y) NEWLINE # Goal cell should not be empty or blocked: ASSERT(grid[x-1,y-1] != -1) ASSERT(grid[x-1,y-1] != -2)