Usaco grid problems. That is, the farm is a tree.

Usaco grid problems. 1) and betsy (USACO 6.