Project euler 393 problem