D) Wacky and his weird games

Problem Name:
D) Wacky and his weird games
Site:HackerEarth
Links:
Tags:
Problem setters: