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:
while 1:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    sum = m + f

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

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int,input().split())
    grade = ""
    if m == f == r == -1:
        break
    
    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:
        grade ="F"
    elif r >= 50:
        grade = "C"
    else:
        grade = "D"
        
    print(grade)

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 and (m + f) < 80:
        print("B")
    elif (m + f) >= 50 and (m + f) < 65:
        print("C")
    elif (m+f) < 30:
        print("F")
    else:
        if r < 50:
            print("D")
        else:
            print("C")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    m,f,r =input().split()
    a = int(m) + int(f)
    if m == '-1' or f == '-1':
        if m == f == r == '-1':break
        else:                       print('F')
    elif a >= 80:                   print('A')
    elif 65 <= a < 80:          print('B')
    elif 50 <= a < 65:          print('C')
    elif 30 <= a < 50:
        if int(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
    sumnumber=m+f
    if m==-1 or f == -1:
        print("F")
    elif sumnumber>=80:
        print("A")
    elif sumnumber>=65:
        print("B")
    elif sumnumber>=50:
        print("C")
    elif sumnumber>=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())
	if a == -1 and b == -1 and c == -1:
		break
	elif a == -1 or b == -1:
		print("F")
	elif 80 <= a + b:
		print("A")
	elif 65 <= a + b:
		print("B")
	elif 50 <= a + b:
		print("C")
	elif 30 <= a + b:
		if c  < 50:
			print("D")
		else:
			print("C")
	else:
		print("F")

Submission status: Accepted

Solution code:
while 1:
 m,f,r=map(int,input().split());s=m+f
 if r<0>s:break
 print('F'if(m*f<0)+(s<30)else'D'if s<50>r else'C'if s<65 else'B'if s<80 else'A')

Submission status: Accepted

Solution code:
mlist = []
flist = []
rlist = []
 
while(1):
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    mlist.append(m)
    flist.append(f)
    rlist.append(r)

for m, f, r in zip(mlist, flist, rlist):
    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:
        if 50 <= r:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
import sys,os,re
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate
sys.setrecursionlimit(10**6)

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

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 < 30:
        ans.append("F")
    elif 30 <=  m + f < 50:
        if r < 50:
            ans.append("D")
        else:
            ans.append("C")
    elif 50 <= m + f < 65:
        ans.append("C")
    elif 65 <= m + f < 80:
        ans.append("B")    
    else:
        ans.append("A")

for a in ans:
    print(a)

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:
ans = []
while True:
    m,f,r = map(int,input().split())
    x = m+f
    if m==-1 and f==-1 and r==-1:
        break
    
    if m==-1 or f==-1:
        ans.append('F')  
    elif x>=80:
        ans.append('A')
    elif x>=65 and x<80:
        ans.append('B')
    elif x>=50 and x<65 or r>=50:
        ans.append('C')
    elif x>=30 and x<50:
        ans.append('D')
    elif x<30:
        ans.append('F')
        
for i in range(len(ans)):
    print(ans[i])

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, input().split())
    if (m, f, r) == (-1, -1, -1):
        break
    if m == -1 or f == -1:
        grade = "F"
    else:
        total = m + f
        if 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:
a=[]
w=""
while(w!="-1 -1 -1"):
    w=input()
    a.append(w)
a.pop()
for st in a:
    s=st.split()
    m=int(s[0])
    f=int(s[1])
    r=int(s[2])
    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 and r<50):
        print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
list_gra = []
while True:
    m, f, r = list(map(int, input().split()))
    if m == -1 and f == -1 and r == -1:
        break
    list_gra.append([m, f, r])
for count in range(len(list_gra)):
    if list_gra[count][0] >= 0 and list_gra[count][1] >= 0:
            if sum(list_gra[count][: 2]) >= 80:
                print("A")
            elif 65 <= sum(list_gra[count][: 2]) < 80:
                print("B")
            elif 50 <= sum(list_gra[count][: 2]) < 65:
                print("C")
            elif 30 <= sum(list_gra[count][: 2]) < 50 and list_gra[count][2] < 50:
                print("D")
            elif 30 <= sum(list_gra[count][: 2]) < 50 and list_gra[count][2] >= 50:
                print("C")
            elif 0 <= sum(list_gra[count][: 2]) < 30:
                print("F")
    else:
        print("F")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

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

Submission status: Accepted

Solution code:
def grade(m, f, r):
    if m == -1 or f == -1:
        return 'F'

    if 80 <= m+f:
        return 'A'

    if 65 <= m+f < 80:
        return 'B'

    if 50 <= m+f < 65:
        return 'C'

    if 30 <= m+f < 50:
        if 50 <= r:
            return 'C'
        else:
            return 'D'

    return 'F'

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

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

    print(grade(m, f, r))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
lilis = []
count = 0
try:
  while True:
    lis = list(map(int,input().split()))
    if lis[0]==lis[1]==lis[2]==-1:
      break
    lilis.append(lis)
    count +=1
  for i in range(count):
    if lilis[i][0]+lilis[i][1]>=80:
      print("A")
    
    elif 80>lilis[i][0]+lilis[i][1]>=65:
      print("B")
      
    elif 65>lilis[i][0]+lilis[i][1]>=50:
      print("C")
      
    elif 50>lilis[i][0]+lilis[i][1]>=30:
      if lilis[i][0]==-1 or lilis[i][1]==-1:
        print("F")
      else:
        if lilis[i][2]>=50:
          print("C")
        else:
          print("D")
    elif 30>lilis[i][0]+lilis[i][1]:
      print("F")
      
except EOFError:
  pass

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
	[m, f, r] = [int(i) for i 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 65 <= m + f and m + f < 80:
		print('B')
	elif 50 <= m + f and m + f < 65:
		print('C')
	elif 30 <= m + f and m + f < 50 and 50 <= r:
		print('C')
	elif 30 <= m + f < 50:
		print('D')
	else:
		print('F')

Submission status: Accepted

Solution code:

while True:

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

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


    ans = ""

    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:
A=list()

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

Submission status: Accepted

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

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 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 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 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:
def evaluate_grade(m: int, f: int, r: int) -> str:
    if (m == -1 or f == -1):
        if (50 <= r):
            return "C"
        else:
            return "F"

    total_score: int = m + f
    if (80 <= total_score):
        return "A"
    elif (65 <= total_score < 80):
        return "B"
    elif (50 <= total_score < 65):
        return "C"
    elif (30 <= total_score < 50):
        if (50 <= r):
            return "C"
        else:
            return "D"
    else:
        return "F"


if __name__ == "__main__":
    datasets = []

    while(True):
        m, f, r = map(lambda x: int(x), input().split())

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

        datasets.append([m, f, r])

    for (m, f, r) in datasets:
        print(f"{evaluate_grade(m, f, r)}")

Submission status: Accepted

Solution code:
while True:
    try:
        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")
        elif m + f < 30:
            print("F")
        
            

    except:
        break

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 or (m + f) < 30:
        print ("F")
    elif (m + f) >= 80:
        print ("A")
    elif (m + f) < 80 and (m + f) >= 65:
        print ("B")
    elif (m + f) < 65 and (m + f) >= 50:
        print ("C")
    elif (m + f) < 50 and (m + f) >= 30 and r >= 50:
        print ("C")
    else:
        print ("D")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    value = list(map(int, str(input()).split()))
    if value[0] == -1 and value[1] == -1 and value[2] == -1:
        break



    sum = value[0] + value[1]

    if value[0] == -1 or value[1] == -1:
        print("F")
    elif sum >= 80:
        print("A")
    elif sum >= 65:
        print("B")
    elif sum >= 50:
        print("C")
    elif value[2] >= 50:
        print("C")
    elif sum >= 30:
        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
    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())
    if a==-1:
        if b==-1:
            if c==-1:
                break
        grade="F"
    elif b==-1:
        grade='F'
    else:
        if a+b>=80:
            grade='A'
        elif a+b>=65 and a+b<80:
            grade='B'
        elif a+b>=50 and a+b<65:
            grade='C'
        elif a+b>=30 and a+b<50:
            if c>=50:
                grade='C'
            else:
                grade='D'
        elif a+b<30:
            grade='F'
    print(grade)

Submission status: Accepted

Solution code:
for _ in range(50):
    m, f, r = map(int, input().split())
    total = m + f
    if m == -1 and  f == -1 and r == -1:
        break
    elif m == -1 or f == -1:
        print('F')
    elif total >=80:
        print('A')
    elif total >= 65:
        print('B')
    elif total >= 50:
        print('C')
    elif total >= 30 and r >= 50:
        print('C')
    elif total >= 30:
        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

    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:
        if 50 <= r:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

    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 80>m+f and m+f>=65:
        print("B")
    elif 65>m+f and m+f>=50:
        print("C")
    elif 50>m+f and m+f>=30:
        if r>=50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def grade(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 "F"
	if r >= 50: return "C"
	return "D"

while True:
	m,f,r = map(int, input().split())
	if m == -1 and f == -1 and r == -1: 
		break
	print(grade(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
  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:
    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

 if m == -1 or f == -1:
   print("F")

 elif m == -1: m = 0
 elif f == -1: f = 0

 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:

m,f,r = 0,0,0
result = []
count = 0
while True:
    count+=1
    m,f,r = map(int,input().split())
    if m == -1 and f == -1 and r == -1:
        break
    if m == -1 or f == -1:
        result.append("F")
        continue
    elif 80 <= m+f:
        result.append("A")
        continue
    elif 65 <= m+f < 80:
        result.append("B")
        continue
    elif 50 <= m+f < 65:
        result.append("C")
        continue
    elif 30 <= m+f < 50:
        if 50 <= r:
            result.append("C")
            continue
        else:
            result.append("D")
            continue
    else:
        result.append("F")

for i in range(count-1):
    print(result[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
  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 and 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 and m==-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:
    m, f, r = map(int, input().split())
    if m == f == r == -1:
        break
    
    if m == -1 or f == -1 or m + f < 30:
        print('F')

    elif 80 <= m + f:
        print('A')

    elif 65 <= m + f:
        print('B')

    elif 50 <= m + f:
        print('C')

    elif 30 <= m + f:
        print('DC'[50 <= 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
    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 = input()
    b = a.split()
    m = int(b[0])
    f = int(b[1])
    r = int(b[2])
    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:
		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 and r >=50:
		print("C")
	elif m+f>=30:
		print("D")
	else:
		print("F")

Submission status: Accepted

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

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(65 <= m + f and m + f < 80) :
   print("B")
 elif(50 <= m + f and m + f < 65) :
   print("C")
 elif(30 <= m + f and 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, f, r) == (-1, -1, -1):
        break
    if m == -1 or f == -1:
        print("F")
    elif m+f >= 80:
        print("A")
    elif m+f >= 65 and m+f < 80:
        print("B")
    elif m+f >= 50 and m+f < 65:
        print("C")
    elif m+f >= 30 and m+f < 50:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")