Some polish / optimization (16.2 p / 0.32 s on Kattis).