Atcoder Beginner Contest 210 d solution needed according to tutorial Idea
Problem link: https://atcoder.jp/contests/abc210/tasks/abc210_d Code needed on the basis of tutorial Idea