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:
l=[]
while 1:
    l_=[int(x) for x in input().split()]
    if l_==[-1,-1,-1]:
        break
    l.append(l_)
for i in l:
    if i[0]==-1 or i[1]==-1:
        print("F")
    elif i[0]+i[1]>=80:
        print("A")
    elif i[0]+i[1]<80 and i[0]+i[1]>=65:
        print("B")
    elif i[0]+i[1]<65 and i[0]+i[1]>=50:
        print("C")
    elif i[0]+i[1]<50 and i[0]+i[1]>=30 and i[2]>=50:
        print("C")
    elif i[0]+i[1]<50 and i[0]+i[1]>=30 and i[2]<50:
        print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools
sys.setrecursionlimit(100001)

# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

str_list = []

while True:
    mid, term, make= map(int, input().split())
    if mid == -1 and term == -1 and make == -1:
        break

    if mid == -1 or term == -1:
        str_list.append("F")
        continue

    score = mid+term
    if score < 30:
        str_list.append("F")
    elif score < 50:
        if make >= 50:
            str_list.append("C")
        else:
            str_list.append("D")
    elif score < 65:
        str_list.append("C")
    elif score < 80:
        str_list.append("B")
    else:
        str_list.append("A")

for i in range(len(str_list)):
    if i == len(str_list)-1:
        print(str_list[i])
    else:
        print(str_list[i])

Submission status: Accepted

Solution code:
while True:
  s = input().rstrip().split(' ')
  m = int(s[0])
  f = int(s[1])
  r = int(s[2])
  sum = m + f
  if m == -1 and f == -1 and r == -1:
    break;
  elif m == -1 or f == -1:
    print("F")
  elif sum >= 80:
    print("A")
  elif sum < 80 and sum >= 65:
    print("B")
  elif sum < 65 and sum >= 50:
    print("C")
  elif sum < 50 and sum >= 30:
    if r >= 50:
      print("C")
    else:
      print("D")
  elif sum < 30:
    print("F")

Submission status: Accepted

Solution code:
m, f, r = 0, 0, 0 
dataset = []
while True:
    m, f, r = map(int, input().split())
    if m == f == r == -1:break
    dataset.append([m, f, r])
for data in dataset:
    m, f, r = data[0], data[1], data[2]
    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 (m + f >= 30 and r >= 50):
        print('C')
    else:
        print('D')

Submission status: Accepted

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

for result in results:
    m, f, r = result[0], result[1], result[2]
    if m == -1 or f == -1:
        print("F")
        continue
        
    # 中間試験と期末試験の合計点数が 80 以上ならば成績は A 。
    if m + f >= 80:
        print("A")
    elif m + f >= 65:
        print("B")
    elif m + f >= 50:
        print("C")
    elif m + f >= 65:
        print("B")
    elif m + f >= 30:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
import bisect,collections,copy,itertools,math,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
while 1:
    m,f,r = LI()
    if m==f==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 or 50<=r:
        print('C')
    elif 30<=m+f:
        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+f>=80:
        print("A")
    elif m==-1 or f==-1:
        print("F")
    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")
    else:
        print("F")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

while True:
    lst = list(map(int, input().split()))
    total = lst[0] + lst[1]

    ans = ''
    if sum(lst) == -3:
        sys.exit(0)
    if lst[0] == -1 or lst[1] == -1:
        print('F')
        continue

    if total >= 80:
        ans = 'A'
    elif 65 <= total < 80:
        ans = 'B'
    elif 50 <= total < 65:
        ans = 'C'
    elif 30 <= total < 50:
        if lst[2] >= 50:
            ans = 'C'
        else:
            ans = 'D'
    elif 0 <= total <= 30:
        ans = 'F'
    else:
        pass
    
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for i in grad:
    print(i)

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

Submission status: Accepted

Solution code:
a = []
while True:
    m,f,r = map(int, input().split())
    if m == f == r == -1:
        break
    s = m + f
    if 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:
while True:
    m, f, r = map(int, input().split())
    if m == f == r == -1:
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in result_score:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = 0
student = []
while True:
  m,f,r = map(int, input().split())

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

for i in range(n):
  print(str(student[i]))

Submission status: Accepted

Solution code:
count = 0
info = []
ans = []
while True:
  info.append(list(map(int, input().split())))
  if info[count][0] == -1 and info[count][1] == -1 and info[count][2] == -1:
    break
  count += 1
for i in info:
  if (i[0] + i[1]) < 30 or i[0] == -1 or i[1] == -1:
    ans.append("F")
  elif 80 <=(i[0] + i[1]):
    ans.append("A")
  elif 65 <= (i[0] + i[1]) < 80:
    ans.append("B")
  elif 50 <= (i[0] + i[1]) < 65:
    ans.append("C")
  elif 30 <= (i[0] + i[1]) < 50:
    if 50 <= i[2]: 
      ans.append("C")
    else:
      ans.append("D")
  else:
    ans.append("F")
ans.pop()
for j in ans:
  print(j)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    m, f, r = list(map(int, input().split()))
    if m == -1 and f == -1 and r == -1:
        break
    elif 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:
    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:
test_list = list()
while True:
    test = list(map(int,input().split()))
    if test == [-1,-1,-1]:
        break
    test_list.append(test)

for test in test_list:
    m = test[0]
    f = test[1]
    r = test[2]
    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')
    elif m + f < 30:
        print('F')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    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")
        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")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
while True:
    x = list(map(int,input().split()))
    a = x[0]
    b = x[1]
    c = x[2]

    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")
    else:
        print("F")

Submission status: Accepted

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

for i in range(len(score)):
    m, f, r = score[i][0], score[i][1], score[i][2]
    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())
  #m,f,r = 50, 40, 30
  s = m + f
  
  if m == -1 and f == -1:
  	break

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

  print(grade)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    total = m + f
    if total >= 80:
        return "A"
    elif 65 <= total < 80:
        return "B"
    elif 50 <= total < 65:
        return "C"
    elif 30 <= total < 50:
        if 50 <= r:
            return "C"
        else:
            return "D"
    else:
        return "F"


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


for i in range(0,count):
    print(ans[i])

Submission status: Accepted

Solution code:
for _ in range(50):
    m, f, r = [int(x) for x in 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: print('C')
    elif m + f >= 30:
        if r >= 50: print('C')
        else: print('D')
    else: print('F')

Submission status: Accepted

Solution code:
import sys
# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

while 1:
    m, f, r = map(int, readline().split())
    if m == -1 and f == -1 and r == -1:
        break
    s = m + f
    if 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:
        if r >= 50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

    grade = None
    if m < 0 or f < 0:
        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 = "D"
        if r >= 50:
            grade = "C"
    else:
        grade = "F"
    print(grade)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys

#n= int(input())
#tmp= float(input())
while(1):
    tmp = input().split()
    m,f,r = list(map(lambda a: int(a), tmp))

    if((m==-1)and(f==-1)and(r==-1)):
        sys.exit()

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

Submission status: Accepted

Solution code:
cnt = 1
while(cnt <= 50):
    d_set = input()
    d_set = d_set.split()
    m,f,r = d_set
    m,f,r = int(m),int(f),int(r)

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

    
    cnt += 1