Hi Everyone
I gave a contest in atcoder but i stuck in these question please help me to solve this question.
https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_e
https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_f
Thank you in advance