Problem:

Grading

  Write a program which reads a list of student test scores and evaluates the performance for each student.

  The test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup examination r (out of 100). If the student does not take the examination, the score is indicated by -1.

  The final performance of a student is evaluated by the following procedure:

  
If the student does not take the midterm or final examination, the student's grade shall be F.

  
If the total score of the midterm and final examination is greater than or equal to 80, the student's grade shall be A.

  
If the total score of the midterm and final examination is greater than or equal to 65 and less than 80, the student's grade shall be B.

  
If the total score of the midterm and final examination is greater than or equal to 50 and less than 65, the student's grade shall be C.

  
If the total score of the midterm and final examination is greater than or equal to 30 and less than 50, the student's grade shall be D. However, if the score of the makeup examination is greater than or equal to 50, the grade shall be C.

  
If the total score of the midterm and final examination is less than 30, the student's grade shall be F.

Input

  The input consists of multiple datasets. For each dataset, three integers m, f and r are given in a line.

  The input ends with three -1 for m, f and r respectively. Your program should not process for the terminal symbols.

The number of datasets (the number of students) does not exceed 50.

Output

  For each dataset, print the grade (A, B, C, D or F) in a line.

Sample Input

40 42 -1
20 30 -1
0 2 -1
-1 -1 -1

Sample Output

A
C
F



Sample input:
40 42 -1
20 30 -1
0 2 -1
-1 -1 -1


Sample output:
A
C
F

Submission status: Accepted

Solution code:
scores =[]
while True:
    score = list(map(int,input().split()))
    if all([i == -1 for i in score]):
        break
    scores.append(score)

def judge(score):
    if score[0] == -1 or score[1] == -1:
        print('F')
    elif score[0] + score[1] >= 80:
        print('A')
    elif score[0] + score[1] >= 65:
        print('B')
    elif score[0] + score[1] >= 50:
        print('C')
    elif score[0] + score[1] >= 30:
        if score[2] >= 50:
            print('C')
        else:
            print('D')
    else:
        print('F')

for i in scores:
    judge(i)

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    if m == -1 or f == -1:
        print("F")
    elif m + f >= 80:
        print("A")
    elif m + f >= 65:
        print("B")
    elif m + f >= 50 or r >= 50:
        print("C")
    elif m + f >= 30:
        print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, input().split())
    total = m + f
    if m == f == r == -1:
        break
    if (m == -1) | (f == -1):
        print("F")
    elif 80 <= total:
        print("A")
    elif 65 <= total < 80:
        print("B")
    elif 50 <= total < 65:
        print("C")
    elif 30 <= total < 50:
        if 50 <= r:
            print("C")
        else:
            print("D")
    elif total < 30:
        print("F")

Submission status: Accepted

Solution code:
for i in range (50):
    m,f,r = list(map(int,input().split()))
    if [m,f,r] == [-1,-1,-1]:
        break
    else:
        if m == -1 or f == -1:
            print("F")
        elif m + f >= 80:
            print("A")
        elif m + f >= 65:
            print("B")
        elif m + f >= 50:
            print("C")
        elif m + f >= 30:
            if r >= 50:
                print("C")
            else:
                print("D")
        else:
            print("F")

Submission status: Accepted

Solution code:
end = False

while end is False:
	m, f, r = map(int, input().split())
	if m == f == r == -1:
		end = True
	else:
		if m == -1 or f == -1:
			grade = 'F'
		elif m + f >= 80:
			grade = 'A'
		elif m + f >= 65:
			grade = 'B'
		elif m + f >= 50:
			grade = 'C'
		elif m + f >= 30:
			if r >= 50:
				grade = 'C'
			else:
				grade = 'D'
		else:
			grade = 'F'

		print(grade)

Submission status: Accepted

Solution code:
m, f, r = map(int, input().split())

while m != -1 or f != -1 or r != -1:
    if m == -1 or f == -1:
        print("F")
    elif 80 <= m+f:
        print("A")
    elif 65 <= m+f < 80:
        print("B")
    elif 50 <= m+f < 65:
        print("C")
    elif 30 <= m+f < 50:
        print("C" if 50 <= r else "D")
    else:
        print("F")

    m, f, r = map(int, input().split())

Submission status: Accepted

Solution code:

