Bob farmer he large pasture sheep recently lose wolf attack he decide place shepherd dog way sheep protectedThe pasture rectangle consist RC cell each cell contain sheep wolf dog Sheep dog stay place wolf roam freely pasture repeatedly move leave right neighboring cell when wolf enter cell sheep consume however wolf enter cell doginitially dog Place dog pasture way wolf reach sheep determine impossible note dog need minimize number