Arya and the Grid of Stars (ALKH2019)

please someone tell me how this problem can be solved

ref :- Invitation to Alkhwarizm — 2019 by IIIT Allahabad - Codeforces
it has the hints you need

1 Like