ZhenlongDai/ACPR huggingface dataset:
Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())


def modpow(a, n):
    mod = 10 ** 9 + 7
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    if res == 1:
        return mod - 1
    elif res == 0:
        return mod - 2
    else:
        return res - 2


print(modpow(10, n) - 2 * modpow(9, n) + modpow(8, n))


Failing test case input:
131677

Expected output:
810813404


Actual output:
-189186603


Fixed submission (verdict: Accepted):
n = int(input())

mod = 10 ** 9 + 7


def modpow(a, n):
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    return res


ans = modpow(10, n) - 2 * modpow(9, n) + modpow(8, n)

print(ans % mod)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
a=(9**n)%(10**9+7)
b=(8**n)%(10**9+7)
c=(10**n)%(10**9+7)
print(c-2*a+b)


Failing test case input:
112403

Expected output:
286663221


Actual output:
-713336786


Fixed submission (verdict: Accepted):
n=int(input())
a=(9**n)%(10**9+7)
b=(8**n)%(10**9+7)
c=(10**n)%(10**9+7)
print((c-2*a+b)%(10**9+7))

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
M = 10**9+7
N = int(input())
print(pow(10,N,M)-pow(9,N,M)-pow(9,N,M)+pow(8,N,M))

Failing test case input:
4234

Expected output:
645343714


Actual output:
-354656293


Fixed submission (verdict: Accepted):
M = 10**9+7
N = int(input())
print((pow(10,N,M)-pow(9,N,M)-pow(9,N,M)+pow(8,N,M))%M)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

M = 10**9+7
print(pow(10, N, M)-pow(9, N, M)*2+pow(8, N, M))


Failing test case input:
9961

Expected output:
540079694


Actual output:
-1459920320


Fixed submission (verdict: Accepted):
N = int(input())

M = 10**9+7
print((pow(10, N, M)-pow(9, N, M)*2+pow(8, N, M))%M)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
if n == 1:
    print(0)
else:
    t = 10**9 + 7

    a = (10**n)%t
    b = (8**n)%t
    c = (9**n)%t

    print(a-c-c+b)

Failing test case input:
18262

Expected output:
566588237


Actual output:
-433411770


Fixed submission (verdict: Accepted):
n = int(input())
if n == 1:
    print(0)
else:
    t = 10**9 + 7
    a = (10**n)
    b = (8**n)
    c = (9**n)

    print((a-c-c+b)%t)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
mod = 10**9+7
n = int(input())
print(pow(10,n,mod)-pow(9,n,mod)*2+pow(8,n,mod))

Failing test case input:
6053

Expected output:
584615795


Actual output:
-415384212


Fixed submission (verdict: Accepted):
mod = 10**9+7
n = int(input())
print((pow(10,n,mod)-pow(9,n,mod)*2+pow(8,n,mod))%mod)
Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
MOD = 1000000007
a,b,c,d=pow(9,n,MOD),pow(9,n,MOD),pow(8,n,MOD),pow(10,n,MOD)
print(d-a-b+c)

Failing test case input:
8450

Expected output:
230481872


Actual output:
1230481879


Fixed submission (verdict: Accepted):
n = int(input())
MOD = 1000000007
a,b,c,d=pow(9,n,MOD),pow(9,n,MOD),pow(8,n,MOD),pow(10,n,MOD)
print((d-a-b+c+MOD)%MOD)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

import sys

MOD = 1000000007  


def solve(N: int):
    t = pow(10,N,MOD)- pow(8,N,MOD)
    m = pow(10,N,MOD)- pow(9,N,MOD)
    print(2*m-t)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()


Failing test case input:
15421

Expected output:
778744163


Actual output:
-1221255851


Fixed submission (verdict: Accepted):

import sys

MOD = 1000000007  


def solve(N: int):
    t = pow(10,N,MOD)- pow(8,N,MOD)
    m = pow(10,N,MOD)- pow(9,N,MOD)
    print((2*m-t)%MOD)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

N=int(input())
mod=10**9+7

ans=pow(10,N,mod)-2*pow(9,N,mod)+pow(8,N,mod)

