Need Help
How can I solve this problem using RMQ or LCA algorithm?
Codeforces Round 1123 Solution Discussion