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

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

Submission status: Accepted

Solution code:
while 1:
	m, f, r = map(int, raw_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:
def grade(score_list):
    chukan = score_list[0]
    kimatu = score_list[1]
    saishi = score_list[2]
    pre_score = chukan + kimatu
    if chukan == -1 or kimatu == -1 or pre_score < 30:
        return "F"
    elif pre_score >= 80:
        return "A"
    elif 65 <= pre_score < 80:
        return "B"
    elif 50 <= pre_score < 65:
        return "C"
    elif 30 <= pre_score < 50:
        if saishi >= 50:
            return "C"
        else:
            return "D"

while True:
    score = list(map(int, list(input().split())))
    if score[0] == -1 and score[1] == -1 and score[2] == -1:
        break
    else:
        rate = grade(score)
        print(rate)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8
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:
        print 'C'
    elif m + f >= 30:
        if r >= 50:
            print 'C'
        else:
            print 'D'
    else:
        print 'F'

Submission status: Accepted

Solution code:
def solve(m, f, r):
    if (m == -1 or f == -1) or m + f < 30:
        return "F"
    for a, b in ((80, "A"), (65, "B"), (50, "C")):
        if m + f >= a:
            return b
    if r >= 50:
        return "C"
    return "D"
while True:
    m, f, r = map(int, input().split())
    if m == f == r == -1:
        break
    print(solve(m, f, r))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while(1):
    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"
    if m == -1:
        m = 0
    elif f == -1:
        f = 0

    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) = input().rstrip('\r\n').split(' ')
  m = int(m)
  f = int(f)
  r = int(r)
  if m == -1 and f == -1 and r == -1:
    break

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

  mf = m + f

  if 80 <= mf:
    print('A')
  elif 65 <= mf and mf < 80:
    print('B')
  elif 50 <= mf and mf < 65:
    print('C')
  elif 30 <= mf and mf < 50:
    if 50 <= r:
      print('C')
    else:
      print('D')
  else:
    print('F')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 or (30 <= x+y < 50 and z >= 50):
        print ('C')
    elif 30 <= x+y < 50:
        print ('D')
    elif x + y < 30:
        print ('F')

Submission status: Accepted

Solution code:
'''
先に基準を変数で設定して、whileで回すと見た目もきれいだし、あとから調整も楽。
ついでだからclass化する？しなくてもいいけど。
while意味ない
'''
s = []

while True:
    t = input()
    if t == "-1 -1 -1":
        break
    else:
        s.append(list(map(int, t.split())))
        
#print(r)

#テスト値。リストにしておかないとインプットがうまくいかなくなるはず。
#s = [[20,20,40],[40,40,-1],[-1,50,60]]

#80,65,50,30
a, b, c, d = 80, 65, 50, 30

g = []

for i in range(len(s)):
    r = s[i][0] + s[i][1]
    
    if s[i][0]==-1 or s[i][1]==-1:
        g.append("F")
        #break
    elif r >= a:
        g.append("A")
    elif r >= b:
        g.append("B")
    elif r >= c:
        g.append("C")
    elif r >= d:
        if s[i][2] >= 50:
            g.append("C")
        else:
            g.append("D")
    else:
        g.append("F")
    
[print(g[i]) for i in range(len(g))]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int,input().split())
    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")
    elif m + f >= 0:
        print("F")

Submission status: Accepted

Solution code:
from sys import stdin
for line in stdin:
    mid, final, make = map(int, line.split())
    if mid == -1 and final == -1 and make == -1:
        break
    elif mid == -1 or final == -1:
        print('F')
    elif mid + final >= 80:
        print('A')
    elif mid + final >= 65:
        print('B')
    elif mid + final >= 50:
        print('C')
    elif mid + final >= 30:
        if make >= 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")
    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:
#coding: utf-8

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

Submission status: Accepted

Solution code:
for _ in range(10000):
    res = list(map(int,input().split()))
    if res == [-1,-1,-1]:
        break
    su = res[0]+res[1]
    if su<30:
        gr="F"
    elif su<50:
        if res[2]>=50:
            gr="C"
        else:
            gr="D"
    elif su<65:
        gr="C"
    elif su<80:
        gr="B"
    else:
        gr="A"
    if res[0]==-1 or res[1]==-1:
        gr="F"
    print(gr)

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def grader(mid, fin, re):
    """ 
    -1 <= mid <= 50
    -1 <= fin <= 50
    0 <= re <= 100

    >>> grader(40, 42, -1)
    'A'
    >>> grader(20, 30, -1)
    'C'
    >>> grader(0, 2, -1)
    'F'
    """
    score = mid + fin 
    if mid == -1 or fin == -1 or score < 30: 
        return 'F' 
    elif score < 50: 
        if re >= 50: 
            return 'C' 
        else:
            return 'D' 
    elif score < 65: 
        return 'C' 
    elif score < 80: 
        return 'B' 
    else:
        return 'A' 


def run():
    while True:
        m, f, r = [int(x) for x in input().split()]

        if m == -1 and f == -1 and r == -1: 
            break
        else:
            print(grader(m, f, r)) 

run()

Submission status: Accepted

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

Submission status: Accepted

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



    sum = value[0] + value[1]

    if value[0] == -1 or value[1] == -1:
        print("F")
    elif sum >= 80:
        print("A")
    elif sum >= 65:
        print("B")
    elif sum >= 50:
        print("C")
    elif value[2] >= 50:
        print("C")
    elif sum >= 30:
        print("D")
    else:
        print("F")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

while True:
    n = sys.stdin.readline()[:-1]

    if n == '-1 -1 -1':
        break

    marks = [ int(m) for m in n.split() ]

    mt_points,retest = marks[0] + marks[1],marks[2]

    if -1 in marks[:-1]:
        print('F')
        continue
    elif mt_points >= 80:
        print('A')
        continue
    elif mt_points >= 65 and 80 > mt_points:
        print('B')
        continue
    elif mt_points >= 50 and 65 > mt_points:
        print('C')
        continue
    elif mt_points >= 30 and 50 > mt_points:
        if retest >= 50:
            print('C')
            continue
        print('D')
        continue
    elif 30 > mt_points:
        print('F')

Submission status: Accepted

Solution code:
while 1:
  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 or s < 30:
    print("F")
  elif s >= 80:
    print("A")
  elif s >= 65 and s < 80:
    print("B")
  elif s >= 50 and s < 65:
    print("C")
  elif s >= 30 and s < 50:
    if r < 50:
      print("D")
    else:
      print("C")

Submission status: Accepted

Solution code:
N=int(0)
i=int(0)
m,f,r,point=[],[],[],[]
while 1:
    point=list(map(int,input().split(' ')))
    m.append(point[0])
    f.append(point[1])
    r.append(point[2])
    if(m[i]==-1&f[i]==-1&r[i]==-1):
        break
    N=N+1
    i=i+1
i=0
while (i<N):
    if(m[i]+f[i]>=80 and m[i]!=-1 and f[i]!=-1):
        print('A')
    elif(m[i]+f[i]>=65 and m[i]+f[i]<80 and m[i]!=-1 and f[i]!=-1):
        print('B')
    elif(m[i]+f[i]>=50 and m[i]+f[i]<65 and m[i]!=-1 and f[i]!=-1):
        print('C')
    elif(m[i]+f[i]>=30 and m[i]+f[i]<50 and m[i]!=-1 and f[i]!=-1):
        if(r[i]>=50):
            print('C')
        else:
            print('D')
    elif(m[i]+f[i]<30 or m[i]==-1 or f[i]==-1):
        print('F')
    i=i+1

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 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:
import sys

l = []
for i in sys.stdin:
    l.append(i.split())

for i in range(0,len(l)-1):
    if int(l[i][0]) == -1 or int(l[i][1]) == -1:
        print('F')
    elif int(l[i][0]) + int(l[i][1]) >= 80:
        print('A')
    elif int(l[i][0]) + int(l[i][1]) < 80 and int(l[i][0]) + int(l[i][1]) >= 65:
        print('B')
    elif (int(l[i][0]) + int(l[i][1]) < 65 and int(l[i][0]) + int(l[i][1]) >= 50) or int(l[i][2]) >= 50:
        print('C')
    elif int(l[i][0]) + int(l[i][1]) < 50 and int(l[i][0]) + int(l[i][1]) >= 30:
        print('D')
    else:
        print('F')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m = []
f = []
r = []
while(1):
    a,b,c = map(int,raw_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:
        print "F"
    elif m[i] + f[i] >= 80:
        print "A"
    elif m[i] + f[i] >= 65:
        print "B"
    elif m[i] + f[i] >= 50 or r[i] >= 50:
        print "C"
    elif m[i] + f[i] >= 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
    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:
# -*- coding: utf-8 -*-

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

Submission status: Accepted

Solution code:
while True:
    m,f,r = tuple(int(n) for n in 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 65 <= m + f < 80:
        print("B")
    elif 50 <= m + f < 65:
        print("C")
    else:
        if r >= 50:
            print("C")
        else:
            print("D")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    m,f,r = map(int, input().split())
    if (m,f,r) == (-1,-1,-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:
while True:
    中間, 期末, 再試験 = map(int, input().split())
    if 中間 < 0 and 期末 < 0 and 再試験 < 0:
        break
    合計点 = 中間 + 期末

    if 中間 < 0 or 期末 < 0:
        print("F")    
    elif 合計点 >= 80:
        print("A")
    elif 65 <= 合計点 and 合計点 < 80:
        print("B")
    elif 50 <= 合計点 and 合計点 < 65:
        print("C")
    elif 30 <= 合計点 and 合計点 < 50:
        if 再試験 >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#! python3
# grading.py

for i in range(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 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 1:
 m,f,r=map(int,input().split());s=m+f
 if r<0>s:break
 print('F'if m*f<0 or s<30 else'D'if(s<50)*(r<50)else'C'if s<65 else'B'if s<80 else'A')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

m=0
while m<i:
    print(Ans[m])
    m=m+1

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:
        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())
    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 True:
    m, f, r  = [int(_) for _ in input().split()]
    if m == f == r == -1:
        break

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

Submission status: Accepted

Solution code:
result = []
while True:
    info = [int(n) for n in input().split()]
    if info[0]==info[1]==info[2]==-1:
        break
    elif -1 in info[:2]:
        result.append("F")
    elif info[0] + info[1] >= 80:
        result.append("A")
    elif 65 <= info[0] + info[1] < 80:
        result.append("B")
    elif 50 <= info[0] + info[1] < 65:
        result.append("C")
    elif 30 <= info[0] + info[1] < 50 and info[2] >= 50:
        result.append("C")
    elif 30 <= info[0] + info[1] < 50:
        result.append("D")
    else:
        result.append("F")
for i in result:
    print(i)

Submission status: Accepted

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


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

    print(judge())

Submission status: Accepted

Solution code:
# AOJ ITP1_7_A

def numinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

def main():
    while True:
        data = numinput()
        if data[0] < 0 and data[1] < 0 and data[2] < 0: break
        grade = ""
        if data[0] + data[1] >= 80: grade = "A"
        elif data[0] + data[1] >= 65: grade = "B"
        elif data[0] + data[1] >= 50: grade = "C"
        elif data[0] + data[1] >= 30:
            if data[2] >= 50: grade = "C"
            else: grade = "D"
        else:
            grade = "F"
        if data[0] < 0 or data[1] < 0: grade = "F"
        print(grade)

if __name__ == "__main__":
    main()