Arranging The Sheep

Problem Name:
Arranging The Sheep
Site:CodeForces
Links:
Tags:
Problem setters:
Login to view your/friends' submissions
Login to suggest tags