[Question]
  [
We define the *hyper-average* of an array / list (of numbers) the arithmetic mean of the sums of its prefixes.
For example, the hyper-average of the list `[1, 4, -3, 10]` is computed in the following manner:
* We get the prefixes: `[1], [1, 4], [1, 4, -3], [1, 4, -3, 10]`.
* Sum each: `[1, 5, 2, 12]`.
* And now get the arithmetic mean of the elements in this list: `(1 + 5 + 2 + 12) / 4 = 5`.
A *pseudo-element* of an array is an element whose value is *strictly* lower than its hyper-average. Hence, the pseudo-elements of our example list are `1`, `4` and `-3`.
---
Given a list of floating-point numbers, your task is to return the list of pseudo-elements. 
* You don't have to worry about floating-point inaccuracies.
* The input list will never be empty and it may contain both integers and floats. If mentioned, integers may be taken as floats (with `<integer>.0`)
* You may assume that the numbers fit your language of choice, but please do not abuse that in any way.
* Optionally, you may take the length of the array as input as well.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so standard rules for the tag apply. The shortest code in bytes (**in each language**) wins!
---
# Test Cases
```
Input -> Output
[10.3] -> []
[5.4, 5.9] -> [5.4, 5.9]
[1, 4, -3, 10] -> [1, 4, -3]
[-300, -20.9, 1000] -> [-300, -20.9]
[3.3, 3.3, 3.3, 3.3] -> [3.3, 3.3, 3.3, 3.3]
[-289.93, 912.3, -819.39, 1000] -> [-289.93, -819.39]
```
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~9~~ 8 bytes
-1 bytes thanks to [Magic Octopus Urn](https://codegolf.stackexchange.com/users/59376/magic-octopus-urn)
```
ηOO¹g/‹Ï
```
[Try it online!](https://tio.run/##MzBNTDJM/f//3HZ//0M70/UfNew83P//f7SukYWlnqWxjoKloZEekNK1MLTUM7bUUTA0MDCIBQA)
```
η        # Get prefixes
 O       # Sum each
  O¹g/   # Get the mean ( length(prefix list) equals length(original list) )
      ‹Ï # Keep only the value that are less than the mean
```
---
# [05AB1E](https://github.com/Adriandmen/05AB1E), 6 bytes
Using the new `ÅA` command.
```
ηOÅA‹Ï
```
[Try it online!](https://tio.run/##MzBNTDJM/f//3Hb/w62Ojxp2Hu7//z9a18jCUs/SWEfB0tBID0jpWhha6hlb6igYGhgYxAIA "05AB1E – Try It Online")
```
η      # Get prefixes
 O     # Sum each
  ÅA   # Get the mean
    ‹Ï #  Keep only the value that are less than the mean
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), 8 bytes
```
ttYsYm<)
```
[Try it online!](https://tio.run/##y00syfn/v6Qksjgy10bz//9oQx0FEx0FXWMdBUODWAA "MATL – Try It Online") Or [verify all test cases](https://tio.run/##VYsxCoAwDEV3T9FNhCYkjYIBR4/gYCmC7nay96/p4OAS/nv/J1/lrmctJT4xL0PtAfp93WpiQjm6NOHo3YRqkb2zDOIdkyEIkWEg1GaoOUFrf6cNw6yohsqhWZhZUb6nFw).
### Explanation
```
tt    % Implicitly input array. Duplicate twice
Ys    % Cumulative sum
Ym    % Arithmetic mean
<     % Less than? (element-wise). Gives an array containing true / false
)     % Reference indexing : use that array as a mask to select entries 
      % from the input. Implicitly display
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt/) v2.0a0 [`-f`](https://codegolf.meta.stackexchange.com/a/14339/), ~~12~~ ~~11~~ ~~10~~ 9 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
<Wå+ x÷Wl
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=2.0a0&flags=LWY&code=PFflKyB491ds&input=WzEsIDQsIC0zLCAxMF0)
-1 byte thanks to [ETH](https://codegolf.stackexchange.com/users/42545/ethproductions) pointing out a redundant character.
```
<Wå+ x÷Wl     :Implicit filter of each element in input array W
<             :Is less than
 Wå+          :  Cumulatively reduce W by addition
     x        :  Reduce by addition
      ÷Wl     :  Divide by length of W
```
[Answer]
# [Python 3](https://docs.python.org/3/) with [Numpy](http://www.numpy.org/), 48 bytes
```
lambda x:x[x<mean(cumsum(x))]
from numpy import*
```
Input and output are Numpy arrays. [Try it online!](https://tio.run/##VYvLCsMgEEX3@YpZajGisYEa2i@xWdiHNFAfWAPm660GuuhmuOfcO2FLL@9EMZdreWt7e2jIU1b5bJ/aoftqP6tFGeO5M9FbcKsNGyw2@JgOxfgICRYHSnFGxUxAjfRIYKSyZU6gQi8IcNa4F4xVHhiVTbFdClr7v7NPh5OksrLkQ9P9iUsqfm/z1EGIi0vIIB2j3lDCGJfuCw "Python 3 – Try It Online")
[Answer]
## Haskell, 39 bytes
```
f l=filter(<sum(scanl1(+)l)/sum(1<$l))l
```
[Try it online!](https://tio.run/##ZYzBDoIwEETvfsUeOLSRrt1WEprAlxgPRGlsXKoB/P5aDh4sl0lm3sw8huU5MqfkgXsfeB1n0S2fSSy3ITKJo2R52jx1FUvJaRpChB7urwMAvOcQV6jAw4U02muRNXiuoUFX5lRDBsrWQLpkymqdmdHoNqx3BYt59ye7C9M6dJk5MltFteTQ/u7SFw "Haskell – Try It Online")
Unfortunately `length` is of type `Int`, so I cannot use it with floating point division `/` and I have to use a workaround: `sum(1<$l)`. 
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~10~~ 9 bytes
Thanks @Zgarb for golfing off 1 byte!
```
f</L⁰Σ∫⁰⁰
```
[Try it online!](https://tio.run/##yygtzv7/P81G3@dR44Zzix91rAbSQPT///9oXSMLSz1LYx1LQyM9Yx1dC0NLPWNLHUMDA4NYAA "Husk – Try It Online")
### Ungolfed/Explanation
```
           -- argument is ⁰ (list) 
f       ⁰  -- filter the original list with
 <         --   element strictly smaller than
     Σ∫⁰   --   sum of all prefixes
  /L⁰      --   averaged out
```
[Answer]
# Java 8, 81 bytes
This lambda expression accepts a `List<Float>` and mutates it. The input list's iterator must support removal (`ArrayList`'s does, for example). Assign to `Consumer<List<Float>>`.
```
a->{float l=0,t=0,u;for(float n:a)t+=n*(a.size()-l++);u=t/l;a.removeIf(n->n>=u);}
```
## Ungolfed lambda
```
a -> {
    float l = 0, t = 0, u;
    for (float n : a)
        t += n * (a.size() - l++);
    u = t / l;
    a.removeIf(n -> n >= u);
}
```
[Try It Online](https://tio.run/##fZJNa@MwEIbPzq/QUd7Eqh23UNe1YSm7UOhCocfSw9SRg1JZCtYoSzf4t2fHcUpK3EYgHeZ95lOzgg1Edi3NavG2W/tXrSpWaXCO/QFl2HYSrFu1AZTMISCJK3IQHpUWtTcVKmvEnTXON7K9PWoPyuHtb20By5ItJT466Rf2l5aNNOhYsYOo3Na9znQRz5Cuz2vb8sFmbiDEaWF@cBBO/ZM8jPR0Gua@wAudg2hlYzfyvuYmKk1Z@DDvdkE@oWKHDg61bqxasIb64E/YKrN8fmHQLl1IbbGTs6/1@YWICpykCpmRfz9Zxx4fZ5vEIq272ffAlbisZ@xKZGephJiei1J6kvgsG6Vx3KPzmIL2dHyeT0Uf9PQ9m2GeXYusJ7NkvveIrpNMpMd0I98uH5noRxk/DJHBHU2W3QwD7v8gCIIvN4bR4g3zP8o/2xbePzH8RHICXC/zfZYwzL9tbbSNAqpKrpErQ15U09O7Q9kI61HQ7hvUZpBG/U6CbtLt/gM)
## Acknowledgments
* -3 bytes thanks to *Kevin Cruijssen*
* -17 bytes thanks to *Nevay*
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 9 bytes
```
+\S÷L<Ðf@
```
[Try it online!](https://tio.run/##y0rNyan8/187Jvjwdh@bwxPSHP4fbn/UtOb//@hoQwM941gdrmhTPRMdBVM9SxDbUEcByNE11lEwNADxdY0NDIB8IwM9S5CQAVjQWA8oj0KAlRpZWOpZAvmWhkYgYV0LQ0s9Y5i2WAA "Jelly – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), ~~78~~ ~~76~~ ~~71~~ 66 bytes
*-7 bytes thanks to Mr. Xcoder.*
```
lambda l:[x for x in l if x<sum(sum(l[:i])for i in range(len(l)))]
```
[Try it online!](https://tio.run/##Vcy9DsIgGIXh3av4RkiA8ONQmnolyICxKMlX2mBN8OpRFqPDu5wnOdtrv69Zt3g6NwzL5RoAR1chrgUqpAwIKUKdHs@F9NCNydOuqWsJ@TYTnDNBSqlvW0l5J5E4xY6MG6akp/TwXY0w7Kc/43qwwhoGVukPAx@UFcYyUFL2l/YG "Python 2 – Try It Online")
[Answer]
# [Perl 6](http://perl6.org/), 31 bytes
```
{.grep(flat([\,] $_).sum/$_>*)}
```
[Try it online!](https://tio.run/##HYndCoIwGIZv5UVGzHBf31IDUXcjFcMDJ4GSbHYg4rWv7Oz5mXs/3uK04uTQxo0G38/Sjd0i74/sCWFTCp/pIqw5p3usEboVibBoDTbp/n94hWVP4N4ejWbKTYampAIlVQdqFFA5NB@icmaoK1P1C8ymjl8 "Perl 6 – Try It Online")
[Answer]
# JavaScript (ES6), ~~56~~ ~~55~~ 52 bytes
```
a=>a.filter(x=>x<t/a.length,a.map(x=>t+=s+=x,s=t=0))
```
---
## Test it
```
o.innerText=(f=
a=>a.filter(x=>x<t/a.length,a.map(x=>t+=s+=x,s=t=0))
)(i.value=[1,4,-3,10]);oninput=_=>o.innerText=f(i.value.split`,`.map(eval))
```
```
<input id=i><pre id=o>
```
[Answer]
# [R](https://www.r-project.org/), 31 bytes
```
function(l)l[l<mean(cumsum(l))]
```
[Try it online!](https://tio.run/##K/qfZvs/rTQvuSQzP08jRzMnOscmNzUxTyO5NLe4NBcoohn7P00jWcNQx0RH11jH0EBT8z8A "R – Try It Online")
[Answer]
# [C# (Mono)](http://www.mono-project.com/), 95 bytes
```
using System.Linq;a=>a.Where(d=>d<new int[a.Length].Select((_,i)=>a.Take(i+1).Sum()).Average())
```
[Try it online!](https://tio.run/##TU9fS8MwEH/Ppzh8SjALFn3bWpDhRJkgVNjDGBLTW3esTbBJJzL62esVHAzu4e74/XVx1gYfxj6Sr6H8jQnbubi@zJr891wI19gY4V2cRUw2kYNToAreLHmp@LnqvVtUof9qcLvTF@4yNA26RMFH84weO3Lm5cn3LXaWkf@EooA95KPNC2s2B@xQVnlRLTz@APm0tWaNvk6HnSlxUpPyU5OawB/2iJJuM2XKvpVKmccTC9fI68iRl2wbGjSbjhJyDZQxddzMvAZOfaOBZy8nm0twOEOm4UHD7F5DdgeDUoqFBjGMfw "C# (Mono) – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), 72 bytes
```
lambda x:[*filter((sum(-~a*b for a,b in enumerate(x))/len(x)).__gt__,x)]
```
[Try it online!](https://tio.run/##RY1BDoMgFETXcoq/BINUY11o4kksIdhCa6Jo4JvYTa9OtQu7mnmTzMzyxtfsymjbWxz11D80bE2X2mFE4ykN60Szj057sLMHzXsYHBi3TsZrNHRj7DIad6hQ6olK8Y3JiCaguutgArTQkaQrclFKvptKXDlUov5BwWGnrORQ5JJIclyc1ePov9OQZPGDQ2rpGTIWvw)
[Answer]
# [Python 3](https://docs.python.org/3/), 76 bytes
```
lambda x:[w for w in x if w<sum(u*v+v for u,v in enumerate(x[::-1]))/len(x)]
```
Input and output are lists of numbers. [Try it online!](https://tio.run/##VYvLDsIgEEX3fsUsQSlCsUkh@iXIokaITVraVPrw6xGauHAzuefcO@MnvAYvorvdY9f0j2cDm9IruGGCFVoPG7QO1ut77tF8XE7L3sxkyZ31c2@nJli0aaUKbjA@d9ajDZuYZyGPtOaMCkNAV/RCoKIyZ04gQSEIcJa5EIwlLhmVWbFdCpr6v7NPy1pSmVjyMuui5pKK35tRBxin1gfkUMA4Hr4)
This works in Python 2 too (with the obvious replacement for `print` syntax in the footer).
[Answer]
# Pyth - 10 bytes
```
<#.OsM._QQ
```
[Try it online here](http://pyth.herokuapp.com/?code=%3C%23.OsM._QQ&input=%5B1%2C+4%2C+-3%2C+10%5D&debug=0).
[Answer]
# Mathematica, 35 bytes
```
Cases[#,x_/;x<#.Range[#2,1,-1]/#2]&
```
`Function` which expects a list of numbers as the first argument `#` and the length of the list as the second argument `#2`. `#.Range[#2,1,-1]/#2` takes the dot product of the input list `#` and the the list `Range[#2,1,-1] == {#2,#2-1,...,1}`, then divides by the length `#2`. Then we return the `Cases` `x_` in the input list `#` which are less than the hyper-average.
Without the length as a second argument, we need `6` more bytes:
```
Cases[#,x_/;x<#.Range[h=Tr[1^#],1,-1]/h]&
```
[Answer]
# TI-Basic, 9 bytes
```
Ans*(Ans<mean(cumSum(Ans
```
[Answer]
# [Factor](https://factorcode.org/), 36 bytes
```
[ dup cum-sum mean '[ _ < ] filter ]
```
[Try it online!](https://tio.run/##bZHBisIwEIbvfYrf054S0kbBuOJV9rIX8SSyhJiyRVO7yfQg0mevwUaRtQNzmXzf/IQptaGz77ebr@/1Akfra3uC0/TLA2mqAlUmoPSX@wzB/rW2Njag8Zbo0viqJnxm2TUDrsgFl@gwXhOwVWTQ3dEZn8ZW43RCn8ywHFMwGTPGnGQkZhCYFAKsEHFDLsQ/LQkvzCDJ@IPXHpPemCGumCuuJFRexBmb54rLZ/IjLjGP1y7r@h0ObQPTOhZaB2d1jY8dfrDEHmV1Iuux751uEA9ijry/AQ "Factor – Try It Online")
## Explanation:
It's a quotation (anonymous function) that takes a sequence from the data stack as input and leaves a sequence on the data stack as output. Assuming `{ 1 4 -3 10 }` is on the data stack when this quotation is called...
* `dup` Duplicate an object.
**Stack:** `{ 1 4 -3 10 } { 1 4 -3 10 }`
* `cum-sum` Take the cumulative sum.
**Stack:** `{ 1 4 -3 10 } { 1 5 2 12 }`
* `mean` Take the mean.
**Stack:** `{ 1 4 -3 10 } 5`
* `'[ _ < ] filter` Take the elements from a sequence that are less than the number on top of the stack.
**Stack:** `{ 1 4 -3 }`
[Answer]
# Pyth, 12 11 bytes
```
f<T.OsM._QQ
```
*-1 byte thanks to Mr. Xcoder*
[Try it online!](http://pyth.herokuapp.com/?code=f%3CT.OsM._QQ&test_suite=1&test_suite_input=%5B10.3%5D%0A%5B5.4%2C+5.9%5D%0A%5B1%2C+4%2C+-3%2C+10%5D%0A%5B-300%2C+-20.9%2C+1000%5D%0A%5B3.3%2C+3.3%2C+3.3%2C+3.3%5D%0A%5B-289.93%2C+912.3%2C+-819.39%2C+1000%5D&debug=0)
[Answer]
# [Perl 5](https://www.perl.org/), 51 + 1 (-a) = 52 bytes
```
$a+=$_*(@F-$c++)for@F;for(@F){print$_,$"if$_<$a/@F}
```
[Try it online!](https://tio.run/##K0gtyjH9/18lUdtWJV5Lw8FNVyVZW1szLb/Iwc0aSAJFNKsLijLzSlTidVSUMtNU4m1UEvUd3Gr//9c1srDUszRWsDQ00jNW0LUwtNQztlQwNDAw@JdfUJKZn1f8X9fXVM/A0OC/biIA "Perl 5 – Try It Online")
[Answer]
# PHP, 84 bytes
```
for($i=--$argc;$i;)$s+=$i--/$argc*$r[]=$argv[++$k];foreach($r as$x)$x<$s&&print$x._;
```
takes input from command line arguments. Run with `-nr` or [try it online](http://sandbox.onlinephpfunctions.com/code/8433f2d14f50e8b8041814c6be3936b7c77933f1).
---
summing up the partial lists is the same as summing up each element multiplied with the number of following elements +1 → no need to juggle with bulky array functions. It´s still long, though.
[Answer]
# [Röda](https://github.com/fergusq/roda), ~~46~~ ~~41~~ 39 bytes
```
f l{l|[_]if[_1*#l<seq(1,#l)|l[:_]|sum]}
```
[Try it online!](https://tio.run/##bY3LDoIwEEXX9CsmyqKY0rRUE2r8k6YpRkokKRRB40L4dqS68rG5izPn3ul9eZznCtzDjcroulKGb9buMNgL5mTtktGpvdHjcGv0NA9nf8cJPFBUV@A720LpURT1trydLC5iQyA2RQIjdH3dXnGhYqOLBEXWDXYR33Sl9GphpW8tmhBqjnUbJiusOKNCh/r70Yvt6JbAjspvzikjsA2RipBLl307qWDsZWSMyqCwP5KggsBH/MxkuaRyuUmeBSXNuaTi7@A0PwE "Röda – Try It Online")
[Answer]
# J, 15 bytes
```
#~[<[:(+/%#)+/\
```
[Try it online!](https://tio.run/##y/r/P81WT7ku2ibaSkNbX1VZU1s/hosrNTkjXyFNwVDBRCHeWMHQAC4Sb2xgoBBvZKBnCRQ1MPj/HwA) Expects a J-style array (negatives represented using `_` instead of `-` and elements separated by spaces -- see the TIO link for examples).
I don't know if there's a way to remove the parentheses around the mean (`+/%#`) but removing that and the cap would be the first thing I'd try to do to golf this further.
# Explanation
Sometimes J reads like (obfuscated) English.
```
#~ [ < [: (+/ % #) +/\
                   +/\  Sum prefixes
                     \   Get prefixes
                   +/    Sum each
          (+/ % #)      Mean
           +/            Sum of array
              %          Divided by
                #        Length of array
   [ <                  Input array is less than?
                         (gives boolean array of pairwise comparisons)
#~                      Filter by
```
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), 26 bytes
**Solution:**
```
x@&x<(+/+/'x@!:'1+!#x)%#x:
```
[Try it online!](https://tio.run/##y9bNz/7/v8JBrcJGQ1tfW1@9wkHRSt1QW1G5QlNVucLKUMFEQddYwdDg/38A "K (oK) – Try It Online")
**Examples:**
```
> x@&x<(+/+/'x@!:'1+!#x)%#x:1 4 -3 10
1 4 -3
> x@&x<(+/+/'x@!:'1+!#x)%#x:-289.93 912.3 -819.39 1000
-289.93 -819.39
```
**Explanation:**
Interpretted right-to-left. Struggled with a short way to extract prefixes:
```
x@&x<(+/+/'x@!:'1+!#x)%#x: / the solution
                        x: / store input in x, x:1 4 -3 10
                       #   / count, return length of x, #1 4 -3 10 => 4
     (               )     / do everything in the brackets together
                   #x      / count x
                  !        / til, range 0..x, !4 => 0 1 2 3
                1+         / add 1 vectorised, 1+0 1 2 3 => 1 2 3 4
             !:'           / til each, e.g. !1, !2, !3, !4
           x@              / index into x at these indices (now we have the prefixes)
        +/'                / sum (+ over) each, e.g. 1 5 2 12
      +/                   / sum over, e.g. 20
                      %    / right divided by left, 20%4 => 5 (now we have the hyper average)
   x<                      / boolean list where x less than 5
  &                        / indices where true, &0111b => 1 2 3
x@                         / index into x at these indices (now we have the filtered list)
```
**Notes:**
Alternative version taking length of input as parameter (**25** byte solution):
```
> {x@&x<(+/+/'x@!:'1+!y)%y}[1 4 -3 10;4]
1 4 -3
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 6 bytes
```
<ƇÄS÷ɗ
```
[Try it online!](https://tio.run/##y0rNyan8/9/mWPvhluDD209O/394uY/3sa5HTWsi//@PjjY00DOO1eGKNtUz0VEw1bMEsQ11FIAcXWMdBUMDEF/X2MAAyDcy0LMECRmABY31gPIoBFipkYWlniWQb2loBBLWtTC01DOGaYsFAA "Jelly – Try It Online")
Takes the list on the left and its length on the right, as explicitly permitted.
With newer builtins, Leaky Nun's `+\S÷L<Ðf@` becomes `ÄS÷L<Ƈ@` (which may as well be `ÄS÷L>x@`, using one less piece of the present, but that's besides the point), but taking the length as the right argument trades an `L` and an `@` for one `ɗ`.
```
 Ƈ        Filter the left argument to elements which
<         are less than
   S ɗ    the sum of
  Ä       the cumulative sums of the left argument
    ÷     divided by the right argument.
```
[Answer]
# [Arturo](https://arturo-lang.io), 42 bytes
```
$[a][select a'x[0x<average map a=>[dup+]]]
```
[Try it](http://arturo-lang.io/playground?VbtpQY)
```
$[a][                      ; a function taking an argument a
    select a 'x [          ; select numbers from a and assign current number to x
        0                  ; push 0 to the stack
        x <                ; is x less than...
        average            ; ...the mean...
        map a => [dup +]   ; ...of the cumulative sum of a?
    ]                      ; end select
]                          ; end function
```
[Answer]
# [Julia 0.5](http://julialang.org/), 24 bytes
```
~x=x[x.<mean(cumsum(x))]
```
[Try it online!](https://tio.run/##bY@7asMwGIV3PcUhySCBLCSrhqhEoUMfoZvQYCcpdYnt4Av15Fd3pSYuNXQROt@5wP85XMs8m@dptKMbxaG65DU9DVU3VHRkzM8v3UfzhckpjieORHMo6cmtLev@WlNGyBZvl67vyBkWr@Wpp8QpKbSHPcJ5TlwmQjET5k5@VXBWmz/uQqKbaCnDP5XCxIB8RP7gmNIi1FfPPfYPj5vp3ggTtFFpxMleGaHX@0vk4YVauNItF085rEXBsXnGtAsCu2LD8N60oDkvGMoaZz9/Aw "Julia 0.5 – Try It Online")
In modern Julia, `mean` was moved from `Base` to the `Statistics` module:
# [Julia 1.0](http://julialang.org/), 33 bytes
```
~x=x[x.<sum(cumsum(x))/length(x)]
```
[Try it online!](https://tio.run/##bU9LasMwEN3rFI80CwtkVbISiEIUuugRuhNa2Pm6OE6IbaqVr@5KTVxq6GZm3hfms6vKXPph6L3x1vNN012SXXeJy1P6Wh3qU3sOpxvemvP1C72VDAuGVDFI4cjtXtZtVSeUkBd8HJq2IXsYvJe7NiFWCq4czBbWMWKXPASXXD@YXxSUSeePOjJRTZUQ4c4E19EgnpY/dHQpHuKT8bD9w8fObKW5DljLLNLpSmqupv2j5amFWPjSjh/3OYxBwTBbo58HgHkxozhe70hyVlCUNfZu@AY "Julia 1.0 – Try It Online")
[Answer]
# [Nibbles](http://golfscript.com/nibbles/index.html), 5.5 bytes (11 nibbles)
```
|$-/+`\@+,@
```
[Nibbles](http://golfscript.com/nibbles/index.html) uses only integers, so I'm "assuming that the numbers fit my language of choice" by omitting decimal points from fractional inputs & padding with zeros where needed. I hope that this is not construed as "abusing" the lenient input rule in any way.
```
|$              # filter input to retain only those that are truthy when:
  -             #   subtracting them from
    +           #     the sum of 
     `\@+       #     the cumulative sums of the input
   /            #     divided by
         ,@     #     the length of the input
```
[![enter image description here](https://i.stack.imgur.com/XiyJW.png)](https://i.stack.imgur.com/XiyJW.png)
[Answer]
# [Pip](https://github.com/dloscutoff/pip), 19 bytes
```
_<$+$+*(aH\,b)/bFIa
```
Makes use of the optional length input.
How?
```
_<$+$+*(aH\,b)/bFIa  : -xp; Two args: array and length
        a         a  : First input; array
            b  b     : Second input; length
                FIa  : Filter: keep items from iterable 'a' which return truthy
_                    : Passed element
 <                   : Is less then
        aH           : Get prefix of a that is # elements long
          \,b        : Range from one to length
    $+*              : Sum of each list
  $+                 : Sum list
              /b     : Divide by length
```
[Try It Online!](https://dso.surge.sh/#@WyJwaXAiLCIiLCJfPCQrJCsqKGFIXFwsYikvYkZJYSIsIiIsIiIsIidbMTs0Oy0zOzEwXScgJzQnIC14cCJd)
]