8 lines
395 B
TypeScript
8 lines
395 B
TypeScript
export {}
|
|
const input: number[] = require("fs").readFileSync(0,"utf8").toString().trim().split('\n').map(Number);
|
|
if(input[0]===0) console.log(0);
|
|
else {
|
|
const exceptValue: number = Math.round(input[0]*0.15);
|
|
const level = Math.round(input.slice(1).sort((a,b)=>a-b).slice(exceptValue,input[0]-exceptValue).reduce((acc,val)=>acc+val,0)/(input[0]-2*exceptValue));
|
|
console.log(level);
|
|
} |