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: Wrong Answer

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

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

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

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

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

    return 'F'

def main():
    while True:
        m, f, r = [int(x) for x in input().split()]
        if m == f == r == -1:
            break

        print(grade(m,f,r))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
one = [int(i) for i in input().split()]
data = []
while one != [-1, -1, -1]:
    data.append(one)
    one = [int(i) for i in input().split()]
answer = ['F' if i[0] == -1 or i[1] == -1 else 'A' if i[0] + i[1] >= 80 else 'B' if 65 <= i[0] + i[1] < 80 else 'C' if 50 <= i[0] + i[1] < 65 else 'C' if 30 <= i[0] + i[1] < 50 and 50 < i[2] else 'D' if 30 <= i[0] + i[1] < 50 else 'F' for i in data]
print(*answer, sep="\n")

Submission status: Wrong Answer

Solution code:
one = [int(i) for i in input().split()]
data = []
while one != [-1, -1, -1]:
    data.append(one)
    one = [int(i) for i in input().split()]

answer = ['F' if i[0] == -1 or i[1] == -1 else 'A' if i[0] + i[1] >= 80 else 'B' if 65 <= i[0] + i[1] < 80 else 'C' if 50 <= i[0] + i[1] < 65 else 'C' if 30 <= i[0] + i[1] < 50 and 50 < i[2] else 'D' if 30 <= i[0] + i[1] < 50 else 'F' for i in data]
print(*answer, sep="\n")

Submission status: Wrong Answer

Solution code:
b = []

while True:
    inp = input()
    a = inp.split()
    a[0] = int(a[0])
    a[1] = int(a[1])
    a[2] = int(a[2])
    if a[0] == -1 and a[1] == -1 and a[2] == -1:
        break
    else:
        b.append(a)

for i in b:
    if i[0] == -1 or i[1] == -1:
        print("F")
    elif i[0]+i[1] >= 80:
        print("A")
    elif i[0]+i[1] >= 65:
        print("B")
    elif i[0]+i[1] >= 50:
        print("C")
    elif i[0]+i[1] < 30:
        print("F")
    elif i[2] >= 50:
        print("C")

Submission status: Wrong Answer

Solution code:
b = []

while True:
    inp = input()
    a = inp.split()
    a[0] = int(a[0])
    a[1] = int(a[1])
    a[2] = int(a[2])
    if a[0] == -1 and a[1] == -1 and a[2] == -1:
        break
    else:
        b.append(a)

for i in b:
    if i[0] == -1 or i[1] == -1:
        print("F")
    elif i[0]+i[1] >= 80:
        print("A")
    elif i[0]+i[1] >= 65:
        print("B")
    elif i[0]+i[1] >= 50:
        print("C")
    elif i[0]+i[1] < 30:
        print("F")
    elif i[2] >= 50:
        print("C")
    else:
        print("F")

Submission status: Wrong Answer

Solution code:
b = []

while True:
    inp = input()
    a = inp.split()
    a[0] = int(a[0])
    a[1] = int(a[1])
    a[2] = int(a[2])
    if a[0] == -1 and a[1] == -1 and a[2] == -1:
        break
    else:
        b.append(a)

for i in b:
    if i[0] == -1 or i[1] == -1:
        print("F")
    elif i[0]+i[1] >= 80:
        print("A")
    elif i[0]+i[1] >= 65:
        print("B")
    elif i[0]+i[1] >= 50:
        print("C")
    elif i[0]+i[1] < 30:
        print("D")
    elif i[2] >= 50:
        print("C")
    else:
        print("F")

Submission status: Wrong Answer

Solution code:
# coding: utf-8

while True:
    m, f, r = map(int, input().split())
    
    if m + f + r == -3:
        exit()

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

    elif r >= 50:
        print('C')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for result in results:
    print(result)

Submission status: Wrong Answer

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 + 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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Solution code:
for _ in [None] * 50:
    m, f, r = map(int, input().split())
    result = " "
    if m == f == r == -1:
        break
    if m == -1 or f == -1 or m + f < 30:
        result = "F"
    elif m + f > 80:
        result = "A"
    elif 80 > m + f >= 65:
        result = "B"
    elif 65 > m + f >= 50:
        result = "C"
    else:
        result = "C" if r >= 50 else "D"
    print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

	if m == -1 and f == -1 and r == -1:
		break
	
	if m == -1 and 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: Wrong Answer

Solution code:
midScore =[0]*50
finScore = [0]*50
reScore = [0]*50
personNum = 0
while True:
    m,f,r = map(int,input().split())
    if m is f is r is -1:
        break
    midScore[personNum] = m
    finScore[personNum] = f
    reScore[personNum] = r
    personNum += personNum
    
for person in range(personNum+1):
    totalScore = midScore[person] + finScore[person]
    if midScore[person] == -1 or finScore[person] == -1:
        print("F")
    elif 80<=totalScore:
        print("A")
    elif 65<=totalScore<80:
        print("B")
    elif 50<=totalScore<65:
        print("C")
    elif 30<=totalScore<50:
        if 50<=reScore:
            print("C")
        else:
            print("D")
    elif totalScore<30:
        print("F")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
while True:
	p=list(map(int,input().split()))
	if p[0]==-1 and p[1]==-1 and p[2]==-1:
		break
	else:
		if 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:
			if p[2]>=50:
				print('C')
			else:
				print('D')				
		else:
			print('F')

Submission status: Wrong Answer

Solution code:
while True:
	p=list(map(int,input().split()))
	if p[0]==-1 and p[1]==-1 and p[2]==-1:
		break
	else:
		if 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:
			if p[2]>=50:
				print('C')
			else:
				print('D')
		elif p[0]==-1 or p[1]==-1:
			print('F')
		else:
			print('F')

Submission status: Wrong Answer

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

        else:
            print("F")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
score=[]
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:
    score.append('F')
  if m+f>=80:
    score.append('A')
  if 65<=m+f<80:
    score.append('B')
  if 50<=m+f<65 or (30<=m+f<50 and 50<=r):
    score.append('C')  
  if 30<=m+f<50 and 0<=r<50:
    score.append('D')
  if m+f<30:
    score.append('F')
for i in score:
  print(i)

Submission status: Wrong Answer

Solution code:
score=[]
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:
    score.append('F')
  if m+f>=80:
    score.append('A')
  if 65<=m+f<80:
    score.append('B')
  if 50<=m+f<65 or (30<=m+f<50 and 50<=r):
    score.append('C')  
  if 30<=m+f<50 and 0<=r<50:
    score.append('D')
for i in score:
  print(i)

Submission status: Wrong Answer

Solution code:
score=[]
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:
    score.append('F')
  elif m+f>=80:
    score.append('A')
  elif 65<=m+f<80:
    score.append('B')
  elif 50<=m+f<65 or (30<=m+f<50 and 50<=r):
    score.append('C')  
  elif 30<=m+f<50 and 0<=r<50:
    score.append('D')
  else:
    pass
for i in score:
  print(i)

Submission status: Wrong Answer

Solution code:
score=[]
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:
    score.append('F')
  elif m+f>=80:
    score.append('A')
  elif 65<=m+f<80:
    score.append('B')
  elif 50<=m+f<65 or (30<=m+f<50 and 50<=r):
    score.append('C')  
  elif 30<=m+f<50 and 0<=r<50:
    score.append('D')
  else:
    score.append('F')
for i in score:
  print(i)

Submission status: Wrong Answer

Solution code:
score=[]
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:
    score.append('F')
  elif m+f>=80:
    score.append('A')
  elif 65<=m+f:
    score.append('B')
  elif 50<=m+f or (30<=m+f<50 and 50<=r):
    score.append('C')  
  elif 30<=m+f and 0<=r<50:
    score.append('D')
  else:
    score.append('F')
for i in score:
  print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    from sys import stdin

    while True:
        m, f, r = (int(n) for n in stdin.readline().rstrip().split())

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

        s = m + f
        result = "F" if m == -1 or f == -1 \
            else "A" if 80 <= s \
            else "B" if 65 <= s \
            else "C" if 50 <= s or 50 < r \
            else "D" if 30 <= s \
            else "F"

        print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
while True:
  m,r,f = 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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
st = list()
while True:
    a = list(map(lambda x: int(x),input().split(" ")))
    if min(a[0:2]) == -1:
        if a[2] == -1:
            break
        else:
            st += {"F"}
    else:
        if 80 < sum(a[0:2]):
            st += {"A"}
        elif 65 <= sum(a[0:2]):
            st += {"B"}
        elif 50 <= sum(a[0:2]):
            st += {"C"}
        elif 30 <= sum(a[0:2]):
            if 50 <= a[2]:
                st += {"C"}
            else:
                st += {"D"}
        else:
            st += {"F"}
    
for s in st:
    print(s)

Submission status: Wrong Answer

Solution code:
st = list()
while True:
    a = list(map(lambda x: int(x),input().split(" ")))
    if min(a[0:2]) == -1:
        if a[2] == -1:
            break
        else:
            st += {"F"}
    else:
        if 80 <= sum(a[0:2]):
            st += {"A"}
        elif 65 <= sum(a[0:2]):
            st += {"B"}
        elif 50 <= sum(a[0:2]):
            st += {"C"}
        elif 30 <= sum(a[0:2]):
            if 50 <= a[2]:
                st += {"C"}
            else:
                st += {"D"}
        else:
            st += {"F"}
    
for s in st:
    print(s)

Submission status: Wrong Answer

Solution code:
data = raw_input()
while data.count('-1') < 3:
	m,f,r = map(int,data.split(" "))
	if m+f < 30 or 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+m+f >= 50):
		print 'C'
	elif m+f >= 30:
		print 'D'
	elif m+f <30:
		print 'F'
	data = raw_input()

Submission status: Wrong Answer