while(True):
    x, y, z = map(int, input().split())
    if(x==-1 and y==-1 and z==-1):
        break
    if (x == -1 or y == -1):
        print("F")
        continue
    if (x + y >= 80):
        print("A")
        continue
    if (x + y >= 65):
        print("B")
        continue
    if (x + y >= 50):
        print("C")
        continue
    if (x + y >= 30):
        if(z >= 50):
            print("C")
            continue
        else:
            print("D")
            continue
    else:
        print("F")

Submission status: Accepted

Solution code:
while(True):
    m,f,r=map(int,input().split())
    if m==f==r==-1:
        exit()
    if m!=-1and f!=-1and m+f>=80:
        print("A")
    elif m!=-1and f!=-1and 65<=m+f<80:
        print("B")
    elif m!=-1and f!=-1and 50<=m+f<65:
        print("C")
    elif m!=-1and f!=-1and 30<=m+f<50 :
        if r<50:
            print("D")
        else:
            print("C")
    else:
        print("F")

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, input().split())
    if m==-1 and f==-1 and r==-1: break
    
    if m==-1 or f==-1:
        print('F')
    elif m+f>=80:
        print('A')
    elif m+f>=65:
        print('B')
    elif m+f>=50:
        print('C')
    elif m+f>=30:
        if r>=50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
while 1:
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break;
    else:
        if m==-1 or f==-1:
            print("F")
        elif m+f>=80:
            print("A")
        elif 65<=m+f<80:
            print("B")
        elif 50<=m+f<65:
            print("C")
        elif 30<=m+f<50:
            if r>=50:
                print("C")
            else:
                print("D")
        else:
           print("F")

Submission status: Accepted

Solution code:

while True:
    m, f, r = (int(x) for x in input().split())
    
    if m == -1 and f == -1 and r == -1:
        break
    elif m == -1 or f == -1:
        print('F')
    elif m + f >= 80:
        print('A')
    elif m + f >= 65:
        print('B')
    elif m + f >= 50:
        print('C')
    elif m + f >= 30:
        if r >= 50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
def judge(m,f,r):
    if (m == -1 or f == -1) or 30 > m+f:
        return 'F'
    elif m+f >= 80:
        return 'A'
    elif 80 > m+f >= 65:
        return 'B'
    elif 65 > m+f >= 50 or (50 > m+f >= 30 and r >= 50):
        return 'C'
    else:
        return 'D'

m,f,r = map(int,input().split())
while True:
    print(judge(m,f,r))
    m,f,r = map(int,input().split())
    if m == -1 and f == -1 and r == -1:
        break

Submission status: Accepted

Solution code:
while True:
    a,b,c = map(int, input().split())
    if a==b==c==-1:
        break
    if a==-1 or b==-1:
        print("F")
        continue
    if a+b>=80:
        print("A")
        continue
    if 65<= a+b <80:
        print("B")
        continue
    if 50<= a+b <65:
        print("C")
        continue
    if 30<= a+b <50:
        if c >= 50:
            print("C")
            continue
        else:
            print("D")
            continue
    print("F")

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int,input().split())
    d = m+f
    if m == -1 and f == -1 and r == -1:
        break
    elif m == -1 or f == -1 or d < 30:
        print("F")
    
    elif d >= 80:
        print("A")
    elif d>= 65 and d <80:
        print("B")
    elif (d >= 50 and d < 65) or (d>=30 and d< 50 and r >= 50):
        print("C")
    elif d>=30 and d< 50 and r<50:
        print("D")

Submission status: Accepted

Solution code:
while True:
    cnt = 0
    scores = list(map(int, input().split()))
    m = scores[0]
    f = scores[1]
    r = scores[2]
    if m == f == r == -1:
        break
    else:
        if (m == -1) or (f == -1):
            print("F")
        elif m + f >= 80:
            print("A")
        elif 65 <= (m + f) < 80:
            print("B")
        elif 50 <= (m + f) < 65:
            print("C")
        elif 30 <= (m + f) < 50:
            if r >= 50:
                print("C")
            else:
                print("D")
        else:
            print("F")

Submission status: Accepted

Solution code:
answer = []

