Solve UVa 10491 - Cows and Cars.