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 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 and r >=50:
        print("C")
    elif (m+f)>=30:
        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+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')

Submission status: Accepted

Solution code:
def judge():
    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")

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

Submission status: Accepted

Solution code:

while True:
	arr = list(map(int, input().split()))
	m = arr[0]
	f = arr[1]
	r = arr[2]
	
	if m == -1 and f == -1 and r == -1:
		break
	
	total = m + f
	if 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:
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:
        if r >= 50:
            return 'C'
        else:
            return 'D'
    return 'F'

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Grading

end = 0
while end == 0:
    test = [int(i) for i in input().rstrip().split()]
    midterm = test[0]
    final = test[1]
    makeup = test[2]
    if midterm == -1 and final == -1 and makeup == -1:
        end += 1
    elif midterm == -1 or final == -1:
        print('F')
    else:
        if midterm + final >= 80:
            print('A')
        elif midterm + final >= 65:
            print('B')
        elif midterm + final >= 50:
            print('C')
        elif midterm + 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==-1 or f == -1):
        if (m == -1 and f == -1 and r == -1):
            break
        else:
            print('F')
    else:
        score = m + f
        if(score >= 80):
            print('A')
        elif(score >= 65):
            print('B')
        elif(score >= 50):
            print('C')
        elif(score >= 30):
            if(r >= 50):
                print('C')
            else:
                print('D')
        else:
            print('F')

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

Submission status: Accepted

Solution code:
import sys

i = 0
for line in sys.stdin:
    m,f,r = line.split()
    m,f,r = int(m),int(f),int(r)

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

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int, raw_input().split())
    s = m + f
    if m == -1 and f == -1 and r == -1: break
    elif m == -1 or f == -1 or s < 30: g=5
    elif 30 <= s and s < 50:
        if r >= 50: g=2
        else: g=3
    elif 50 <= s and s < 65: g=2
    elif 65 <= s and s < 80: g=1
    else: g=0
    print 'ABCDEF'[g]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from __future__ import division, print_function
from sys import stdin
while True:
    m, f, r = (int(s) for s in stdin.readline().split())
    if m < 0 and f < 0 and r < 0:
        break
    mf = m + f
    if m < 0 or f < 0 or mf < 30:
        print('F')
    elif mf >= 80:
        print('A')
    elif mf >= 65:
        print('B')
    elif mf >= 50 or r >= 50:
        print('C')
    else:
        print('D')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
	a, b, c = map(int, raw_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:
		print "C"
	elif (a + b) < 30:
		print "F"
	elif c >= 50:
		print "C"
	else:
		print "D"

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int,raw_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 (m+f >=30 and r >=50):
        print "C"
    elif m+f >=30:
        print "D"
    else:
        print "F"

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, raw_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:
while True:
	m, f, r = map(int, raw_input().split())
	if m + f + r == -3: 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 = 'C' if r >= 50 else 'D' 
	elif m + f < 30:
		grade = 'F'
	print grade

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b,c=map(int,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 80>a+b>=65:
            print('B')
        elif 65>a+b>=50:
            print('C')
        elif 50>a+b>=30:
            if c>=50:
                print('C')
            else:
                print('D')
        else:
            print('F')
    a,b,c=map(int,input().split())

Submission status: Accepted

Solution code:
while True:
    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:
        print("B")
    elif sum>=50:
        print("C")
    elif sum>=30:
        if r>=50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
while True:
    x = []
    x = input().split( )
    y = [int(s) for s in x]
    if sum(y) == -3:
        break
    if y[0] == -1 or y[1] == -1:
        print("F")
    elif y[0] + y[1] < 30:
        print("F")
    elif y[0] + y[1] >= 30 and y[0] + y[1] <50:
        if y[2] >= 50:
            print("C")
        else:
            print("D")
    elif  y[0] + y[1] >= 50 and y[0] + y[1] <65:
        print("C")
    elif  y[0] + y[1] >= 65 and y[0] + y[1] <80:
        print("B")
    elif  y[0] + y[1] >= 80:
        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
	sum=m+f
	if m==-1 or f==-1:
		print("F")
	elif sum>=80:
		print("A")
	elif sum>=65:
		print("B")
	elif sum>=50:
		print("C")
	elif sum>=30:
		if r>=50:
			print("C")
		else:
			print("D")
	else:
		print("F")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=[]
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:
        s.append('F')
        continue
    elif m+f>=80:
        s.append('A')
        continue
    elif m+f>=65 and m+f<80:
        s.append('B')
        continue
    elif m+f>=50 and m+f<65:
        s.append('C')
        continue
    elif m+f>=30 and m+f<50:
        if r>=50:
            s.append('C')
        else:
            s.append('D')
        continue
    elif m+f<30:
        s.append('F')

for i in range(len(s)):
    print(s[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 80>(m+f)>=65:
        print('B')
    elif 65>(m+f)>=50 :
        print('C')
    elif 50>(m+f)>=30:
        if r>=50:
            print('C')
        else:
            print('D')
    elif r>=50:
        print('C')
    elif m+f<30:
        print('F')
    
    else:
        pass

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while(True):
    val1 = input().split(" ")
    m,f,r = [int(i) for i in val1]
    
    if m == -1 and f == -1 and r == -1:
        break
    

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

Submission status: Accepted

Solution code:
while True:
    num_str = input().split()
    m, f, r = [int(i) for i in num_str]
    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("D")
        else:
            print("C")
    else:
        print("F")

Submission status: Accepted

Solution code:
list_m=[]
list_f=[]
list_r=[]
while True:
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break
    else:
        list_m.append(m)
        list_f.append(f)
        list_r.append(r)

for i in range(len(list_m)):
    M=list_m[i]
    F=list_f[i]
    R=list_r[i]
    score=M+F
    if M==-1 or F==-1:
        grade="F"
    elif score>=80:
        grade="A"
    elif 65<= score <80:
        grade="B"
    elif 50<= score <65:
        grade="C"
    elif 30<= score <50:
        if R>=50:
            grade="C"
        else:
            grade="D"
    else:
        grade="F"
    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
    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')
            
    elif m+f<30: 
        print('F')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

for i in data:
  print(i)

Submission status: Accepted

Solution code:
def grade(half, end, reexam):
    points = half + end
    if half == -1 or end == -1:
        return 'F'
    else:    
        if points >= 80:
            return 'A'
        elif points >= 65:
            return 'B'
        elif points >= 50:
            return 'C'
        elif points >= 30:
            if reexam >= 50:
                return 'C'
            else:
                return 'D'
        else:
            return 'F'

while 1:
    half, end, reexam = map(int, input().split())
    if half == end == reexam == -1:
        break
    else:
        print(grade(half, end, reexam))

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")
    elif(30>=m+f):
        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 <= 100):
        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")
    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):
        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")
    elif(m+f < 30):
        print("F")