while True:
    m, f, r = list(map(int, input().split()))
    if m == f == r == -1:
        break

    # 中間試験、期末試験のいずれかを欠席した
    if (m == -1) or (f == -1):
        answer.append("F")
    # 中間試験と期末試験の合計点数が80以上
    elif 80 <= m + f:
        answer.append("A")
    # 中間試験と期末試験の合計点数が65以上80未満
    elif 65 <= m + f < 80:
        answer.append("B")
    # 中間試験と期末試験の合計点数が 50 以上 65 未満
    # 再試験の点数が 50 以上
    elif (50 <= m + f < 65) or (50 <= r):
        answer.append("C")
    # 中間試験と期末試験の合計点数が 30 以上 50 未満
    elif 30 <= m + f < 50:
        answer.append("D")
    # 中間試験と期末試験の合計点数が 30 未満
    elif m + f < 30:
        answer.append("F")

[print(*answer[i]) for i in range(len(answer))]

Submission status: Accepted

Solution code:
a,b,c=(int(x) for x in input().split())
while a!=-1 or b!=-1 or c!=-1:
    if a==-1 or b==-1:
        print("F")
    else:
        if a+b>=80:
            print("A")
        elif a+b>=65 and a+b<80:
            print("B")
        elif a+b>=50 and a+b<65:
            print("C")
        elif a+b>=30 and a+b<50 and c>=50:
            print("C")
        elif a+b>=30 and c<50:
            print("D")
        else:
            print("F")
    a,b,c=(int(x) for x in input().split())

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int,input().split(' '))
    result = m + f
    if (m + f + r) == -3:
        break
    if m == -1 or f == -1 or result < 30:
        print('F')
        continue
    if result >= 80:
        print('A')
        continue
    if result >= 65:
        print('B')
        continue
    if result >= 50 or (result >= 30 and r >= 50):
        print('C')
        continue
    if result >= 30:
        print('D')
        continue

Submission status: Accepted

Solution code:
for _ in range(10000):
    m,f,r = map(int,input().split())
    if (m==-1) and (f==-1) and (r==-1):
        break
    if (m==-1) or (f==-1):
        print('F')
        continue
    elif (m+f>=80):
        print('A')
        continue
    elif (m+f>=65):
        print('B')
        continue
    elif (m+f>=50):
        print('C')
        continue
    elif (m+f>=30):
        if (r>=50):
            print('C')
            continue
        else:
            print('D')
            continue
    else:
        print('F')
        continue

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, input().split())
    if m + f + r == -3:
        break
    if m == -1 or f == -1:
        print('F')
    elif m + f >= 80:
        print('A')
    elif m + f >= 65:
        print('B')
    elif m + f >= 50:
        print('C')
    elif m + f >= 30:
        if r >= 50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
import sys

score = []
while (True):
    lst = list(map(int, input().split(' ')))
    if lst[0] == -1 and lst[1] == -1 and lst[2] == -1:
        break
    score.append(lst)


for item in score:
    if item[0] == -1 or item[1] == -1:
        print("F")
    elif 80 <= item[0] + item[1]:
        print("A")
    elif 65 <= item[0] + item[1] and item[0] + item[1] < 80:
        print("B")
    elif 50 <= item[0] + item[1] and item[0] + item[1] < 65:
        print("C")
    elif 30 <= item[0] + item[1] and item[0] + item[1] < 50:
        if 50 <= item[2]:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
#初期data準備
student_max = 50
student_result = list()
student_grade = list()

for i in range(student_max):

    #インプットdataの挿入
    student_result.append(list(map(int, input().split())))

    #m、f、r がすべて -1 のとき入力終わり
    if sum(student_result[i]) == -3:
        break
    
    #成績判定
    if student_result[i][0] == -1 or student_result[i][1] == -1:
        student_grade.append("F")
    elif student_result[i][0] + student_result[i][1] >= 80:
        student_grade.append("A")
    elif student_result[i][0] + student_result[i][1] >= 65:
        student_grade.append("B")
    elif student_result[i][0] + student_result[i][1] >= 50:
        student_grade.append("C")
    elif student_result[i][0] + student_result[i][1] >= 30:
        if student_result[i][2] >= 50:
            student_grade.append("C")
        else:
            student_grade.append("D")
    else:
        student_grade.append("F")

#成績の表示
[print(i) for i in student_grade]

Submission status: Accepted

Solution code:
while True:
 m,f,r = list(map(int, input().split() ))
 if m==-1 and f==-1 and r==-1:
  break
 if m==-1 or f==-1:
  print("F")
 elif m+f>=80:
  print("A")
 elif 65<=m+f<80:
  print("B")
 elif 50<=m+f<65:
  print("C")
 elif 30<=m+f<50:
  if 50<=r:
   print("C")
  else:
   print("D")
 else:
  print("F")

