ACed sec 1.3 Barn Repair
using greedy