farmer's problem