Submission status: Accepted

Solution code:
while True:
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        exit()
    if m==-1 or f==-1:
        print('F')
    elif m+f>=80:
        print('A')
    elif m+f>=65:
        print('B')
    elif m+f>=50:
        print('C')
    elif m+f>=30 and r>=50:
        print('C')
    elif m+f>=30:
        print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
a=0
list_grade=[]
list_grade.append([int(w) for w in input().split()])

while not list_grade[a]==[-1,-1,-1]:
    a+=1
    list_grade.append([int(w) for w in input().split()])
    
a=0
while not list_grade[a]==[-1,-1,-1]:
    score=list_grade[a][0]+list_grade[a][1]
    if list_grade[a][0]==-1 or list_grade[a][1]==-1 or score<30: 
        print('F')
        a+=1
        continue
    
    if score>=80:
        print('A')
        
    elif 65<=score<80:
        print('B')
        
    elif 50<=score<65:
        print('C')
        
    elif 30<=score<50:
        if list_grade[a][2]>=50:
            print('C')
            a+=1
            continue
        print('D')
    a+=1

Submission status: Accepted

Solution code:
while True:
    l = list(map(int,input().split()))
    m = l[0]
    f = l[1]
    r = l[2]

    if m == f == r == -1:
        break
    

    if   m == -1 or f == -1:
        print("F")
    elif m + f >= 80:
        print("A")
    elif m + f >= 65:
        print("B")
    elif m + f >= 50:
        print("C")
    elif m + f >= 30:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
while True:
    A,B,C = map(int,input().split())
#    A,B,C = map(int,f.readline().split())
 #   print(A,B,C,end="")
    if A==-1 and B==-1 and C==-1:
        break
    elif A==-1 or B==-1:
        print("F")
        continue
    if A==-1:
        A=0
    if B==-1:
        B=0
        
    if A+B >= 80:
        print("A")
    elif A+B >=65 and A+B < 80:
        print("B")
    elif A+B >=50 and A+B < 65:
        print("C")
    elif A+B >=30 and A+B < 50:
        if C >= 50:
            print("C")
        else:
            print("D")
    elif A+B < 30:
        print("F")

Submission status: Accepted

Solution code:
score = []
while True:
    m, f, r = map(int, input().split())
    if m == f == r == -1:
        break
    if m == -1 or f == -1:
        score.append('F')
    elif 80 <= m + f:
        score.append('A')
    elif 65 <= m + f < 80:
        score.append('B')
    elif 50 <= m + f < 65:
        score.append('C')
    elif 30 <= m + f < 50:
        if 50 <= r:
            score.append('C')
        else:
            score.append('D')
    elif m + f < 30:
        score.append('F')
for s in score:
    print(s)

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, input().split())
    
    if m == -1 and f == -1 and r == -1:
        break
    else:
        pass
    
    if m == -1 or f == -1:
        print("F")
    else:
        if m + f >= 80:
            print("A")
        elif 65 <= m + f < 80:
            print("B")
        elif 50 <= m + f < 65:
            print("C")
        elif 30 <= m + f < 50:
            if r >= 50:
                print("C")
            else:
                print("D")
        elif m + f < 30:
            print("F")

Submission status: Accepted

Solution code:
def result(m,f,r):
	if m==-1 or f==-1:
		return "F"
	if m+f>=80:
		return "A"
	if m+f>=65:
		return "B"
	if m+f>=50:
		return "C"
	if m+f>=30:
		return "C" if r>=50 else "D"
	return "F"

while True:
	m,f,r = map(int, input().split())
	if m==-1 and f==-1 and r==-1:
		break
	print(result(m,f,r))

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    else:
        if m == -1 or f == -1:
            print('F')
        else:
            totalresult = int(m + f)
            if totalresult >= 80:
                print('A')
            elif totalresult >= 65:
                print('B')
            elif totalresult >= 50:
                print ('C')
            elif totalresult >= 30:
                if r >= 50:
                    print('C')
                else:
                    print('D')
            else:
                print('F')

Submission status: Accepted

Solution code:
#7_A
while 1:
    m, f, r = map(int, input().split())
    if m==-1 and f==-1 and r==-1:
        break
    if m==-1 or f==-1:
        grade = "F"
    else:
        mpf = m + f
        if 80<=mpf<=100:
            grade = "A"
        elif 65<=mpf<80:
            grade = "B"
        elif 50<=mpf<65:
            grade = "C"
        elif 30<=mpf<50:
            if r>=50:
                grade = "C"
            else:
                grade = "D"
        elif 30>mpf:
            grade = "F"
    print(grade)

Submission status: Accepted

Solution code:
while True:
    m,f,r=list(map(int,input().split()))
    if m==f==r==-1:
        break
    if m==-1 or f==-1 or m+f<30:
        print("F")
    elif m+f<50 and r<50:
        print("D")
    elif m+f<65 or r>=50:
        print("C")
    elif m+f<80:
        print("B")
    else:
        print("A")

Submission status: Accepted

Solution code:
while True:

    # 点数を受け取る
    m, f, r = map(int, input().split())
    if m==f==r==-1:
        break

    # 成績判定
    mf = m + f
    if m == -1 or f == -1:
         grade = "F"
    elif mf >= 80:
         grade = "A"
    elif mf >= 65:
         grade = "B"
    elif mf >= 50 and mf < 65 :
         grade = "C"
    elif mf >= 30 and mf < 50 and r >= 50:
         grade = "C"
    elif mf >= 30 and mf < 50 :
         grade = "D"
    else:
         grade = "F"

    print(grade)

Submission status: Accepted

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]
    if m == f == r == -1:
        break
    total = m + f
    if -1 in [m, f]:
        grade = "F"
    elif total >= 80:
        grade = "A"
    elif total >= 65:
        grade = "B"
    elif total >= 50:
        grade = "C"
    elif total >= 30:
        if r >= 50:
            grade = "C"
        else:
            grade = "D"
    else:
        grade = "F"
    print(grade)

Submission status: Accepted

Solution code:
ans = []
while True:
    m,f,r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    if m == -1 or f == -1:
        ans.append("F")
    elif m+f >= 80:
        ans.append("A")
    elif m+f >= 65:
        ans.append("B")
    elif m+f >= 50:
        ans.append("C")
    elif m+f >= 30 and r >= 50:
        ans.append("C")
    elif m+f >= 30:
        ans.append("D")
    else:
        ans.append("F")
        
for i in ans:
    print(i)

Submission status: Accepted

Solution code:
list=[]
for i in range(50):
    a=map(int,raw_input().split())
    b="grade"
    if a==[-1,-1,-1]:
        break
    elif a[0]==-1 or a[1]==-1:
        b="F"
    elif a[0]+a[1]>=80:
        b="A"
    elif a[0]+a[1]>=65:
        b="B"
    elif a[0]+a[1]>=50:
        b="C"
    elif a[0]+a[1]>=30:
        b="D"
        if a[2]>=50:
            b="C"
    else:
        b="F"
    list.append(b)
for i in range(len(list)):
    print list[i]

Submission status: Accepted

Solution code:
while True:
    mid_score, final_score, re_score = map(float, input().split())
    
    if mid_score == final_score == re_score == -1:
        break
    
    sum_score = mid_score + final_score
    
    if mid_score == -1 or final_score == -1 or sum_score < 30:
        print("F")
    elif 30 <= sum_score < 50:
        if re_score < 50:
            print("D")
        else:
            print("C")
    elif 50 <= sum_score < 65:
        print("C")
    elif 65 <= sum_score < 80:
        print("B")
    elif 80 <= sum_score:
        print("A")

Submission status: Accepted

Solution code:
while True:
    IN = list(map(int,input().split()))
    a = IN[0]+IN[1]
    if IN[0]==-1 and IN[1]==-1 and IN[2]==-1:
        break
    elif IN[0]==-1 or IN[1]==-1 or a < 30:
        print("F")
    elif a >= 80:
        print("A")
    elif a >=65:
        print("B")
    elif a >=50 or IN[2]>=50:
        print("C")
    else:
        print("D")

Submission status: Accepted

