usaco; solve "Barn Repair" from Chapter 1, Section 3