Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math
n,x=map(int,input().split())
pl=sorted(list(map(int,input().split()))+[x])
ans=abs(pl[1]-pl[0])
if len(pl)>1:
    for i in range(len(pl)-2):
        ans=math.gcd(ans,abs(pl[i+2]-pl[i+1]))
print(ans)

Fixed submission:
import fractions
n,x=map(int,input().split())
pl=sorted(list(map(int,input().split()))+[x])
ans=abs(pl[1]-pl[0])
if len(pl)>1:
    for i in range(len(pl)-2):
        ans=fractions.gcd(ans,abs(pl[i+2]-pl[i+1]))
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
n,x=map(int,input().split())
pl=list(map(int,input().split()))
ans=abs(pl[1]-pl[0])
if len(pl)>1:
    for i in range(len(pl)-2):
        ans=math.gcd(ans,abs(pl[i+2]-pl[i+1]))
print(ans)

Fixed submission:
import fractions
n,x=map(int,input().split())
pl=sorted(list(map(int,input().split()))+[x])
ans=abs(pl[1]-pl[0])
if len(pl)>1:
    for i in range(len(pl)-2):
        ans=fractions.gcd(ans,abs(pl[i+2]-pl[i+1]))
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n,c,k=map(int,input().split())
t=[0]*n
s=0
a=0
for i in range(n):
	t[i]=int(input())
    if i>0 and a>0:
      if t[i]-t[i-1]<=k:
        s+=(a+n)//c
        a=(a+n)%c
      else:
      	s+=math.ceil((a+n)/c)
        a=0
print(s)

Fixed submission:
n,c,k=map(int,input().split())
t=[0]*n
for i in range(n):
    t[i]=int(input())
t.sort()
s=0
lt=0
ln=0

if c==1:
    print(n)
    exit()
for i in range(n):

    if i==0:
       lt=i
       ln+=1

    else:
        if t[i]-t[lt]>k:
            s+=1
            lt=i
            ln=0

        ln+=1
        if ln==c:
            s+=1
            lt=i+1
            ln=0

        #print(i, s, lt, ln)


    
if ln>0:
    s+=1

print(s)
Buggy python submission (verdict: Runtime Error):
def main():
    N = input()
    sum = 0
    for i in range(N):
        i = i+1
        if i%3 ==0 or i%5 ==0 or i%15 ==0:
            continue
        else:
            sum = sum + i

    print(sum)




if __name__ == "__main__":
    main()

Fixed submission:
def main():
    N = int(input())
    sum = 0
    for i in range(N):
        i = i+1
        if i%3 == 0 or i%5 == 0 or i%15 == 0:
            continue
        else:
            sum = sum + i

    print(sum)




if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
s = input()
a = s[::2].count('0') + s[1::2].count('1')
b = s[::2].count('1') + s[1::2].count('0')
print(min(a, b))

Fixed submission:
s = str(raw_input())
a = s[::2].count('0') + s[1::2].count('1')
b = s[::2].count('1') + s[1::2].count('0')
print(min(a, b))

Buggy python submission (verdict: Runtime Error):
s = input()
a = s[::2].count('0') + s[1::2].count('1')
b = s[::2].count('1') + s[1::2].count('0')
print(min(a, b))

Fixed submission:
s = str(raw_input())
a = s[::2].count('0') + s[1::2].count('1')
b = s[::2].count('1') + s[1::2].count('0')
print(min(a, b))
Buggy python submission (verdict: Runtime Error):
temp = str(input())
count = 0
 
for i in temp:
  if i == 'R':
    count = count + 1
    max_count = count
  else:
    if max_count < count:
      max_count = count
    count = 0
    
print(max_count)

Fixed submission:
temp = str(input())
count = 0
max_count = 0 

for i in temp:
  if i == 'R':
    count = count + 1
    max_count = count
  else:
    if max_count < count:
      max_count = count
    count = 0
    
print(max_count)

Buggy python submission (verdict: Runtime Error):
temp = str(input())
count = 0
 
for i in temp:
  if i == 'R':
    count = count + 1
  else:
    max_count = count
    count = 0
    
print(max_count)

Fixed submission:
temp = str(input())
count = 0
max_count = 0 

for i in temp:
  if i == 'R':
    count = count + 1
    max_count = count
  else:
    if max_count < count:
      max_count = count
    count = 0
    
