πŸ€–/λ°±μ€€

λ°±μ€€ 4344: 평균은 λ„˜κ² μ§€ (Python)

sssbin 2021. 8. 24. 16:11

https://www.acmicpc.net/problem/4344

 

4344번: 평균은 λ„˜κ² μ§€

λŒ€ν•™μƒ μƒˆλ‚΄κΈ°λ“€μ˜ 90%λŠ” μžμ‹ μ΄ λ°˜μ—μ„œ 평균은 λ„˜λŠ”λ‹€κ³  μƒκ°ν•œλ‹€. 당신은 κ·Έλ“€μ—κ²Œ μŠ¬ν”ˆ μ§„싀을 μ•Œλ €μ€˜μ•Ό ν•œλ‹€.

www.acmicpc.net

 

n=int(input())

for i in range(n):
    s=list(map(int,input().split()))
    avg=sum(s[1:])/s[0]
    cnt=0

    for i in s[1:]:
        if i>avg:
            cnt+=1

    print(f"{cnt/s[0]*100:.3f}%")