Little Sub and Heltion's Math Problem

ZOJ - 4084