Problem H. Eat Cards, Have Fun

HDU - 6339