print(ans)

Failing test case input:
16756

Expected output:
461790329


Actual output:
-538209678


Fixed submission (verdict: Accepted):

N=int(input())
mod=10**9+7

ans=pow(10,N,mod)-2*pow(9,N,mod)+pow(8,N,mod)
ans%=mod

print(ans)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def power_func(a,n,p):
    bi = str(format(n,"b"))
    res = 1
    for i in range(len(bi)):
        res = (res*res) %p
        if bi[i] == "1":
            res = (res*a) %p
    return res
  
n = int(input())
x = power_func(10, n, (10**9 + 7))
y = power_func(8, n, (10**9 + 7))
z = power_func(9, n, (10**9 + 7))
print(x + y - 2 * z)

Failing test case input:
8450

Expected output:
230481872


Actual output:
1230481879


Fixed submission (verdict: Accepted):
def power_func(a,n,p):
    bi = str(format(n,"b"))
    res = 1
    for i in range(len(bi)):
        res = (res*res) %p
        if bi[i] == "1":
            res = (res*a) %p
    return res
  
n = int(input())
x = power_func(10, n, (10**9 + 7))
y = power_func(8, n, (10**9 + 7))
z = power_func(9, n, (10**9 + 7))
print((x + y - 2 * z) % (10**9 + 7))
Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
mod=10**9+7
if N==1:
   print(0)
else:
   ans=pow(10,N,mod)
   ans-=pow(9,N,mod)*2-pow(8,N,mod)
   if ans<0:
      ans+=mod
   print(ans)

Failing test case input:
38647

Expected output:
55814822


Actual output:
1055814829


Fixed submission (verdict: Accepted):
N=int(input())
mod=10**9+7
if N==1:
   print(0)
else:
   ans=pow(10,N,mod)
   ans-=pow(9,N,mod)*2
   ans+=pow(8,N,mod)
   if ans<0:
      ans+=mod
   print(ans%mod)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

import sys, math, heapq
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial, gcd
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep="\n")

N = int(input())

res = pow(10, N, MOD) - (2 * pow(9, N, MOD) - pow(8, N, MOD))
print(res)

Failing test case input:
15925

Expected output:
539990163


Actual output:
-460009844


Fixed submission (verdict: Accepted):

import sys, math, heapq
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial, gcd
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep="\n")

N = int(input())

res = pow(10, N, MOD) - (2 * pow(9, N, MOD) - pow(8, N, MOD))
res %= MOD
print(res)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
mod = 10**9+7
print(pow(10,N,mod) - 2 * pow(9,N,mod) + pow(8,N,mod))

Failing test case input:
1620

Expected output:
564438208


Actual output:
-435561799


Fixed submission (verdict: Accepted):
N = int(input())
mod = 10**9+7
print((pow(10,N,mod) - 2 * pow(9,N,mod) + pow(8,N,mod))%mod)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
mod = 10**9+7
a = pow(10,n,mod)
b = pow(9,n,mod)
c = pow(9,n,mod)
d = pow(8,n,mod)
print(a-b-c+d)

Failing test case input:
6100

Expected output:
898681079


Actual output:
-101318928


Fixed submission (verdict: Accepted):
n = int(input())
mod = 10**9+7
a = pow(10,n,mod)
b = pow(9,n,mod)
c = pow(9,n,mod)
d = pow(8,n,mod)
print((a-b-c+d)%mod)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = 10**9+7
if n==1:
    print(0)
else:
    ans = 1
    b = 1
    c = 1
    for _ in range(n):
        b *= 9
        c *= 8
        b %= a
        c %= a
        ans *= 10
        ans %= a
    ans = ans-2*b+c
    if ans<=0:
        ans += a
    print(ans)

Failing test case input:
18734

Expected output:
457675837


Actual output:
1457675844


Fixed submission (verdict: Accepted):
n = int(input())
a = 10**9+7
if n==1:
    print(0)
else:
    ans = 1
    b = 1
    c = 1
    for _ in range(n):
        b *= 9
        c *= 8
        b %= a
        c %= a
        ans *= 10
        ans %= a
    ans = (ans-2*b+c)%a
    if ans< 0:
        ans += a
    print(ans)
Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def main():
    N = int(input())
    mod = 10 ** 9 + 7
    mod_1 = 1
    mod_2 = 1
    mod_3 = 1
    for _ in range(N):
        mod_1 = (mod_1 * 10) % mod
        mod_2 = (mod_2 * 9) % mod
        mod_3 = (mod_3 * 8) % mod
    print(mod_1 - 2 * mod_2 + mod_3)

if __name__ == '__main__':
    main()


Failing test case input:
203

Expected output:
857414219


Actual output:
-142585788


Fixed submission (verdict: Accepted):
def main():
    N = int(input())
    mod = 10 ** 9 + 7
    mod_1 = 1
    mod_2 = 1
    mod_3 = 1
    for _ in range(N):
        mod_1 = (mod_1 * 10) % mod
        mod_2 = (mod_2 * 9) % mod
        mod_3 = (mod_3 * 8) % mod
    v = mod_1 - 2 * mod_2 + mod_3
    if v < 0:
        v *= -1
        v = ((v 
    print(v)

if __name__ == '__main__':
    main()

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
mod = 10**9+7

def pow(n, num):
  s = num
  for i in range(1,num):
    s = s*num%mod
    return s
print((pow(n,10) - 2*pow(n,9) + pow(n,8))%mod)

Failing test case input:
16756

Expected output:
461790329


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
mod = 10**9+7

def pow(n, num):
  s = num
  for i in range(1,n):
    s = s*num%mod
  return s
print((pow(n,10) - 2*pow(n,9) + pow(n,8))%mod)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(869121)
ans = 10**n - 9**n - 9**n + 8**n
print(ans % (10**9 + 7))

Failing test case input:
9961

Expected output:
540079694


Actual output:
2511445


Fixed submission (verdict: Accepted):
n = int(input())
ans = 10**n - 9**n - 9**n + 8**n
print(ans % (10**9 + 7))

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
MOD = int(1e9+7)

N = int(input())
answer = pow(10, N, MOD)
answer -= pow(9, N, MOD) * 2
answer += pow(8, N, MOD)
print(answer)


Failing test case input:
6053

Expected output:
584615795


Actual output:
-415384212


Fixed submission (verdict: Accepted):
MOD = int(1e9+7)

N = int(input())
answer = pow(10, N, MOD)
answer -= pow(9, N, MOD) * 2
answer += pow(8, N, MOD)
answer %= MOD
print(answer)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = 10**9+7
if n<2:
    print(0)
else:
    ans = 1
    b = 1
    c = 1
    for _ in range(n):
        b *= 9
        c *= 8
        b %= a
        c %= a
        ans *= 10
        ans %= a
    ans = (ans - 2*b +c)
    if ans<0 :
        ans += a
    print(ans)

Failing test case input:
229883

Expected output:
188898156


Actual output:
1188898163


Fixed submission (verdict: Accepted):
n = int(input())
a = 10**9+7
if n==1:
    print(0)
else:
    ans = 1
    b = 1
    c = 1
    for _ in range(n):
        b *= 9
        c *= 8
        b %= a
        c %= a
        ans *= 10
        ans %= a
    ans = (ans-2*b+c)%a
    if ans< 0:
        ans += a
    print(ans)
Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())


ans=(10**n-8**n)%1000000007
print(ans%1000000007)
    

Failing test case input:
348

Expected output:
989385607


Actual output:
650375973


Fixed submission (verdict: Accepted):
n=int(input())
ans=(pow(10,n)-2*pow(9,n)+pow(8,n))%1000000007
print(ans%1000000007)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
mod = 10**9 + 7

a = ((10**(N))%mod - 2*(9**(N))%mod + (8**N)%mod)
print(a)

Failing test case input:
38647

Expected output:
55814822


Actual output:
1055814829


Fixed submission (verdict: Accepted):
N = int(input())
mod = 10**9 + 7

a = ((10**(N)) - 2*(9**(N)) + (8**N))%mod
print(a)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
mod = 10 ** 9 +7
x = (10**N)%mod
y = (2*(9**N))%mod
z = (8**N)%mod
print(x-y+z)


Failing test case input:
15421

Expected output:
778744163


Actual output:
-221255844


Fixed submission (verdict: Accepted):
N = int(input())
mod = 10 ** 9 +7
x = (10**N)%mod
y = (2*(9**N))%mod
z = (8**N)%mod
print((x-y+z)%mod)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
MOD = 10 ** 9 + 7

ans = pow(10, N, MOD)
ans -= pow(9, N, MOD) * 2
ans += pow(8, N, MOD)

print(ans)


Failing test case input:
555348

Expected output:
556355172


Actual output:
-443644835


Fixed submission (verdict: Accepted):
N = int(input())
MOD = 10 ** 9 + 7

ans = pow(10, N, MOD)
ans -= pow(9, N, MOD) * 2
ans += pow(8, N, MOD)

print(ans%MOD)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
inf = 1000000000 + 7
a=1; d=4
num = int(2*n*(n-1)) % inf
if n==2: ans=2
elif n==1: ans=0
elif n>2:
    for i in range(n-2):
        a = int(int(8*a) % inf)
        d = int(int(2*d) % inf)
    a = int(a%inf)*int(num%inf)
    ans = int(int(a%inf) + int(d%inf))%inf
print(int(ans))

Failing test case input:
67881

Expected output:
465817182


Actual output:
563015270


Fixed submission (verdict: Accepted):
n = int(input())
inf = 1000000000 + 7
a=1; b=1;c=1
if n==2: ans=2
elif n==1: ans=0
elif n>2:
    for i in range(n):
        a = (10*a) % inf
        b = (9*b) % inf
        c = (8*c) % inf
    ans = int(a%inf - int(2*b)%inf + int(c)%inf)%inf
print(int(ans))

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a = int(input())
mod = 10**9 +7
if a > 1:
  num =2**a-2
  cum = num % mod
  print(cum)
  exit()
print(0)

Failing test case input:
226564

Expected output:
498733826


Actual output:
870376706


Fixed submission (verdict: Accepted):
a = int(input())
mod = 10**9 +7
cum =0
num =0
if a >1:
  num = 10**a - 9**a*2 + 8**a
  cum = num % mod
  print(cum)
  exit()
print(0)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

ans = (N ** 10 - N ** 9 - N ** 9 + N ** 8) % (10 ** 9 + 7)
print(ans)

Failing test case input:
456

Expected output:
519286512


Actual output:
151602430


Fixed submission (verdict: Accepted):
N = int(input())

ans = (10 ** N - 9 ** N - 9 ** N + 8 ** N) % (10 ** 9 + 7)
print(ans)
Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
MOD = 10**9+7
ans = 10**N%MOD - 9**N%MOD*2%MOD + 8**N%MOD
print(ans)

Failing test case input:
38647

Expected output:
55814822


Actual output:
1055814829


Fixed submission (verdict: Accepted):
N = int(input())
MOD = 10**9+7
ans = ((10**N%MOD - 9**N%MOD*2%MOD)%MOD + 8**N%MOD)%MOD
print(ans)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
mod = 10**9 + 7

ans = pow(10,n,mod) - pow(9,n,mod)*2 + pow(8,n,mod)
print(ans)

Failing test case input:
64814

Expected output:
479051401


Actual output:
-520948606


Fixed submission (verdict: Accepted):
n = int(input())
mod = 10**9 + 7

ans = pow(10,n,mod) - pow(9,n,mod)*2 + pow(8,n,mod)
print(ans % mod)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
MOD = 10**9+7
print(pow(10, n, MOD) - 2 * pow(9, n, MOD) + pow(8, n, MOD))

Failing test case input:
18262

Expected output:
566588237


Actual output:
-433411770


Fixed submission (verdict: Accepted):
n = int(input())
MOD = 10**9+7
print((pow(10, n, MOD) - 2 * pow(9, n, MOD) + pow(8, n, MOD)) % MOD)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
ans = (10**n)%-2*(9**n)+8**n
print(ans%(10**9+7))

Failing test case input:
25292

Expected output:
66208857


Actual output:
827088755


Fixed submission (verdict: Accepted):
n = int(input())
ans = (10**n)-2*(9**n)+8**n
print(ans%(10**9+7))
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m,f,r = map(int, input().split())
    if m==f==r==-1:
        break
    if m ==-1 or f == -1:
        print("F")
    elif (m+f) <=80:
        print("A")
    elif (m+f) <=65:
        print("B")
    elif (m+f) <=50:
        print("C")
    elif( m+f)<=30 and r <=50:
        print("C")
    elif (m+f)<=30:
        print("D")
    else:
        print("F")



Failing test case input:
54 64 -1
35 30 -1
1 2 -1
-1 -1 -1

Expected output:
A
B
F


Actual output:
F
A
A


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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r = map(int, input().split())
    A = m + f + r
    if m == f == r == -1:
        break
    elif m == 0 or f == 0:
        print('F')
    elif A >= 80:
        print('A')
    elif 65 <= A < 80:
        print('B')
    elif 50 <= A < 65:
        print('C')
    elif 30 <= A < 50:
        print('D')
    else:
        print('F')

Failing test case input:
0 22 -2
50 30 -1
-1 2 -2
-1 -1 -1

Expected output:
F
A
F


Actual output:
F
B
F


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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while 1:
 m,f,r=map(int,input().split())
 if m==f==r==-1:break
 if m+f>79:print('A')
 elif m+f>64:print('B')
 elif m+f>49 or r>49:print('C')
 elif m+f>29:print('D')
 else:print('F')

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
while 1:
 m,f,r=map(int,input().split())
 if m==f==r==-1:break
 if m==-1 or f==-1:print('F')
 elif m+f>79:print('A')
 elif m+f>64:print('B')
 elif m+f>49:print('C')
 elif m+f>29:print('C') if r>49 else print('D')
 else:print('F')
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
 m,f,r=map(int,input().split())
 g=m+f
 if m==-1 and f==-1 and r==-1:
  break
 elif m==-1 or g==-1 or g>30:
  print("F")
 elif g>=80:
  print("A")
 elif 65<=g<80:
  print("B")
 elif 50<=g<65 or 30<=g<50 and r>=50:
  print("C")
 elif 30<=g<50:
  print("D")


Failing test case input:
92 101 -1
16 30 -1
0 2 -1
-1 -1 -1

Expected output:
A
D
F


Actual output:
F
F


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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):

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

Failing test case input:
20 11 -2
30 30 0
1 -1 -1
-1 -1 -1

Expected output:
D
C
F


Actual output:
D
C
F
F


Fixed submission (verdict: Accepted):

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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
result = []
m,f,r=[int(x) for x in input().split()]
while not m==f==r==-1:
    if (m + f >= 80):
        res = 0
    elif (65 <= m + f < 80):
        res = 1
    elif (50 <= m + f < 65):
        res = 2
    elif (30 <= m + f < 50):
        res = 3
        if (50 <= r):
            res = 2
    else :
        res = 5
    result.append(res)
    m,f,r=[int(x) for x in input().split()]
for i in result:
    print(chr(65+i))

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
result = []
m,f,r=[int(x) for x in input().split()]
while not m==f==r==-1:
    if (m == -1 or f == -1):
        res = "F"
    elif (m + f >= 80):
        res = "A"
    elif (65 <= m + f < 80):
        res = "B"
    elif (50 <= m + f < 65):
        res = "C"
    elif (30 <= m + f < 50):
        res = "D"
        if (50 <= r):
            res = "C"
    else :
        res = "F"
    result.append(res)
    m,f,r=[int(x) for x in input().split()]
for i in result:
    print(i)
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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')
    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')
        

Failing test case input:
0 22 -2
50 30 -1
-1 2 -2
-1 -1 -1

Expected output:
F
A
F


Actual output:
F
A
F
F


Fixed submission (verdict: Accepted):
while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    if m == -1 or f == -1:
        print('F')
        continue
    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')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m,f,r = [int(i) for i in input().split()]
    if m==f==r==-1:break

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

    else: print("F")

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
mf = 0
while True:
    m,f,r = [int(i) for i in input().strip().split()]
    if m==f==r==-1 : break
    mf = m+f

    if m*f<0 or mf<30 : print("F")
    elif mf<50 and r<50 : print("D")
    elif mf<65 : print("C")
    elif mf<80 : print("B")
    elif mf>=80 : print("A")
    else: print("F")

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    points = list(map(int,input().split()))
    if points == [-1,-1,-1]:
        break
    gou = points[0] + points[1]
    if gou >= 80:
        print("A")
    elif 65 <= gou < 80:
        print("B")
    elif 50 <= gou < 65:
        print("C")
    elif 30 <= gou < 50:
        if points[2] >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
while True:
    points = list(map(int,input().split()))

    if points == [-1,-1,-1]:
        break

    gou = points[0] + points[1]
    if points[0]==-1 or points[1]==-1:
        print("F")
    elif gou >= 80:
        print("A")
    elif 65 <= gou < 80:
        print("B")
    elif 50 <= gou < 65:
        print("C")
    elif 30 <= gou < 50:
        if points[2] >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r = [int(i) for i in input().split()]

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

    total = m + f

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

Failing test case input:
75 10 -1
16 30 -1
0 2 -1
-1 -1 -1

Expected output:
A
D
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
while True:
   m, f, r = [int(i) for i in input().split()]
  
   if m == f == r == -1:
      break
   total = m + f
   if m == -1 or f == -1 or total < 30:
      print("F")
    
   elif total < 50 and r < 50:
      print("D")
 
   elif r >= 50 or total < 65:
      print("C")
    
   elif total < 80:
      print("B")
 
   else:
      print("A")

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m,f,r =[int(i) for i in input().split()]

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

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

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

    if 50<=(m+f)<65 :
        print("C")

    if 30<=(m+f)<50 and r>=50:
        print("C")
        
    if 30 <= (m + f) and r< 50:
        print("D")
        
    if (m+f)<30:
        print("F")

Failing test case input:
54 64 -1
28 30 -1
0 2 -1
-1 -1 -1

Expected output:
A
C
F


Actual output:
A
D
C
D
F


Fixed submission (verdict: Accepted):
while True:
    m, f, r = [int(i) for i in input().split()]
 
    if m == f == r == -1:
        break
 
    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')
 
    elif total < 50 and r < 50:
        print('D')
 
    elif total < 65:
        print('C')
         
    elif total < 80:
        print('B')
         
    else:
        print('A')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
m=f=r=0
while True:
    m,f,r=map(int,input().split())
    x=m+f
    if m==f==r==-1:
        break
    elif x>=80:
        print('A')
    elif 65<=x<80:
        print('B')
    elif 50<=x<65 or r>=50:
        print('C')
    elif 30<=x<50:
        print('D')
    else:
        print('F')

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
m=f=r=0
while True:
    m,f,r=map(int,input().split())
    x=m+f
    if m==f==r==-1:
        break
    elif m==-1 or f==-1 or x<30:
        print('F')
    elif x>=80:
        print('A')
    elif 65<=x<80:
        print('B')
    elif 50<=x<65 or r>=50:
        print('C')
    else:
        print('D')
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r = map(int, (input().split()))
    score = m + f
    if m == f == r == -1:
        break
    else:
        if m == -1 or f == -1:
            print("F")
        elif score >= 80:
            print("A")
        elif 80 > score >= 65:
            print("B")
        elif 65 > score >= 50:
            print("C")
        elif 50 > score >= 35 and r >= 50:
            print("C")
        else:
            print("D")

Failing test case input:
40 42 -1
16 30 -1
0 2 -1
-1 -1 -1

Expected output:
A
D
F


Actual output:
A
D
D


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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r = [int(i) for i in input().split()]

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

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

    elif 65 <= total or total < 80:
        print("B")

    elif 50 <= total or total < 65:
        print("C")

    elif 30 <= total or total < 50 and r < 50:
        print("D")

    else:
        print("A")

Failing test case input:
0 64 -1
16 30 -1
0 2 -1
-1 -1 -1

Expected output:
C
D
F


Actual output:
B
B
F


Fixed submission (verdict: Accepted):
while True:
   m, f, r = [int(i) for i in input().split()]
  
   if m == f == r == -1:
      break
   total = m + f
   if m == -1 or f == -1 or total < 30:
      print("F")
    
   elif total < 50 and r < 50:
      print("D")
 
   elif r >= 50 or total < 65:
      print("C")
    
   elif total < 80:
      print("B")
 
   else:
      print("A")

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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')

Failing test case input:
19 41 -2
16 10 -1
1 0 -1
-1 -1 -1

Expected output:
C
F
F


Actual output:
F
F


Fixed submission (verdict: Accepted):
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 65<= (m+f) and (m+f)<80 :
   print('B')

 elif 50<= (m+f) and (m+f)<65 :
   print('C')

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

 elif (m+f)<30 :
   print('F')
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
m, f, r = map(int, input().split())

while not(m == -1 and f == -1 and r == -1):
	if m == -1:
		m = 0
	if f == -1:
		f = 0
	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")
	m, f, r = map(int, input().split())


Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
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())

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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")



Failing test case input:
40 10 -1
16 30 -1
0 4 -1
-1 -1 -1

Expected output:
C
D
F


Actual output:
C
D
D


Fixed submission (verdict: Accepted):
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("F")
    else:
        if m == -1 and f == -1 and r == -1:
                break
        else:
            print("F")
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while():
    m,f,r = list(map(int, input().split()))
    
    if (m==-1 & f == -1 & r==-1):
        break
        
    
    if (m == -1 | f == -1):
        print ("F")
    
    elif (m + f >= 80):
        print ("A")
    
    elif (m+f >= 65):    
        print ("B")
    
    elif (m+f >= 65):
        print ("C")
    
    elif (m+f >= 30):
        if (r >= 50):
            print ("C")
        else:
            print ("D")
    
    elif (m+f<30):
        print ("F")

Failing test case input:
40 53 -1
20 6 -2
0 2 -1
-1 -1 -1

Expected output:
A
F
F


Actual output:

Fixed submission (verdict: Accepted):
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")

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r = map(int, input().split())
    mf = m + f
    if mf== -2 and r == -1:
        break
    if mf == -2 or mf < 30:
        print('F')
    elif mf < 50:
        if r < 50:
            print('D')
        else:
            print('C')
    elif mf < 65:
        print('C')
    elif mf < 80:
        print('B')
    else:
        print('A')

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
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 or mf < 30:
       print('F')
    elif mf < 50:
        if r < 50:
            print('D')
        else:
            print('C')
    elif mf < 65:
        print('C')
    elif mf < 80:
        print('B')
    else:
        print('A')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m,f,r=map(int,input().split())

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

    elif 65<=m+f<80:
        print("B")

    elif 50<=m+f<65:
        print("C")

    elif 30<=m+f<50:
        print("D")

    elif 30<m+f<50 and r>50:
        print("C")

    elif m+f<30:
        print("F")

    elif m or f ==-1:
        print("F")

    elif  m+f>=80:
        print("A")

Failing test case input:
150 64 -1
16 30 -1
1 0 -1
-1 -1 -1

Expected output:
A
D
F


Actual output:
F
D
F


Fixed submission (verdict: Accepted):
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 65<=m+f<80:
        print("B")

    elif 50<=m+f<65:
        print("C")

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

    elif 30<=m+f<50:
        print("D")

    else:
        print("F")
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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) 
  


Failing test case input:
81 64 -1
16 30 -1
1 0 0
-1 -1 -1

Expected output:
A
D
F


Actual output:
F
A
D


Fixed submission (verdict: Accepted):

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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, v = [int(n) for n in input().split()]

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

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
while True:
    m, f, v = [int(n) for n in input().split()]

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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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')

Failing test case input:
92 64 -1
16 50 -1
1 1 0
-1 -1 -1

Expected output:
A
B
F


Actual output:
A
B
E


Fixed submission (verdict: Accepted):
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('F')
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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) 


Failing test case input:
92 101 -1
16 30 -1
0 2 0
-1 -1 -1

Expected output:
A
D
F


Actual output:
A
F
F


Fixed submission (verdict: Accepted):

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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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')

Failing test case input:
0 22 -2
50 30 -1
-1 2 -2
-1 -1 -1

Expected output:
F
A
F


Actual output:
F
F
F


Fixed submission (verdict: Accepted):
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')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m,f,r = map(int,input().split())
    if m == f == 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")

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
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")
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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')

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
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 == -1 or fc == -1:
        print('F')
    elif 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')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    (m, f, r) = [int(i) for i in input().split()]
    R = ""
    s = m + f

    if ((m == -1 or f == -1) or (s < 30)):
        R = "F"

    if 80 <= s:
        R = "A"


    if (65 < s <= 80):
        R = "B"

    if (50 < s <= 65) or (r <= 50):
        R = "C"

    if (30 < s <= 50):
        R = "D"

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

    print(R)

Failing test case input:
40 53 -1
0 58 -1
0 2 -1
-1 -1 -1

Expected output:
A
C
F


Actual output:
C
C
C


Fixed submission (verdict: Accepted):
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 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')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):




while True:
    inp = input().split(" ")
    m = int(inp[0])
    f = int(inp[1])
    r = int(inp[2])
    
    if m < 0 and f < 0 and r < 0 :
        break
    
    if m < 0 or f < 0 :
        S = "F"
    else:
        t = m + f
        if t < 50:
            if r >= 50:
                S = "C"
            else:
                S = "D"
        elif t < 65:
            S = "C"
        elif t < 80:
            S = "B"
        else:
            S = "A"

    print(S)

Failing test case input:
92 64 -1
16 30 -1
0 2 -1
-1 -1 -1

Expected output:
A
D
F


Actual output:
A
D
D


Fixed submission (verdict: Accepted):




while True:
    inp = input().strip().split(" ")
    m = int(inp[0])
    f = int(inp[1])
    r = int(inp[2])

    
    if m < 0 and f < 0 and r < 0 :
        break
    
    if m < 0 or f < 0 :
        S = "F"
    else:
        t = m + f
        if t < 30:
            S = "F"
        elif t < 50:
            if r >= 50:
                S = "C"
            else:
                S = "D"
        elif t < 65:
            S = "C"
        elif t < 80:
            S = "B"
        else:
            S = "A"

    print(S)
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
def judgetest(a, b, c):
    if a == -1 or b == -1:
        return 'F'
    sum = a + b
    if sum >= 80:
        return 'A'
    elif sum >= 65:
        return 'B'
    elif sum >= 50:
        return 'C'
    elif sum >= 35:
        if c >= 50:
            return 'C'
        else:
            return 'D'
    else:
        return 'F'

list = []
while True:
    a, b, c = map(int, input().split())
    if a == b == c == -1:
        break
    list.append(judgetest(a, b, c))

for s in list:
    print(s)

Failing test case input:
20 11 -2
30 30 0
1 -1 -1
-1 -1 -1

Expected output:
D
C
F


Actual output:
F
C
F


Fixed submission (verdict: Accepted):
def judgetest(a, b, c):
    if a == -1 or b == -1:
        return 'F'
    sum = a + b
    if sum >= 80:
        return 'A'
    elif sum >= 65:
        return 'B'
    elif sum >= 50:
        return 'C'
    elif sum >= 30:
        if c >= 50:
            return 'C'
        else:
            return 'D'
    else:
        return 'F'

list = []
while True:
    a, b, c = map(int, input().split())
    if a == b == c == -1:
        break
    list.append(judgetest(a, b, c))

for s in list:
    print(s)

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m,f,r = map(int, input().split())
    if m == -1 and f == -1 and 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")

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
while True:
    m,f,r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    if m == -1 or f == -1:
        print("F")
        continue
    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")