Dynamic Programming with Path Restoring (DP with Path Restoring) - Preparation to IOI Part 2