Solution code:
test = []
while True:
    tmp = map(int,raw_input().split())
    if tmp[0]==tmp[1]==tmp[2]==-1:
        break
    else:
        test.append(tmp)
for a in test:
    if a[0]+a[1] >= 80:
        print "A"
    elif 80 > a[0]+a[1] >= 65:
        print "B"
    elif 65 > a[0]+a[1] >= 50:
        print "C"
    elif 50 > a[0]+a[1] >= 30 and a[2] < 50:
        print "D"
    elif a[2] >= 50:
        print "C"
    elif a[0] + a[1] < 30:
        print "F"

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Here your code !


test = []
while True:
    tmp = map(int,raw_input().split())
    if tmp[0]==tmp[1]==tmp[2]==-1:
        break
    else:
        test.append(tmp)
for a in test:
    if a[0] == -1 or a[1] == -1:
        print "F"
    elif a[0]+a[1] >= 80:
        print "A"
    elif 80 > a[0]+a[1] >= 65:
        print "B"
    elif 65 > a[0]+a[1] >= 50:
        print "C"
    elif 50 > a[0]+a[1] >= 30:
        if a[2] < 50:
            print "C"
        else:
            print "D"
    elif a[0] + a[1] < 30:
        print "F"

Submission status: Wrong Answer

Solution code:

JUDGE_LIST=[[80, "A"],
            [65, "B"],
            [50, "C"],
            [30, "D"]]

while True:
    try:
        score=[int(x) for x in raw_input().split(" ")]
    except EOFError:
        break
    
    if score[0]==-1 and score[1]==-1 and score[2]==-1:
        break
    
    if score[0]==-1 or score[1]==-1:
        print "F"

    for judge in JUDGE_LIST:
        if judge[0] <= score[0] + score[1]:
            if "D" == judge[1] and score[2] >= 50:
                print "C"
                break
            else:
                print judge[1]
                break
    else:
        print "F"

Submission status: Wrong Answer

Solution code:
JUDGE_LIST=[[80, "A"],
            [65, "B"],
            [50, "C"],
            [30, "D"]]

while True:
    try:
        score=[int(x) for x in raw_input().split(" ")]
    except EOFError:
        break
    
    if score[0]==-1 and score[1]==-1 and score[2]==-1:
        break
    
    if score[0]==-1 or score[1]==-1:
        print "F"
        break

    for judge in JUDGE_LIST:
        if judge[0] <= score[0] + score[1]:
            if "D" == judge[1] and score[2] >= 50:
                print "C"
                break
            else:
                print judge[1]
                break
    else:
        print "F"

Submission status: Wrong Answer

Solution code:
import sys

for line in sys.stdin:
    m, f, r = map(int, line.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('E')

Submission status: Wrong Answer

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

for mc, fc, rc in score:
    if mc + fc >= 80:
        print('A')
    elif mc + fc >= 65:
        print('B')
    elif mc + fc >= 50 or rc >= 50:
        print('C')
    elif mc + fc >= 30:
        print('D')
    else:
        print('F')

Submission status: Wrong Answer

Solution code:
result = []
while True:
    (m, f, r) = [int(i) for i in input().split()]
    sum = m + f

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

    if m == -1 or f == -1:
        result.append('F')
    elif sum >= 80:
        result.append('A')
    elif sum >= 65:
        result.append('B')
    elif sum >= 50:
        result.append('C')
    elif sum >= 30:
        if r >= 50:
            result.append('C')
            break
        result.append('D')
    else:
        result.append('F')
    

[print(result[i]) for i in range(len(result))]

Submission status: Wrong Answer

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

for mc, fc, rc in score:
    if mc + fc >= 80:
        print('A')
    elif mc + fc >= 65:
        print('B')
    elif mc + fc >= 50 or rc >= 50:
        print('C')
    elif mc + fc >= 30:
        print('F')
    else:
        print('F')

Submission status: Wrong Answer

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')

 if(m+f>=80):
   print('A')

 if((65<= m+f) and (m+f<80)):
   print('B')

 if((50<= m+f) and (m+f<60)):
   print('C')

 if((30<= m+f) and (m+f<50)):
   if(50<=r):
    print('C')
   else:
    print('D')

 if(m+f<30):
   print('F')

Submission status: Wrong Answer

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')

 if(m+f>=80):
   print('A')

 if (65<= m+f) and (m+f<80) :
   print('B')

 if (50<= m+f) and (m+f<60):
   print('C')

 if(30<= m+f) and (m+f<50):
   if (50<=r):
    print('C')
   else:
    print('D')

 if(m+f<30):
   print('F')

Submission status: Wrong Answer

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')

 if(m+f>=80):
   print('A')

 if (65<= m+f) and (m+f<80) :
   print('B')

 if (50<= m+f) and (m+f<60):
   print('C')

 if (30<= m+f) and (m+f<50):
   if (50<=r):
    print('C')
   else:
    print('D')

 if(m+f<30):
   print('F')