IMPACT Olympiad for teachers and coaches 2022 Problem G
Can anyone solve this? Problem G
CF Edu Round 166 Solution Discussion
Codeforces Round 949 Solution Discussion