Project Euler 324

http://projecteuler.net/index.php?section=problems&id=324

300着。