B - ケーキの切り分け2 (Cake 2)

Time Limit: 2 sec / Memory Limit: 512 MB