Sereja and ASum
All submissions for this problem are available.
Read problems statements in Mandarin Chinese and Russian.
Sereja have an array that consist of n integers a, a, ..., a[n]. Now Sereja want to delete some(possible none, but not all) elements from the array, such that arithmetical mean of all remaining numbers will as big as possible.
Help Sereja, find number of ways to delete numbers.
First line contain integer T - number of testcases. T tests follow. First line of each testcase contain integer n. Next line contain n integers a, a, ..., a[n].
For each testcase print the answer modulo 10^9+7.
Input: 2 1 1 4 1 2 1 2 Output: 1 3
Test #0-1(25 points) n ≤ 20
Test #2(25 points) n ≤ 1000
Test #3-4(50 points) n ≤ 100000
|Tags||cakewalk, implementation, ltime09, maths, sereja|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.