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:
students = []
cnt = 0
while True:
    m, f, r = map(int, input().split())
    if (m, f, r) == (-1, -1, -1):
        break
    else:
        students.append((m, f, r))
        cnt += 1

for i in range(cnt):
    m, f, r = students[i]
    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 or r >= 50:
        print('C')
    else:
        print('D')

Submission status: Accepted

Solution code:
def end_check(score):
    end_judge = False
    if(score.count("-1") == 3):
        return True
    return end_judge

def evalution_check(score):
    total_score= int(score[0]) + int(score[1])
    re_test_score = int(score[2])

    score_evalution = "F"

    if (score.count("-1") > 1):
        score_evalution = "F"
    elif (total_score >= 80):
        score_evalution = "A"
    elif (total_score >= 65):
        score_evalution = "B"
    elif (total_score >= 50 or re_test_score >= 50):
        score_evalution = "C"
    elif (total_score >= 30):
        score_evalution = "D"


    return score_evalution

def print_evalutions(evalutions):
    for evalution in evalutions:
        print(evalution)

evalutions =[]

while True:
    score = list(input().split())

    if(end_check(score)):
        break

    evalutions.append(evalution_check(score))

print_evalutions(evalutions)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

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

    m, f, r = map(int, input().split())
    while (m, f, r) != (-1, -1, -1):
        print(rank(m, f, r))
        m, f, r = map(int, input().split())

main()

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:
import sys
  
for s in sys.stdin:
    m,f,r = [ int(x) for x in s.split() ]
    if m == -1 and f == -1 and r == -1:
        break
    if m == -1 or f == -1:
        print('F')
    else:
        total = m+f
        if total >= 80:
            print('A')
        elif total >= 65 and total < 80:
            print('B')
        elif total >= 50 and total < 65:
            print('C')
        elif total >= 30 and total < 50:
            if r >= 50:
                print('C')
            else:
                print('D')
        elif total < 30:
            print('F')

Submission status: Accepted

Solution code:
for i in range(20000):
  m,f,r = map(int,input().split())
  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")
    elif (m+f)<30:
      print("F")

Submission status: Accepted

Solution code:
while True:
    scores = input().split()
    m = int(scores[0])
    f = int(scores[1])
    r = int(scores[2])
    if m==r==f==-1:
        break
    elif 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:
for i in range(50):
    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 >= 65:
        print("B")
    elif m+f >= 50 or r >= 50:
        print("C")
    else:
        print("D")

Submission status: Accepted

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

    k = m + f

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

    elif k >= 80:
        print("A")

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x=[int(k) for k in input().split()]
while x[0]!=-1 or x[1]!=-1 or x[2]!=-1:
    ans=x[0]+x[1]
    if x[0]==-1 or x[1]==-1:
        print('F')
    elif ans>=80:
        print('A')
    elif ans>=65:
        print('B')
    elif ans>=50 or (ans>=30 and x[2]>=50):
        print('C')
    elif ans>=30 and x[2]<50:
        print('D')
    else:
        print('F')
    x=[int(k) for k in input().split()]

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

    
    i += 1

Submission status: Accepted

Solution code:
evaluation = []
while True:
    mid, last, re = map(int, input().split(' '))
    if mid == last == re == -1:
        break
    if mid * last < 0 or mid + last < 30:
        evaluation.append('F')
    elif mid + last >= 80:
        evaluation.append('A')
    elif mid + last >= 65:
        evaluation.append('B')
    elif mid + last >= 50 or re >= 50:
        evaluation.append('C')
    else:
        evaluation.append('D')

for grade in evaluation:
    print(grade)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

    print(G)

Submission status: Accepted

Solution code:
total_sum=0

while 1:
    m,f,r=list(map(int, input().split()))
    total_sum=m+r+f
    mid_sum=m+f

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

Submission status: Accepted

Solution code:
while True:
    m,f,r=map(int,input().split(" "))
    if m+f+r==-3:
        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:
def eval_points(mid, term, re):
    if mid == -1 or term == -1:
        return 'F'
    sum = mid + term
    if sum >= 80:
        return 'A'
    elif sum >= 65:
        return 'B'
    elif sum >= 50 or re >= 50:
        return 'C'
    elif sum >= 30:
        return 'D'
    else:
        return 'F'
        

while True:
    mid, term, re = map(int, input().split())
    if mid == -1 and term == -1 and re == -1:
        break
    evaluation = eval_points(mid, term, re)
    print(evaluation)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
points = []
flag = True
while flag:
    points.append(list(map(int, input().split())))
    if points[-1][0] == points[-1][1] == points [-1][2] == -1:
        flag = False
points.pop()

for p in points:
    if p[0] == -1 or p[1] == -1:
        print('F')
    elif p[0] + p[1] >= 80:
        print('A')
    elif 65 <= p[0] + p[1] < 80:
        print('B')
    elif 50 <= p[0] + p[1] < 65:
        print('C')
    elif 30 <= p[0] + p[1] < 50 and p[2] >= 50:
        print('C')
    elif 30 <= p[0] + p[1] < 50:
        print('D')
    elif p[0] + p[1] <= 30:
        print('F')

