카테고리 없음

[python][SWEA][D2] 1983. 조교의 성적 매기기

haju 2023. 5. 19. 22:53

https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=2&contestProbId=AV5PwGK6AcIDFAUq&categoryId=AV5PwGK6AcIDFAUq&categoryType=CODE&problemTitle=&orderBy=RECOMMEND_COUNT&selectCodeLang=PYTHON&select-1=2&pageSize=10&pageIndex=2&&&&&&&&&& 

 

T=int(input())
score = ['A+', 'A0', 'A-', 'B+', 'B0', 'B-', 'C+', 'C0', 'C-', 'D0']

for t in range(1,T+1):
    n,k=map(int,input().split())
    hak=[]
    for i in range(n):
        a,b,c=map(int,input().split())
        total=a*0.35+b*0.45+c*0.2
        hak.append(total)
    k_score=hak[k-1]
    hak.sort(reverse=True)
    result=hak.index(k_score)
    result//=(n//10)
    print("#%d %s" %(t,score[result]))