print(max_count)

Buggy python submission (verdict: Runtime Error):
temp = str(input())
count = 0

for i in temp:
  if i == R:
    count = count + 1
  else:
    count = 0
    
print(count)

Fixed submission:
temp = str(input())
count = 0
max_count = 0 

for i in temp:
  if i == 'R':
    count = count + 1
    max_count = count
  else:
    if max_count < count:
      max_count = count
    count = 0
    
print(max_count)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().split())
A = list(map(int, input().split()))

count = 0

for i in range(N - K + 1):
  kake_A = 1
  for j in range(K):
    kake_A = kake_A * A[j + i]
  count = count + 1
  if count == 1:
    kake_B = kake_A
    continue
  else:
    if kake_A > kake_B:
      print('Yes')
    else:
      print('No')
    kake_B = kake_A

Fixed submission:
N,K = map(int, input().split())
A = list(map(int, input().split()))

count = 0

for i in range(N - K):
  kake_A = A[i]
  kake_B = A[i + K]
  if kake_A >= kake_B:
    print('No')
  else:
    print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().split())
A = list(map(int, input().split()))

count = 0

for i in range(N - K + 1):
  kake_A = 1
  for j in range(K):
    kake_A = kake_A * A[j + i]
  count = count + 1
  if count == 1:
    kake_B = kake_A
    continue
  else:
    if kake_A > kake_B:
      print('Yes')
    else:
      print('No')
    kake_B = kake_A

Fixed submission:
N,K = map(int, input().split())
A = list(map(int, input().split()))

count = 0

for i in range(N - K):
  kake_A = A[i]
  kake_B = A[i + K]
  if kake_A >= kake_B:
    print('No')
  else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
X,N = map(int, input().split())
try:
  p = list(map(int, input().split()))
except EOFError:
  p = []

int_list = [i for i in range(1,101)]
forbidden_list = list(set(int_list) - set(p))
num_X = int_list.index(X)
c = 10000000

if X in forbidden_list:
  print(X)
else:
  for i in range(len(forbidden_list) - 1):
    a = abs(X - forbidden_list[i])
    b = abs(X - forbidden_list[i + 1])
    if a == b:
      print(forbidden_list[i])
      break
    elif c > a:
      c = a
    elif c <= a and b > a:
      print(forbidden_list[i - 1])
      break
    else:
      print(forbidden_list[i])
      break
  else:
    print(forbidden_list[-1])

Fixed submission:
X,N = map(int, input().split())
try:
  p = list(map(int, input().split()))
except EOFError:
  p = []
  
int_list = [i for i in range(102)]
forbidden_list = sorted(list(set(int_list) - set(p)))
num_X = int_list.index(X)
c = 10000000
 
if X in forbidden_list:
  print(X)
else:
  for i in range(len(forbidden_list) - 1):
    a = abs(X - forbidden_list[i])
    b = abs(X - forbidden_list[i + 1])
    if a == b:
      print(forbidden_list[i])
      break
    elif c > a:
      c = a
    elif c <= a and b >= a:
      print(forbidden_list[i - 1])
      break
    elif b < a:
      print(forbidden_list[i])
      break
  else:
    if a < b:
      print(forbidden_list[i])
    else:
      print(forbidden_list[i + 1])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_list = list(map(int, input().split()))

n = 1
for i in A_list:
  if 0 in A_list:
    print(0)
    break
  n = n * i
  if n > 1000000000000000000:
    print(-1)
    break
else:
  print(n)

Fixed submission:
N = int(input())
A_list = list(map(int, input().split()))
A_list.sort(reverse=True)
n = 1
for i in A_list:
  if A_list[-1] == 0:
    print(0)
    break
  n = n * i
  if n > 1000000000000000000:
    print(-1)
    break
else:
  print(n)
Buggy python submission (verdict: Runtime Error):
N = int(input())
list = []

for i in range(N):
	if (i+1) % 3 == 0:
	
	elif (i+1) % 5 == 0:
	
	else:
		list.append(i+1)

print(sum(list))

Fixed submission:
N = int(input())
list = []
 
for i in range(N):
  if (i+1) % 3 == 0:
    pass
  elif (i+1) % 5 == 0:
    pass
  else:
    list.append(i+1)
    
print(sum(list))
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int(input().slice()))

print(C,A,B)

Fixed submission:
A,B,C = map(int, input().split())

print(C,A,B)

Buggy python submission (verdict: Runtime Error):
A,B,C = map(int(input().slice()))

print(C,A,B)

Fixed submission:
A,B,C = map(int, input().split())

print(C,A,B)
Buggy python submission (verdict: Runtime Error):
k = input()

list = []
list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(list[k-1])


Fixed submission:
k = int(input())

list = []
list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(list[k-1])
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
# 割り算の商
a = N // 2
# 割り算のあまり
b = N % 2
# 余りが計算
if b = 0 :
  #出力
  print(a)
else:
  print(a + 1)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
# 割り算の商
a = N // 2
# 割り算のあまり
b = N % 2
# 余りが計算
if b == 0 :
  #出力
  print(a)
else:
  print(a + 1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A_list = [map(int, input().split())]
count = 0

while (True):
    exist_odd = False
    for i in range(N):
        if A_list[i] % 2 != 0:
            exist_odd = True

    if exist_odd:
        break
    
    for i in range(N):
        A_list[i] = A_list[i] / 2

    count = count + 1

print(count)

Fixed submission:
N = int(input())
A_list = list(map(int, input().split()))
count = 0

while (True):
    exist_odd = False
    for i in range(N):
        if (A_list[i] % 2) != 0:
            exist_odd = True

    if exist_odd:
        break
    
    for i in range(N):
        A_list[i] = A_list[i] / 2

    count = count + 1

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

ans = a[0]
for i in range(1,n):
    ans = ans * a[i]
    
if ans > 10 ** 18:
    print(-1)
else:
    print(ans)  

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

ans = a[0]

if 0 in a:
    print(0)
else:
    for i in range(1,n):
        ans = ans * a[i]
        if ans > 10 ** 18:
            break  
    if ans > 10 ** 18:
        print(-1)
    else:
        print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = input().split()
a = int(a)
b = Decimal(b)

print(int(a*b))

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

from decimal import Decimal

a = int(a)
b = Decimal(b)

print(int(a*b))
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())

import math
import itertools
num_list = list(list(itertools.product(range(1,k+1), repeat=3)))

sum_ = 0
for i,j,k in num_list:
    sum_ += math.gcd(i, math.gcd(j, k))
    
print(sum_)

Fixed submission:
k = int(input())
from math import gcd
sum_ = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for k in range(1, k+1):
            sum_ += gcd(i, gcd(j, k))
print(sum_)

Buggy python submission (verdict: Time Limit Exceeded):
import math

k = int(input())

sum_ = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for k in range(1, k+1):
            sum_ += math.gcd(i, math.gcd(j, k))
print(sum_)

Fixed submission:
k = int(input())
from math import gcd
sum_ = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for k in range(1, k+1):
            sum_ += gcd(i, gcd(j, k))
print(sum_)

Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

sum_ = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for k in range(1, k+1):
            ttt = gcd(i, j, k)
            sum_ = sum_ + ttt

print(sum_)

Fixed submission:
k = int(input())
from math import gcd
sum_ = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for k in range(1, k+1):
            sum_ += gcd(i, gcd(j, k))
print(sum_)
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())

import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
if n <= 1 and m <= 1:
    print(0)
elif n == 1 and m <= 1:
    print(comb(m,2))
elif n <= 1 and m == 1:
    print(comb(n,2))
else:
    print(comb(n,2) + comb(m,2))

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

import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if n == 0:
    base1 = 0
elif n == 1:
    base1 = 0
else:
    base1 = comb(n,2)

if m == 0:
    base2 = 0
elif m == 1:
    base2 = 0
else:
    base2 = comb(m,2)

print(base1 + base2)

Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
 
import math
 
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
if n == 1 and m == 1:
    print(0)
elif n == 1 and m != 1:
    print(comb(m,2))
elif n != 1 and m == 1:
    print(comb(n,2))
else:
    print(comb(n,2) + comb(m,2))

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

import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if n == 0:
    base1 = 0
elif n == 1:
    base1 = 0
else:
    base1 = comb(n,2)

if m == 0:
    base2 = 0
elif m == 1:
    base2 = 0
else:
    base2 = comb(m,2)

print(base1 + base2)

Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())

import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
if n == 1 and m == 1:
    print(0)
elif n == 1 and m != 1:
    print(comb(m,2))
elif n != 1 and m == 1:
    print(comb(n,2))
else:
    print(comb(n,2) + comb(m,2))

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

import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if n == 0:
    base1 = 0
elif n == 1:
    base1 = 0
else:
    base1 = comb(n,2)

if m == 0:
    base2 = 0
elif m == 1:
    base2 = 0
else:
    base2 = comb(m,2)

print(base1 + base2)
Buggy python submission (verdict: Runtime Error):
K = input()

t = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(t[K + 1])

Fixed submission:
K = int(input())

t = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(t[K - 1])
Buggy python submission (verdict: Runtime Error):
import math

a,b = input().split()

B_low = math.ceil(b * 10)
A_high = math.floor((a+1) * 12.5)

if A_high < B_low:
    print('-1')
else:
    print(B_low)

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

ans = -1
for i in range(10,12501):
    if int(i*0.08) == a and int(i * 0.1) == b:
        ans = i
        break
        
print(ans)
Buggy python submission (verdict: Runtime Error):
N = input()

mod = N % 2
if mod == 0:
    x = N // 2
else:
    x = N // 2 + 1
    
print(x)

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

mod = N % 2
if mod == 0:
    x = N // 2
else:
    x = N // 2 + 1
    
print(x)

Buggy python submission (verdict: Runtime Error):
mod = N % 2
if mod == 0:
    x = N // 2
else:
    x = N // 2 + 1
    
print(x)

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

mod = N % 2
if mod == 0:
    x = N // 2
else:
    x = N // 2 + 1
    
print(x)

Buggy python submission (verdict: Runtime Error):
mod = N % 2
if mod == 0:
    x = N // 2
else:
    x = N // 2 + 1

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

mod = N % 2
if mod == 0:
    x = N // 2
else:
    x = N // 2 + 1
    
print(x)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())

f a == b:
    if b == c:
        print('No')
    else:
        print('Yes')
elif b == c:
    print('Yes')
elif c == a:
    print('Yes')
else:
    print('No')

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

if a == b:
    if b == c:
        print('No')
    else:
        print('Yes')
elif b == c:
    print('Yes')
elif c == a:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a,b = input().split()

a_ = a * int(a)
b_ = b * int(b)

moji = sorted([a_ ,b_])

print(mojj[0])

Fixed submission:
a,b = input().split()
 
a_ = a * int(b)
b_ = b * int(a)
 
moji = sorted([a_ ,b_])
 
print(moji[0])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = [int(i) for i in input().split()]

m = []
for i in range(1,n+1):
    m.append(sorted(p[:i])[0])
    
ans = 0
for i in range(n):
    if m[i] == p[i]:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
ppp = list(map(int, input().split()))
curr = 10 ** 6
ans = 0
for p in ppp:
    if p < curr:
        ans += 1
        curr = p
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = [int(i) for i in input().split()]

ans = 0
for i in range(1, n+1):
    low = sorted(p[:i])
    if low[0] == p[i-1]:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
ppp = list(map(int, input().split()))
curr = 10 ** 6
ans = 0
for p in ppp:
    if p < curr:
        ans += 1
        curr = p
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = [int(i) for i in input().split()]

ans = 0
for i in range(1, n+1):
    low = p[:i]
    if min(low) == p[i-1]:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
ppp = list(map(int, input().split()))
curr = 10 ** 6
ans = 0
for p in ppp:
    if p < curr:
        ans += 1
        curr = p
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))

ans = 0
for i in range(n):
    p_list = list(sorted(p[:i+1])) 
    
    if p_list[0] == p[i]:
        ans += 1
    
print(ans)

Fixed submission:
n = int(input())
ppp = list(map(int, input().split()))
curr = 10 ** 6
ans = 0
for p in ppp:
    if p < curr:
        ans += 1
        curr = p
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())

if a*b ==2:
    print(3)
elif a*b ==3:
    print(2)
else:
    print(1)

Fixed submission:
a = int(input())
b = int(input())

if a*b ==2:
    print(3)
elif a*b ==3:
    print(2)
else:
    print(1)
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())

import math
lcm = (a * b) / math.gcd(a, b)

lcm = int(lcm)

print(lcm)

Fixed submission:
import fractions
A, B = map(int, input().split())
print(A*B//fractions.gcd(A, B))

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
import math
lcm = a * b / math.gcd(a, b)

lcm = int(lcm)
print(lcm)

Fixed submission:
import fractions
A, B = map(int, input().split())
print(A*B//fractions.gcd(A, B))

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
import math
lcm = a * b / math.gcd(a, b)
print(int(lcm))

Fixed submission:
import fractions
A, B = map(int, input().split())
print(A*B//fractions.gcd(A, B))

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
 
import math
 
lcm = a * b / math.gcd(a, b)
 
print(int(lcm))


Fixed submission:
import fractions
A, B = map(int, input().split())
print(A*B//fractions.gcd(A, B))

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

import math

lcm = a * b / math.gcd(a, b)

print(int(lcm))

Fixed submission:
import fractions
A, B = map(int, input().split())
print(A*B//fractions.gcd(A, B))

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

if a < b:
    ttt = a
else:
    ttt = b
    
num_list = [1]
for i in range(2,ttt+1):
    mod_a = a % i
    mod_b = b % i
    if mod_a == 0 and mod_b == 0:
        c.append(i)

import numpy as np
if sum(c) == 1:
    print(a*b)
else:
    print(np.prod(np.array(c)))

Fixed submission:
import fractions
A, B = map(int, input().split())
print(A*B//fractions.gcd(A, B))
Buggy python submission (verdict: Runtime Error):
n = int(input())
 
s = input()
 
alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","M","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
 
ans = ""
for i in range(len(s)):
    num = (alphabet.index(s[i]) + n) % len(alphabet)
    ans += alphabet[num]
    
print(ans)

Fixed submission:
n = int(input())
 
s = input()
 
alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
 
ans = ""
for i in range(len(s)):
    num = (alphabet.index(s[i]) + n) % len(alphabet)
    ans += alphabet[num]
    
print(ans)

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

s = input()

alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","M","O","P","Q","R","S","T","U","V","W","X","Y","Z"]

ans = ""
for i in range(len(s)):
    num = ( alphabet.index(s[i]) + n ) % len(alphabet)
    ans += alphabet[num]
    
print(ans)

Fixed submission:
n = int(input())
 
s = input()
 
alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
 
ans = ""
for i in range(len(s)):
    num = (alphabet.index(s[i]) + n) % len(alphabet)
    ans += alphabet[num]
    
print(ans)

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

n = int(input())

alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","M","O","P","Q","R","S","T","U","V","W","X","Y","Z"]

ans = ""
for i in range(len(s)):
    num = ( alphabet.index(s[i]) + n ) % 26
    ans += alphabet[num]
    
print(ans)

Fixed submission:
n = int(input())
 
s = input()
 
alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
 
ans = ""
for i in range(len(s)):
    num = (alphabet.index(s[i]) + n) % len(alphabet)
    ans += alphabet[num]
    
print(ans)
Buggy python submission (verdict: Runtime Error):
import bisect

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
 
A.sort()
C.sort()
 
ans = 0
for i in range(n):
    a = bisect.bisect_left(A, B[i])
    c = bisect.bisect_right(C, B[i])
    ans += a*(N-c)
print(ans)

Fixed submission:
import bisect

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
 
A.sort()
C.sort()
 
ans = 0
for i in range(N):
    a = bisect.bisect_left(A, B[i])
    c = bisect.bisect_right(C, B[i])
    ans += a*(N-c)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

c.sort()

### 二分探索
ans = 0
for i in range(n):
    for j in range(n):
        if a[i] < b[j]:
            for k in range(len(c)):
                low = 0
                high = len(c) - 1
                item = c[k]

                while low <= high:
                    mid = (low + high) //2
                    guess = c[mid]
                    if guess == item:
                        break
                    if guess > item:
                        high = mid -1
                    else:
                        low = mid + 1

                if c[mid] > b[j]:
                    ans += 1
print(ans)

Fixed submission:
import bisect

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
 
A.sort()
C.sort()
 
ans = 0
for i in range(N):
    a = bisect.bisect_left(A, B[i])
    c = bisect.bisect_right(C, B[i])
    ans += a*(N-c)
print(ans)