https://www.acmicpc.net/problem/4344
const fs = require('fs');
const input = fs.readFileSync('/dev/stdin').toString().split('\n');
const N = Number(input[0]);
for(let i = 0 ; i < N ; i++) {
let st = input[i+1].split(" ");
let n = Number(st.shift());
let total = 0;
let arg = 0;
st.forEach(d => total += Number(d));
arg = total/n;
let m = 0;
st.forEach(d => {
if(d > arg) m++;
});
const result = m/n*100;
console.log(result.toFixed(3)+"%");
}
728x90
'Algorithm&CodingTest > Baekjoon' 카테고리의 다른 글
[Baekjoon] [10773] 제로 (0) | 2023.02.09 |
---|---|
[Baekjoon] [1157] 단어 공부 (0) | 2023.02.09 |
[Baekjoon] [2941] 크로아티아 알파벳 (0) | 2023.02.09 |
[Baekjoon] [10926] ??! (0) | 2023.02.09 |
[Baekjoon] [18108] 1998년생인 내가 태국에서는 2541년생?! (0) | 2023.02.09 |