CF 348E - Pilgrims

Rating: 2800
Tags: dfs and similar, dp, trees
Solve time: 1m 32s
Verified: no

Solution

Problem Understanding

We are