JOKER1  Knifes Are Fun
"Do you know, why I use a knife? Guns are too quick. You can't savor all the little emotions. You see, in their last moments, people show you who they really are. So in a way, I know your friends better than you ever did. Would you like to know which of them were cowards?"
Joker has many knifes, and he wants to assign a distinct integer to each knife so he can easily identify them. The ith knife can have an integer between 1 and maxNumber[i], inclusive.
Return the number of ways he can assign numbers to his knifes, modulo 1,000,000,007. If it's impossible to assign distinct integers to the knifes, print 0.
Input
The first line contains the number of test cases T (1 <= T <= 666)
Each test case has 2 lines  1st line denotes number of knifes N (1 <= N <= 66) Joker has and the 2nd line denotes the numbers {maxNumber[0]....maxNumber[N1]} Joker has.
1 <= maxNumber[i] <= 3000
Output
Print the number of ways Joker can assign numbers to his knifes, modulo 1,000,000,007. If it's impossible to assign distinct integers to the knifes, print 0. In last line print the string "KILL BATMAN". Don't print any extra spaces.
Example
Input: 3 1 7 2 5 8 3 2 1 2 Output: 7 35 0 KILL BATMAN
Explanation
 Test case 1 : Joker can assign any number between 1 and 7, inclusive, to the only knife.
 Test case 2 : Joker wants you too think !
 Test case 3 : (1,1,1) (1,1,2) (2,1,1) (2,1,2) are the possible combinations . As the numbering of knifes is not unique so the output is 0.
hide comments
nadstratosfer:
20170919 06:35:43
A lot of smileys in the comments =) Indeed, it's one of these problems where you can't help but smile when you figure it out.. 

shubh_01:
20161025 15:15:54
Don't forget the knifes more than 66 condition.


dushyant_bgs:
20160619 15:56:22
Nice Problem..just keep in mind kill Batman!! Last edit: 20160619 15:56:47 

shubham:
20151031 18:46:51
careful...we have to print kill batman at last either it comes 0 or not..


dwij28:
20150827 21:05:13
Easy One but I did not read the statement carefully and did not modulo my answer . Cost me WA . I need to be more careful while reading problem statements . :/ 

r0bo_dart:
20150622 21:19:17
Very easy question. My O(nlogn) implementation got accepted.


:.Mohib.::
20150528 17:32:10
Easy... :) 

Gaurav sharma:
20150127 15:45:16
chup gauss Last edit: 20150127 20:42:32 

Daksh:
20141225 03:35:11
easy ... AC in first go :)


Shubham Mohanka:
20141016 20:50:41
any corner case?

Added by:  Rajarshi Sarkar 
Date:  20130223 
Time limit:  0.5s 
Source limit:  5000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 