link to the problem:-https://mirror.codeforces.com/contest/508/problem/C
please explain the logic behind this problem.
logic behind this problem anya and the ghosts
link to the problem:-https://mirror.codeforces.com/contest/508/problem/C
please explain the logic behind this problem.