Solution code:
while True:
    #m,f,rの入力
    m,f,r = map(int,input().split())
    #試験を受けてないとき-1を入力
    #m,f,rがそれぞれ-1のとき終了
    if m == -1 and f == -1 and r == -1:
        break
    #中間試験、期末試験のいずれかを欠席した場合成績は F。
    if m == -1 or f == -1:
        print("F")
    # 中間試験と期末試験の合計点数が 80 以上ならば成績は A 。
    elif (m + f) >= 80:
        print("A")
    # 中間試験と期末試験の合計点数が 65 以上 80 未満ならば成績は B。
    elif (m + f) >=65 and (m + f) <80:
        print("B")
    # 中間試験と期末試験の合計点数が 50 以上 65 未満ならば成績は C。
    elif (m + f) >= 50 and (m + f) < 65:
        print("C")
    # 中間試験と期末試験の合計点数が 30 以上 50 未満ならば成績は D。 ただし、再試験の点数が 50 以上ならば成績は C。
    elif (m + f) >= 30 and (m + f) < 50 and r <50:
        print("D")
    elif (m + f) >= 30 and (m + f) < 50 and r >= 50:
        print("C")
    # 中間試験と期末試験の合計点数が 30 未満ならば成績は F
    elif (m + f) < 30:
        print("F")

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        quit()
    elif m == -1 or f == -1:
        print("F")
    elif m + f >= 80:
        print("A")
    elif m + f >= 65:
        print("B")
    elif m + f >= 50:
        print("C")
    elif m + f >= 30 and r >= 50:
        print("C")
    elif m + f >= 30:
        print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
sw_input = True
while sw_input == True:
    m,f,r  = map(int, input().split())
    if m < 0 and f < 0 and r < 0:
        sw_input = False
    else:
        if m < 0 or f < 0:
            EV = 'F'
        elif m + f >= 80:
            EV = 'A'
        elif m + f >= 65:
            EV = 'B'
        elif m + f >= 50 or r >= 50:
            EV = 'C'
        elif m + f >= 30:
            EV = 'D'
        else:
            EV = 'F'
        print(EV)

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int,input().split())
    s = m+f
    if m==-1 and f==-1 and r==-1:
        break
    elif m==-1 or f==-1:
        o="F"
    elif s >= 80:
        o="A"
    elif s >= 65 and s < 80:
        o="B"
    elif s >= 50 and s < 65:
        o="C"
    elif s >= 30 and s < 50:
        if r >= 50:
            o = "C"
        else:
            o = "D"
    else:
        o = "F"
    print(o)

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int,input().split())
    if m == -1 and f == -1 and r == -1:break
    elif m == -1 or f == -1:print("F")
    elif (m + f) >= 80:print("A")
    elif (m + f) >= 65:print("B")
    elif (m + f) >= 50:print("C")
    elif (m + f) >= 30:
        if r >= 50:print("C")
        else:print("D")
    else:print("F")

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int,input().split())
    if(m==-1 and f==-1 and r==-1):
        exit()
    if (m==-1 or f==-1):
        print("F")
        continue
    if(m+f>=80):
        print("A")
    elif(m+f>=65):
        print("B")
    elif(m+f>=50):
        print("C")
    elif(m+f>=30):
        if(r>=50):
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
while True:
  m, f, r = map(int, input().split())

  if m == f == r == -1:
    break
  else:
    if m == -1 or f == -1:
      print('F')
    elif 80 <= (m + f):
      print('A')
    elif 65 <= (m + f):
      print('B')
    elif 50 <= (m + f):
      print('C')
    elif 30 <= (m + f):
      if 50 <= r:
        print('C')
      else:
        print('D')
    else:
      print('F')

Submission status: Accepted

Solution code:
while 1:
    m,f,r = map(int,input().split())
    t = m + f
    if t == -2 and r == -1:break
    elif m==-1 or f == -1 or t<30:print("F")
    elif t<50>r:print("D")
    elif t < 65:print("C")
    elif t < 80 :print("B")
    else:print("A")

Submission status: Accepted

Solution code:
def grading_student(scores):
    
    for i, score in enumerate(scores):

        grade = ""
        total = score[0] + score[1]
        
        if score[0] == -1 or score[1] == -1:
            grade = "F"

        elif total >= 80:
            grade = "A"

        elif 65 <= total < 80:
            grade = "B"
            
        elif 50 <= total < 65:
            grade = "C"
        
        elif 30 <= total < 50:
            if score[2] >= 50:
                grade = "C"
            else:
                grade = "D"
        elif total < 30:
            grade = "F"

        print(grade, end="")

        #if i != len(scores) - 1:
        print("\n", end="")


