Arya and the Grid of Stars (ALKH2019)


#1

https://www.codechef.com/ALKH2019/problems/ARYGRD
please someone tell me how this problem can be solved


#2

ref :- https://codeforces.com/blog/entry/66412?locale=en
it has the hints you need