Skip to content

Instantly share code, notes, and snippets.

@mandos1995
Created December 27, 2022 16:03
평균은 넘겠지
import Foundation
func solution() {
let input = readLine()!.split(separator: " ").map { Double($0)! }
let n = input.first!
let average = input[1...].reduce(0, +) / n
let answer = Double(input[1...].filter { $0 > average }.count) / n * 100
print(String(format: "%.3f", answer) + "%")
}
let c = Int(readLine()!)!
(1...c).forEach { _ in solution() }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment