Count once, then cut.
transcript
Five results. Two pages. Sizes must be as even as possible. How many on each page? Count once, then cut. Pages should be even.
A chain does not know its length. Walk it once and count. There are five nodes. Now the sizes are known. One walk gives the count.
Five divided by two is two. The remainder is one. One page gets one more. Sizes: three, two. Larger pages come first. Earlier pages are larger.
Page one: three nodes. Save the next node. Cut. Page two: two nodes. Each cut starts where one ended. Save the next node first.
Three results, five pages. Every page gets zero. The first three get one more. The last two are empty. Skip the cut for empty pages.
Count once, then cut. Base size plus one extra. Skip the empty pages. Empty pages are fine. Count, divide, cut. Full breakdown in the lecture.