Expand the pond problem


My code is not passing all the test cases. It’s showing TLE. How to optimise ?

hello @nayakashutosh99
ur code is correct and working fine.
submit here -> https://csacademy.com/contest/archive/task/black-shapes/statement/

But why it’s giving tle here?

Students have got 100 points

i have tried submitting editorial solution even that is showing tle.
some issue is there with checker.

Okay thank you very much!!!