Go Back
Zombie Mode (200)

There’s a new Special Game Mode in PUBG called the Zombie Mode.
In order to win the game, you’ll have to kill all the zombies or survive till the time is over.
There are two types of Zombies : Giant Zombies and Small Zombies.
Giant Zombies moves at a speed of 1 block per second & takes 8 bullets to be killed.
Small Zombies moves at a speed of 2 blocks per second & takes 4 bullets to be killed.
You have N bullets at the start and you have to survive for M seconds to win the game. You can fire 4 bullets per second.
There are G no. of Giant Zombies and S no. of Small Zombies which are moving towards you at their respective speeds. Distances of all the Zombies from you is given. If they touch you then GAME OVER.


The first line of the input consists of a single integer T denoting the number of test cases.
Each test case contains 4 lines which are as follows :
The first line consists of two integers N and M respectively.
The second line contains of two integers G and S respectively.
The third line consists of G space-separated integers denoting distance of each Giant Zombie from you.
The fourth line consists of S space-separated integers denoting distance of each Small Zombie from you.


For each test case print a single line containing “WINNER WINNER CHICKEN DINNER” without the quotes if you win else print “GAME OVER” without the quotes.


1 <= T <= 100
1 <= N <= 10^6
1 <= M,G,S <= 10^4
1 <= G[i],S[i] <= 10^5

Copy Input

50 10
3 4
8 10 9
2 15 12 9
35 10
3 4
5 7 9
4 16 2 20
50 10
3 4
6 2 10
10 20 5 16



In Test Case 1: There are enough bullets to kill all the zombies and all the zombies can be killed before any zombie touches you.
In Test Case 2: There are not enough bullets to kill all the zombies.
In Test Case 3: There are enough bullets. But as you’ll first kill the Giant Zombie at distance 2 the Small Zombie with distance 5 will come at distance of 1 block and there’ll not be enough time for you to kill him before he touches you. If you try to kill the Small Zombie at distance 5 first, the Giant Zombie at distance 2 will kill you.

Single Round Match #09
3 hour contest


Problem Tags
adhoc, math

Supported by our Coding Partner