Project Euler 306 Paper-strip Game