All submissions for this problem are available.Walter wants to become a good person. He starts by solving this problem. But since he is unable to solve it, you have to help him. You are given an array $A$ of size $N$, you have to find the sum of positive 'good' numbers present in the array. $'good'$ numbers - Numbers which have at least 3 'safe' numbers greater than it present in the array. $'safe'$ numbers - Numbers which does not have their negative present in the array. Since the sum can be large, output sum modulo 1000000007 ($10^9 + 7$). ###Input: - The first line consists of an integer $N$. - The second line consists of N space-separated integers denoting A,A, ....... A[N]. ###Output: Output in a single line the required sum modulo 1000000007. ###Constraints - $1 \leq N \leq 10^5$ - $-10^6 \leq A[i] \leq 10^6$ ###Sample Input: ``` 6 -2 1 2 3 4 5 ``` ###Sample Output: ``` 3 ``` ###EXPLANATION: The required good numbers are 1 and 2. Hence the answer is 3.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, 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, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS|
Fetching successful submissions