if __name__ == "__main__":
    

    # create score list
    score = list()
    
    while(True):

        param = input().split(" ")

        s = [ int(a) for a in param ]

        if s[0] == -1 and s[1] == -1 and s[2] == -1:
            break
        else:
            score.append(s)
            

    grading_student(score)

Submission status: Accepted

Solution code:
while True:
    a, b, r = map(int, input().split())
    result = a + b
    if a == b == r == -1:
        break
    if a == -1 or b == -1:
        print("F")
        continue
   
    if result >= 80:
        print("A")
    elif 65 <= result < 80:
        print("B")
    elif 50 <= result < 65:
        print("C")
    elif 30 <= result < 50:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
while(True):
    m,f,r=map(int,input().split())
    if(m==-1 and f==-1 and r==-1):
        break
    elif(m==-1 or f==-1):
        print("F")
    elif(m+f>=80):
        print("A")
    elif(m+f>=65):
        print("B")
    elif(m+f>=50 or r>=50):
        print("C")
    elif(m+f>=30):
        print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
while True:
    m, f ,r = map(int,input().split())
    if m + f + r == -3:
        exit()
    res = ""
    p = m + f
    if (30 > p) or m == -1 or f == -1:
        res = "F"
    elif p >= 80:
        res = "A"
    elif 80 > p >= 65:
        res = "B"
    elif (65 > p >= 50) or ((50 > p >= 30) and r >= 50):
        res = "C"
    elif 50 > p >= 30:
        res = "D"

    print(res)

Submission status: Accepted

Solution code:
while True:
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break
    if m==-1 or f==-1 or m+f<30:
        print('F')
    elif m+f<50:
        if r>=50:
            print('C')
        else:
            print('D')
    elif m+f<65:
        print('C')
    elif m+f<80:
        print('B')
    else:
        print('A')

Submission status: Accepted

Solution code:
x = 0
list2=[]
for n in range(50):
    list1 = input().split()
    m = int(list1[0])
    n = int(list1[1])
    r = int(list1[2])
    s = m+n
    if m==n==r==-1:
        break
    elif m==-1 or n==-1:
        list2.append('F')
    else:
        if s>=80:
            list2.append('A')
        elif 65<=s<80:
            list2.append('B')
        elif 50<=s<65 or (30<=s<50 and r>=50):
            list2.append('C')
        elif 30<=s<50 and r<50:
            list2.append('D')
        else:
            list2.append('F')
    x += 1

for i in range(x):
    print(list2[i])

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    elif m == -1 or f == -1:
        print("F")
    elif m+f >= 80:
        print("A")
    elif m+f >= 65:
        print("B")
    elif m+f >= 50:
        print("C")
    elif m+f >= 30:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
while True:
    mid, final, makeup = list(map(int, input().split(" ")))
   
    if mid == -1 and final == -1 and makeup == -1:
        break
    elif mid == -1 or final == -1:
            print("F")
    else:
        if mid + final >= 80:
            print("A")
        elif mid + final >=65:
            print("B")
        elif mid + final >= 50:
            print("C")
        elif mid + final >=30:
            if makeup >= 50:
                print("C")
            else:
                print("D")
        
        else:
            print("F")

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int,input().split())
    if m==f==r==-1:
        break
    if m==-1 or f==-1:
        print('F')
    elif m+f>=80:
        print('A')
    elif m+f>=65:
        print('B')
    elif m+f>=50:
        print('C')
    elif m+f>=30:
        if r>=50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
while True:
    data = input().split()
    m = int(data[0])
    f = int(data[1])
    r = int(data[2])
    ans = ""

    if m==-1 and f==-1 and r==-1:
        break

    if m==-1 or f==-1:
        ans = "F"
    elif m+f >= 80:
        ans = "A"
    elif m+f >= 65:
        ans="B"
    elif m+f >= 50:
        ans="C"
    elif m+f >= 30:
        if r >= 50:
            ans="C"
        else:
            ans="D"
    else:
        ans = "F"

    print(ans)

Submission status: Accepted

Solution code:
D = map(int, open(0).read().split()[:-3])
for m, f, r in zip(*[iter(D)]*3):
    if m < 0 or f < 0 or m + f < 30:
        print('F')
    elif m + f < 50 and r < 50:
        print('D')
    elif m + f < 65 or (m + f < 50 and r >= 50):
        print('C')
    elif m + f < 80:
        print('B')
    else:
        print('A')