Book Worm

Limits: 1s, 256 MB

Sheldon is kind of a bookworm, literally. While reading a book, he eats the pages on which he saw something interesting. Recently he read a book which had pages numbered from ​ 1 to N. The first page had page numbers “1” on the front and “2” on the back. The next one had “3” on the front and “4” on the back. So on and so forth.


This is a companion discussion topic for the original entry at https://toph.co/p/book-worm