p2586 solving