Doraemon and Nobita

0

0 votes
Easy
Problem

Doraemon and Nobita are playing a game in which they take turns eating dora cakes from piles of dora cakes. Initially there are N piles with d1,d2,d3....dN number of dora cakes. On each turn, either of them must eat at least one dora cake but no more than (1/3rd) of the number of dora cakes in that pile. Whoever can't eat any more dora cake loses. Assume that they play optimally. Nobita is said to have a winning move if after making that move,he can eventually win no matter what Doraemon does. Print who should start the game, so that Nobita wins.

INPUT:
The first line of input contains an integer T denoting number of testcases. Each testcase begins with an integer N, the number of piles of dora cakes. The next line contains N integers d1,d2,d3....dN, the number of dora cakes in each pile.

OUTPUT:
For each testcase print "DORAEMON"(without double-quotes) if Doraemon should start first else print "NOBITA"(without double-quotes) if Nobita should start first ,so that in each game Nobita wins.

CONSTRAINTS:
1 <= T <= 100
1 <= N <= 100
1 <= di <= 2*10^18 for (i=1,2,3....N)

Time Limit: 0.5
Memory Limit: 256
Source Limit:
Editor Image

?