New game of Oz

Problem Name:
New game of Oz
Site:HackerEarth
Links:
Tags:
Problem setters: