ACM vs Non-ACM
BIT Mesra is a place which is never short of exciting activities going around in the campus.
Recently a huge fight has been going on between the ACM and the NON ACM Members. But don't worry , this fight is not physical in nature. Infact in this fight the two groups want to establish their intellectual superiority over each other. However, the VC got really worried with the development of events and wants to resolve this issue once and forever.
VC first selects one representative from both the groups and makes them play a game. The group whose member will win the game will be accepted as the intellectually superior group. The rules of the game are given below.
There are N stones in a row, all of which are black except for the M-th one, which is white (all indexes in this probem begin from 1). The players alternate turns, and ACM representative plays first. On each turn, a player must choose exactly K consecutive stones, one of which must be white, and reverse their order. The winner is the first player who puts
the white stone in the L-th position. Print ACM if ACM representative can win regardless of how NON ACM representative plays, and print NONACM if NON ACM representative can win regardless of ACM representative's strategy. Otherwise, return DRAW since neither player can win if both players play optimally.
The first line of input contains an integer t<=200, the number of test cases. Then t test
cases follow each containing a line with 4 integers N M K L.
M and L are different
A single line for each test case (ACM/NONACM/DRAW)
2 1 2 2
3 1 1 2
5 5 2 3
Problem Setter: Md Taha Bin Jawaid (TBJ)