Project Euler 701

103着。
Problem 678以来の自作問題です。
解くだけなら簡単です。
ただ、10秒程度にするのは面倒。

projecteuler.net