Oz and his game-board

Problem Name:
Oz and his game-board
Site:HackerEarth
Links:
Tags:
Problem setters: