Walking Down The Road
Need help in this problem. What is the formula? Thanks in Advance.
Codeforces Round 1137 Solution Discussion