Javascript:var массив=[];for(var сч=0;сч<40;сч++)массив.push(Math.floor(Math.random()*160)-200);массив.forEach(function(t,i,a){массив[i]/=10;});document.write(массив+"<br />");
var фм=массив.filter(function(n){return n<((-20+-5)/2);});document.write(фм.reduce(function(s,i){return s+i;})/фм.length);<br>
Пример вывода:
-8.3,-19.4,-16.8,-17.9,-6.5,-15.2,-15.4,-6.8,-19.4,-8.6,-15.4,-5.8,-18.4,-6.3,-18.2,-13.3,-13.5,-16.4,-11.6,-5.4,-5.5,-5.9,-4.9,-4.7,-7.7,-5.4,-5.8,-19.3,-9.1,-18.7,-9.2,-17.8,-10.4,-8.7,-12.9,-15.2,-11.3,-5.3,-13.8,-8.4
-16.5