How to solve [4674 — Post offices] [Live Archive] ?
Problem Link: Here
Any hints will be appreciated.
Codeforces Round 952 Solution Discussion