Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use DP.
<code>dp[i][j]</code> is the maximum score that you can achieve in your last <code>i</code> actions by starting from city <code>j</code>.
Solve with full IDE support and test cases