Submission status: Accepted

Solution code:
m=0
f=0
r=0
m,f,r=map(int,input().split())
while m!=-1 or f!=-1 or r!=-1:
    if m!=-1 and f!=-1:
        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")
    else:
        print("F")
    m,f,r=map(int,input().split())

Submission status: Accepted

Solution code:
import sys

while True:
    m, f, r = [int(i) for i in input().split()]
    if m == -1 and f == -1 and r == -1:
        sys.exit()
    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:
m, f, r = [int(i) for i in input().split()]
while not all(i == -1 for i in (m, f, r)):
    if -1 in (m, f):
        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")
    else:
        print("F")
    m, f, r = [int(i) for i in 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
    if m == -1 or f == -1:
        print('F')
        continue
    if m + f >= 80:
        print('A')
        continue
    if m + f >= 65:
        print('B')
        continue
    if m + f >= 50:
        print('C')
        continue
    if m + f >= 30:
        if r >= 50:
            print('C')
        else:
            print('D')
        continue

    print('F')

Submission status: Accepted

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

for i in score:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def checker(m, f, r):
    if score >= 80:
        print('A')
    elif score < 30:
        print('F')
    elif score >=65 and score < 80:
        print('B')
    elif score >=30 and score < 50 and r < 50:
        print('D')
    else:
        print('C')

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:
        score = m + f
        checker(m, f, r)

Submission status: Accepted

Solution code:
class Student:
    def __init__(self, m, f, r):
        self.m = m
        self.f = f
        self.r = r


    def judge(self):
        if self.m == -1 or self.f == -1:
            return 'F'

        total = self.m + self.f
        if total >= 80:
            return 'A'

        if 65 <= total < 80:
            return 'B'

        if 50 <= total < 65:
            return 'C'

        if 30 <= total < 50:
            if self.r >= 50:
                return 'C'
            else:
                return 'D'

        return 'F'


students = []

while True:
    m, f, r = tuple(map(int, input().split(' ')))
    if m == -1 and f == -1 and r == -1:
        break
    students.append(Student(m, f, r))

for student in students:
    print(student.judge())

Submission status: Accepted

Solution code:
while True:
    a = [int(x) for x in input().split()]
    if a[0] == -1 and a[1] == -1 and a[0] == -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] >= 65:
        print("B")
    elif a[0] + a[1] >= 50 or a[2] >= 50:
        print("C")
    elif a[0] + a[1] >= 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
    elif (m == -1 or f == -1) or (m + f < 30):
        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')

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 = [int(x) for x in input().split()]
    
    if m == -1 and f == -1 and r == -1:
        break
    
    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:
    s = input().split()
    m = int(s[0])
    f = int(s[1])
    r = int(s[2])
    
    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 and r>=50:
        print("C")
    elif sum>=30 and sum<50:
        print("D")
    elif sum<30:
        print("F")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding: utf-8

while True:
    m, f, r = map(int, input().split())
    s = m + f
    if s + r == -3:
        break
    elif m == -1 or f == -1:
        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')
    elif s >= 30:
        print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
def test():

	# Define the output array
	output = [0] * 50
	num_student = 0

	#A:0
	#B:1
	#C:2
	#D:3
	#F:4
	#NaN:5

	while True:

		# Input stream
		inputs = list(map(int,input().split()))
		
		# exit condition
		if inputs[0] == -1 and inputs[1] == -1 and inputs[2] == -1:
			output[num_student] = 5
			break

		# First condition - F
		if inputs[0] == -1 or inputs[1] == -1:
			output[num_student] = 4
			num_student += 1
			continue
		# Second condition - A
		elif (inputs[0] + inputs[1]) >= 80:
			output[num_student] = 0
			num_student += 1
			continue
		# Third condtion - B
		elif (inputs[0] + inputs[1]) >= 65:
			output[num_student] = 1
			num_student += 1
			continue
		# Fourth condtion - C
		elif (inputs[0] + inputs[1]) >= 50:
			output[num_student] = 2
			num_student += 1
			continue
		# Fifth condition - D or C
		elif (inputs[0] + inputs[1]) >= 30:
			output[num_student] = 3
			if inputs[2] >= 50:
				output[num_student] = 2
			num_student += 1
			continue
		# Sixth condition - F
		else:
			output[num_student] = 4
			num_student += 1
			continue

	for i in range(num_student):
		if output[i] == 0:
			print("A")
		elif output[i] == 1:
			print("B")
		elif output[i] == 2:
			print("C")
		elif output[i] == 3:
			print("D")
		elif output[i] == 4:
			print("F")


if __name__ == "__main__":
	test()

Submission status: Accepted

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

Submission status: Accepted

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