spoj#FLOWERS2. Flowers Placement

Flowers Placement

Please click here to download a PDF version of the contest problems. The problem is problem F in the PDF.