Problem Statement

Given:

Positions of stalls

k cows

Place the cows in stalls such that: