Compute all squares at start once and for all (got 16561 in 10 minutes instead of 2 hours)
Score 16365 in about 30 minutes