Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = input()
if(S[0]=="A" and S.find("C") != -1):
    S = S.replace("C","c")
    ans = S[1:].islower()
if(ans):
    print("AC")
else:
    print("WA")

Fixed submission:
S = input()
ans = False
if(S[0]=="A" and S[2:len(S)-1].find("C") != -1 and S.count("C") == 1):
    S = S.replace("C","c")
    ans = S[1:].islower()
if(ans):
    print("AC")
else:
    print("WA")
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
leng = len(S)
S = sorted(S)
T = sorted(T)
ans = True
for i in range(leng):
    if(S[i] != T[i]):
        ans = False
if(ans):
    print("Yes")
else:
    print"No

Fixed submission:
S = input()
T = input()
leng = len(S)
ans = False

for i in range(leng):
    if(S == T):
        ans = True
    S = S[-1] + S[0:-1]
if(ans):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
D,N = map(int,input().split())
K = 1
count = 0
while(True):
    A = K
    cnt = 0
    while(A>0):
        if(A % 100 == 0):
            cnt += 1
        A /= 100
    if(cnt == D):
        count +=1
    if(count == N):
        print(K)
        break
    K += 1

Fixed submission:
D,N = map(int,input().split())
ans = (100**D) * N
if(N == 100):
    ans +=  100**D
print(ans)
Buggy python submission (verdict: Runtime Error):
Jupyter Notebook
ABC098B
Current Kernel Logo
Python 3 
File
Edit
View
Insert
Cell
Kernel
Widgets
Help

X =int(input())
ans = 0
for i in range(1,X+1):
    for j in range(2,11):
        A = i ** j
        if(A<=X):
            ans = max(ans,A)
print(ans)



Fixed submission:
X =int(input())
ans = 0
for i in range(1,X+1):
    for j in range(2,11):
        A = i ** j
        if(A<=X):
            ans = max(ans,A)
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = False
for i in range(N):
    s = input()
    if(s == "Y"):
        ans = True
if(ans):
    print("Four")
else:
    print("Three")

Fixed submission:
N = int(input())
ans = False
s = list(input().split())
for i in s:
    if(i == "Y"):
        ans = True
if(ans):
    print("Four")
else:
    print("Three")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if (b == 100):
    AB = a * 1000 + b
else if(b > 9):
    AB = a * 100 + b
else:
    AB = a * 10 + b
cnt = 1
ans = False
while(True):
    x = cnt * cnt
    if(x == AB):
        ans = True
    if(x > AB):
        break
    cnt += 1
if(ans):
    print("Yes")
else:
    print("No")

Fixed submission:
a,b = map(int,input().split())
if (b == 100):
    AB = a * 1000 + b
elif(b > 9):
    AB = a * 100 + b
else:
    AB = a * 10 + b
cnt = 1
ans = False
while(True):
    x = cnt * cnt
    if(x == AB):
        ans = True
    if(x > AB):
        break
    cnt += 1
if(ans):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
ab = []
for i in range(N):
    a,b = map(int,input().split())
    ab.append((a,b))
cd = []
for i in range(N):
    a,b = map(int,input().split())
    cd.append((a,b))
ans = []
for i in range(len(ab)):
    aaa = 1000000000
    for j in range(len(cd)):
        man = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])
        if(man < aaa):
            aaa = man
            cnt = j + 1
    ans.append(cnt)
for i in ans:
    print(i)

Fixed submission:
N,M = map(int,input().split())
ab = []
for i in range(N):
    a,b = map(int,input().split())
    ab.append((a,b))
cd = []
for i in range(M):
    c,d = map(int,input().split())
    cd.append((c,d))
ans = []
for i in range(len(ab)):
    aaa = 1000000000
    for j in range(len(cd)):
        man = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])
        if(man < aaa):
            aaa = man
            cnt = j + 1
    ans.append(cnt)
for i in ans:
    print(i)

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
ab = []
for i in range(N):
    a,b = map(int,input().split())
    ab.append((a,b))
cd = []
for i in range(N):
    a,b = map(int,input().split())
    cd.append((a,b))
ans = []
for i in range(N):
    aaa = 1000000000
    for j in range(M):
        man = abs(ab[i][0] - cd[j][0]) - abs(ab[i][1] - cd[j][1])
        if(man < aaa):
            aaa = man
            cnt = j + 1
    ans.append(cnt)
for i in ans:
    print(i)

Fixed submission:
N,M = map(int,input().split())
ab = []
for i in range(N):
    a,b = map(int,input().split())
    ab.append((a,b))
cd = []
for i in range(M):
    c,d = map(int,input().split())
    cd.append((c,d))
ans = []
for i in range(len(ab)):
    aaa = 1000000000
    for j in range(len(cd)):
        man = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])
        if(man < aaa):
            aaa = man
            cnt = j + 1
    ans.append(cnt)
for i in ans:
    print(i)
Buggy python submission (verdict: Runtime Error):
W,a,b = map(int,input().split())
if((abs(b-a) < W):
    print(0)
else:
    ans = abs(b - a) - W
    print(ans)

Fixed submission:
W,a,b = map(int,input().split())
if(abs(b-a) < W):
    print(0)
else:
    ans = abs(b - a) - W
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 1
for i in range(1,N+1):
    ans *= i
print(ans%(10**9 + 7))

Fixed submission:
N = int(input())
mod = 1000000007
ans = 1
for i in range(1,N+1):
    ans = (i * ans)%mod
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

K,S = map(int,input().split())

cnt = 0
for i in list(itertools.product(range(K+1),repeat = 3)):
    if sum(i) == S:
        cnt += 1
print(cnt)

Fixed submission:
K,S = map(int,input().split())
ans = 0
for i in range(K+1):
    for j in range(K+1):
        Z = S - i - j
        if(j>=0 and i>=0 and Z>=0 and K>=Z and S == i + j + Z):
            ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
W,H,N = map(int,input().split())
zero = [0,0]
X = [W,H]
ans = True
for i in range(N):
    x,y,a = map(int,input().split())
    if(a == 1):
        if zero[0] < x < X[0]:
            zero[0] = x
        elif X[0] =< x:
            ans = False
            break
    elif(a == 2):
        if zero[0] < x < X[0]:
            X[0] = x
        elif zero[0] => x:
            ans = False
            break
    elif(a == 3):
        if zero[1] < y < X[1]:
            zero[1] = y
        elif X[1] =< y:
            ans = False
            break
    elif(a == 4):
        if zero[1] < y < X[1]:
            X[1] = y
        elif zero[0] => y:
            ans = False
            break
if(ans):
    S = (X[1] - zero[1]) * (X[0] - zero[0])
    print(S)
else:
    print(0)

Fixed submission:
W,H,N = map(int,input().split())
zero = [0,0]
X = [W,H]
ans = True
for i in range(N):
    x,y,a = map(int,input().split())
    if(a == 1):
        if zero[0] < x < X[0]:
            zero[0] = x
        elif X[0] <= x:
            ans = False
            break
    elif(a == 2):
        if zero[0] < x < X[0]:
            X[0] = x
        elif zero[0] >= x:
            ans = False
            break
    elif(a == 3):
        if zero[1] < y < X[1]:
            zero[1] = y
        elif X[1] <= y:
            ans = False
            break
    elif(a == 4):
        if zero[1] < y < X[1]:
            X[1] = y
        elif zero[1] >= y:
            ans = False
            break
if(ans):
    S = (X[1] - zero[1]) * (X[0] - zero[0])
    print(S)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
s = input()
K = int(input())

ans = ""
for i,value in enumerate(s):
    ask = ord(value)
    if K + ord(value) - ord("a") > 26:
        ans = ans + "a"
        K -= ord("z")  - ord(value) + 1
    else:
        ans = ans + value
    
if K > 0:
    if ord(ans[-1]) + K > ord("z"):
        last = chr(ord(ans[-1]) + K -26)
        ans = ans[:-1] +last
    else:
        last = chr(ord(ans[-1]) + K )
        ans = ans[:-1] +last
        
print(ans)

Fixed submission:
s = input()
K = int(input())

ans = []

for i in s:
    if i == "a":
        ans.append("a")
        continue
    
    if ord(i) + K >= ord("z") + 1:
        ans.append("a")
        K -= ord("z") + 1 - ord(i)
    
    else:
        ans.append(i)
        


last = (K + ord(ans[-1]) - ord('a')) % 26
ans[-1] = chr(ord("a") + last)
print(''.join(ans))

Buggy python submission (verdict: Runtime Error):
s = input()
K = int(input())

ans = ""
for i,value in enumerate(s):
    
    ask = ord(value)
    if K + ord(value) - ord("a") > 26:
        ans = ans + "a"
        K -= ord("z")  - ord(value) + 1
    else:
        ans = ans + s[i:]
        break
    
if K > 0:
    if ord(ans[-1]) + K > ord("z"):
        last = chr(ord(ans[-1]) + K -26)
        ans = ans[:-1] +last
    else:
        last = chr(ord(ans[-1]) + K )
        ans = ans[:-1] +last
        
print(ans)

Fixed submission:
s = input()
K = int(input())

ans = []

for i in s:
    if i == "a":
        ans.append("a")
        continue
    
    if ord(i) + K >= ord("z") + 1:
        ans.append("a")
        K -= ord("z") + 1 - ord(i)
    
    else:
        ans.append(i)
        


last = (K + ord(ans[-1]) - ord('a')) % 26
ans[-1] = chr(ord("a") + last)
print(''.join(ans))
Buggy python submission (verdict: Runtime Error):
import math

def main():
    N=int(input())
    ary = list(map(int,input().split()))
    ans = ary[0]
    for elem in ary:
        ans = math.gcd(ans,elem)
    print(ans)
    
if __name__=='__main__':
    main()

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def main():
    N=int(input())
    ary = list(map(int,input().split()))
    ans = ary[0]
    for elem in ary:
        ans = gcd(ans,elem)
    print(ans)

if __name__=='__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def main():
    # N=int(input())
    N,M = list(map(int,input().split()))
    a = list(map(int,input().split()))
    c = [2,5,5,4,5,6,3,7,6]
    dp = [-1e7 for _ in range(N+1)]
    dp[0] = 0
    for i in range(1,N+1):
        for j in a:
            dp[i] = max(dp[i],dp[i-c[j-1]]+1)
    ans = ""
    now = N
    for _ in range(dp[N]):
        ag = -1
        ma = -1
        for j in a:
            if now - c[j-1] < 0:
                continue
            if dp[now]!=dp[now-c[j-1]]+1:
                continue
            if j > ma:
                ma = j
        now -= c[ma-1]
        ans += str(ma)
    print(ans)

if __name__=='__main__':
    main()

Fixed submission:

def main():
    # N=int(input())
    N,M = list(map(int,input().split()))
    a = list(map(int,input().split()))
    c = [2,5,5,4,5,6,3,7,6]
    dp = [int(-1e7) for _ in range(N+1)]
    dp[0] = 0
    for i in range(1,N+1):
        for j in a:
            if i-c[j-1]>=0:
                dp[i] = max(dp[i],dp[i-c[j-1]]+1)
    ans = ""
    now = N
    for _ in range(dp[N]):
        ag = -1
        ma = -1
        for j in a:
            if now - c[j-1] < 0:
                continue
            if dp[now]!=dp[now-c[j-1]]+1:
                continue
            if j > ma:
                ma = j
        now -= c[ma-1]
        ans += str(ma)
    print(ans)

if __name__=='__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
INF=10**10

def main():
    
    n=int(input())
    array=[int(input()) for i in range(n)]
    
    answer=INF
    
    for a in range(-100,101):
        temp=0
        for b in array:
            temp+=(a-b)**2
        if temp<answer:
            answer=temp
    print(answer)
            

if __name__=="__main__":
    main()
    

Fixed submission:
# -*- coding: utf-8 -*-
INF=10**10

def main():
    
    n=int(input())
    array=list(map(int,input().split()))
    
    answer=INF
    
    for a in range(-100,101):
        temp=0
        for b in array:
            temp+=(a-b)**2
        if temp<answer:
            answer=temp
    print(answer)
            

if __name__=="__main__":
    main()

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
INF=10**20

def main():
    
    n=int(input())
    array=[int(input()) for i in range(n)]
    
    answer=INF
    
    for a in range(-100,101):
        temp=0
        for b in array:
            temp+=(a-b)**2
        if temp<answer:
            answer=temp
    print(answer)
            

if __name__=="__main__":
    main()
    

Fixed submission:
# -*- coding: utf-8 -*-
INF=10**10

def main():
    
    n=int(input())
    array=list(map(int,input().split()))
    
    answer=INF
    
    for a in range(-100,101):
        temp=0
        for b in array:
            temp+=(a-b)**2
        if temp<answer:
            answer=temp
    print(answer)
            

if __name__=="__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
INF=10**10

def main():
    
    str=input()
    n=len(str)
    if n==2:
        if str[0]==str[1]:
            print("1 2")
        else:
            print("-1 -1")
        
    
    for i in range(n-1):
        temp=str[i:i+3]
        for j in range(2):
            for k in range(j+1,3):
                if temp[j]==temp[k]:
                    print("{0} {1}".format(i+1,i+3))
                    return 0
    print("-1 -1")
    
if __name__=="__main__":
    main()
    

Fixed submission:
# -*- coding: utf-8 -*-
INF=10**10

def main():
    
    str=input()
    n=len(str)
    if n==2:
        if str[0]==str[1]:
            print("1 2")
            return 0
        else:
            print("-1 -1")
            return 0
        
    
    for i in range(n-2):
        temp=str[i:i+3]
        for j in range(2):
            for k in range(j+1,3): #(0,1),(0,2),(1,2)
                if temp[j]==temp[k]:
                    print("{0} {1}".format(i+1,i+3))
                    return 0
    print("-1 -1")
    
if __name__=="__main__":
    main()

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
INF=10**10

def main():
    
    str=input()
    n=len(str)
    if n==2:
        str("-1 -1")
        return 0
    
    for i in range(n-2):
        temp=str[i:i+3]
        for j in range(2):
            for k in range(j+1,2):
                if temp[j]==temp[k]:
                    print("{0} {1}".format(i+1,i+3))
                    return 0
    print("-1 -1")
    
if __name__=="__main__":
    main()
    

Fixed submission:
# -*- coding: utf-8 -*-
INF=10**10

def main():
    
    str=input()
    n=len(str)
    if n==2:
        if str[0]==str[1]:
            print("1 2")
            return 0
        else:
            print("-1 -1")
            return 0
        
    
    for i in range(n-2):
        temp=str[i:i+3]
        for j in range(2):
            for k in range(j+1,3): #(0,1),(0,2),(1,2)
                if temp[j]==temp[k]:
                    print("{0} {1}".format(i+1,i+3))
                    return 0
    print("-1 -1")
    
if __name__=="__main__":
    main()
Buggy python submission (verdict: Runtime Error):
s = list(input())
t = list(input())

ln = len(s)
lt = len(t)
n = ls - lt + 1
l = []

cnt = 0
for i in range(n):
    for j in range(lt):
        if t[j] != s[i + j]:
            cnt += 1
    l.append(cnt)
    cnt = 0
    
print(min(l))
        

Fixed submission:
s = list(input())
t = list(input())

ls = len(s)
lt = len(t)
n = ls - lt + 1
l = []

cnt = 0
for i in range(n):
    for j in range(lt):
        if t[j] != s[i + j]:
            cnt += 1
    l.append(cnt)
    cnt = 0
    
print(min(l))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

b = [0] * (n - 1)
for i in range(n - 1):
    b[i] = sum(a[i + 1 : n])
ans = 0
for i in range(n - 1):
    ans += a[i] * b[i]

print(ans % (10 ** 9 + 7))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))

all_sum = (sum(a) ** 2)
diff = [(a[i] ** 2) for i in range(n)]

ans = (all_sum - sum(diff)) // 2

print(ans % (10 ** 9 + 7))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

par = [i + 1 for i in range(n)]
rank = [0] * n
size = [1] * n

def find(x):
    if par[x - 1] == x:
        return x
    else:
        return find(par[x - 1])

def union(x, y):
    x = find(x)
    y = find(y)
    if rank[x] < rank[y]:
        par[x] = y
        size[x] += size[y]
    else:
        par[y] = x
        size[y] += size[x]
        if rank[x] == rank[y]:
            rank[x] += 1

for i in range(m):
    a, b = map(int, input().split())
    union(a, b)

print(max(size))

Fixed submission:
n, m = map(int, input().split())

par = [i + 1 for i in range(n)]
rank = [1] * n
size = [1] * n

def find(x):
    if par[x - 1] == x:
        return x
    else:
        return find(par[x - 1])

def union(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return
    if rank[x - 1] < rank[y - 1]:
        par[x - 1] = y
        size[y - 1] += size[x - 1]
    else:
        par[y - 1] = x
        size[x - 1] += size[y - 1]
        if rank[x - 1] == rank[y - 1]:
            rank[x - 1] += 1

for i in range(m):
    a, b = map(int, input().split())
    union(a, b)

print(max(size))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
group_num = [i + 1 for i in range(n)]
cnt = [0] * n

def find(x, y):
    if group_num[x - 1] == group_num[y - 1]:
        return True
    else:
        return False

def union(x, y):
    for i in range(n):
        if group_num[i] == group_num[x - 1]:
            group_num[i] = group_num[y - 1]
    return

for i in range(m):
    a, b = map(int, input().split())
    if find(a, b):
        continue
    else:
        union(a, b)

for i in range(n):
    cnt[group_num[i] - 1] += 1

print(max(cnt))

Fixed submission:
n, m = map(int, input().split())

par = [i + 1 for i in range(n)]
rank = [1] * n
size = [1] * n

def find(x):
    if par[x - 1] == x:
        return x
    else:
        return find(par[x - 1])

def union(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return
    if rank[x - 1] < rank[y - 1]:
        par[x - 1] = y
        size[y - 1] += size[x - 1]
    else:
        par[y - 1] = x
        size[x - 1] += size[y - 1]
        if rank[x - 1] == rank[y - 1]:
            rank[x - 1] += 1

for i in range(m):
    a, b = map(int, input().split())
    union(a, b)

print(max(size))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
q = int(input())

for i in range(q):
    o = list(map(int, input().split()))
    for j in range(n):
        if a[j] == o[0]:
            a[j] = o[1]
    print(sum(a))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
q = int(input())
s = sum(a)

count = [0] * 100000
for i in range(n):
    count[a[i] - 1] += 1
    
for i in range(q):
    o = list(map(int, input().split()))
    s += (o[1] - o[0]) * count[o[0] - 1]
    count[o[1] - 1] += count[o[0] - 1]
    count[o[0] - 1] = 0
    print(s)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

x = a * b * 100
print(x // 100)

Fixed submission:
a, b = input().split()
a = int(a)
b1, b2 = b.split('.')
b = int(b1 + b2)
print(a * b // 100)
Buggy python submission (verdict: Runtime Error):
t = input()

s = list(t)

for i in range(len(s)):
    if s[i] == '?':
        if i == 0:
            s[i] = 'D'
        if i < len(s) and s[i + 1] == 'P':
            s[i] = 'D'
        elif s[i - 1] == 'P':
            s[i] = 'D'
        elif s[i - 1] == 'D':
            s[i] = 'P'

print(''.join(s))

Fixed submission:
t = input()

s = list(t)

for i in range(len(s)):
    if s[i] == '?':
        if i > 0 and s[i - 1] == 'P':
            s[i] = 'D'
        elif i < len(s) - 1 and s[i + 1] == 'D':
            s[i] = 'P'
        else:
            s[i] = 'D'

print(''.join(s))
Buggy python submission (verdict: Runtime Error):
N = input()
x = N % 10
#xはNを10で割ったあまり

if x == 2 or x == 4 or x == 5 or x == 7 or x == 9:
    k = 'hon'
elif x == 0 or x == 1 or x == 6 or x == 8:
    k = 'pon'
elif x == 3:
    k = 'bon'

print(k)


Fixed submission:
N = int(input())
x = N % 10
#xはNを10で割ったあまり

if x == 2 or x == 4 or x == 5 or x == 7 or x == 9:
    k = 'hon'
elif x == 0 or x == 1 or x == 6 or x == 8:
    k = 'pon'
elif x == 3:
    k = 'bon'

print(k)

Buggy python submission (verdict: Runtime Error):
N = input()
x = N % 10
#xはNを10で割ったあまり

if x == 2 or x == 4 or x == 5 or x == 7 or x == 9:
    k = 'hon'
elif x == 0 or x == 1 or x == 6 or x == 8:
    k = 'pon'
else:
    k = 'bon'

print(k)

Fixed submission:
N = int(input())
x = N % 10
#xはNを10で割ったあまり

if x == 2 or x == 4 or x == 5 or x == 7 or x == 9:
    k = 'hon'
elif x == 0 or x == 1 or x == 6 or x == 8:
    k = 'pon'
elif x == 3:
    k = 'bon'

print(k)
Buggy python submission (verdict: Runtime Error):
a, b, h, m = input().split()

a, b, h, m = int(a, b, h, m)

#長針は60分で一周、短針は720分で一周
#長針は1分で6、短針は1分で0.5 合わせて5.5度離れる

min = (60 * h) + m
ang0 = (min * 5.5) % 360

if ang0 <= 180:
    ang = ang0
else:
    ang = 360 - ang0

import math
cos_ang = math.cos(math.radians(ang))

x = math.sqrt((a ** 2) + (b ** 2) - (2 * a * b * cos_ang))

print(x)


Fixed submission:
a, b, h, m = input().split()

a = int(a)
b = int(b)
h = int(h)
m = int(m)

#長針は60分で一周、短針は720分で一周
#長針は1分で6、短針は1分で0.5 合わせて5.5度離れる

min = (60 * h) + m
ang0 = (min * 5.5) % 360

if ang0 <= 180:
    ang = ang0
else:
    ang = 360 - ang0

import math
cos_ang = math.cos(math.radians(ang))

x = math.sqrt((a ** 2) + (b ** 2) - (2 * a * b * cos_ang))

print(x)

Buggy python submission (verdict: Runtime Error):
a, b, h, m = int(input().split())

#長針は60分で一周、短針は720分で一周
#長針は1分で6、短針は1分で0.5 合わせて5.5度離れる

min = (60 * h) + m
ang0 = (min * 5.5) % 360

if ang0 <= 180:
    ang = ang0
else:
    ang = 360 - ang0

import math
cos_ang = math.cos(math.radians(ang))

x = math.sqrt((a ** 2) + (b ** 2) - (2 * a * b * cos_ang))

print(x)


Fixed submission:
a, b, h, m = input().split()

a = int(a)
b = int(b)
h = int(h)
m = int(m)

#長針は60分で一周、短針は720分で一周
#長針は1分で6、短針は1分で0.5 合わせて5.5度離れる

min = (60 * h) + m
ang0 = (min * 5.5) % 360

if ang0 <= 180:
    ang = ang0
else:
    ang = 360 - ang0

import math
cos_ang = math.cos(math.radians(ang))

x = math.sqrt((a ** 2) + (b ** 2) - (2 * a * b * cos_ang))

print(x)

Buggy python submission (verdict: Runtime Error):
a, b, h, m = int(input().spllit())

#長針は60分で一周、短針は720分で一周
#長針は1分で6、短針は1分で0.5 合わせて5.5度離れる

min = (60 * h) + m
ang0 = (min * 5.5) % 360

if ang0 <= 180:
    ang = ang0
else:
    ang = 360 - ang0

import math
cos_ang = math.cos(math.radians(ang))

x = math.sqrt((a ** 2) + (b ** 2) - (2 * a * b * cos_ang))

print(x)

Fixed submission:
a, b, h, m = input().split()

a = int(a)
b = int(b)
h = int(h)
m = int(m)

#長針は60分で一周、短針は720分で一周
#長針は1分で6、短針は1分で0.5 合わせて5.5度離れる

min = (60 * h) + m
ang0 = (min * 5.5) % 360

if ang0 <= 180:
    ang = ang0
else:
    ang = 360 - ang0

import math
cos_ang = math.cos(math.radians(ang))

x = math.sqrt((a ** 2) + (b ** 2) - (2 * a * b * cos_ang))

print(x)
Buggy python submission (verdict: Runtime Error):
a, b, c, k = input().split()

if a >= k:
    sum = k
elif a + b >= k:
    sum = k
else:
    sum = a - c
    
print(sum)

Fixed submission:
a, b, c, k = input().split()

a = int(a)
b = int(b)
c = int(c)
k = int(k)

if a >= k:
    sum = k
elif a + b >= k:
    sum = a
else:
    sum = a - (k - a - b)
    
print(sum)
Buggy python submission (verdict: Runtime Error):
k = int(input())
a, b = map(int, input().split())

flag = False
for i in range(a, b + 1):
    if i // k > 0 ans i % k == 0:
        flag = True
        
if flag:
    print('OK')
else:
    print('NG')

Fixed submission:
k = int(input())
a, b = map(int, input().split())

flag = False
for i in range(a, b + 1):
    if i % k == 0:
        flag = True
        
if flag:
    print('OK')
else:
    print('NG')
Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
m = 100

import math
count = 0
while True:
    if m >= x:
        print(count)
        break
    x = math.floor(m * 1.01)
    count += 1
    


Fixed submission:
x = int(input())
m = 100

count = 0
while m < x:
    m += m // 100
    count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
m = 100

import math
count = 0
while True:
    if m >= x:
        print(count)
        break
    x = math.floor(100 * 1.01)
    count += 1
    

Fixed submission:
x = int(input())
m = 100

count = 0
while m < x:
    m += m // 100
    count += 1

print(count)