icpc problem
https://codeforces.com/gym/100962/attachments Where can I find D's solution or can someone help me to solve it please