Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,p = map(int,input().split())
import sympy
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

tmp = factorization(p)
ans = 1
for i in range(len(tmp)):
    while tmp[i][1]>=n:
        tmp[i][1]-=n
        ans*=tmp[i][0]
print(ans)

Fixed submission:
n,p=map(int,input().split())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

a=factorization(p) 
ans=1
for i in range(len(a)):
    if n<=a[i][1]:
        while a[i][1]>=n:
            ans=ans*a[i][0]
            a[i][1]-=n      
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for _ in range(n):
    i = int(input())
    try:
        a.remove(i)
    except ValueError:
        a.append(i)
print(len(a))

Fixed submission:
import collections
import numpy as np
n = int(input())
a = []
for _ in range(n):
    a.append(int(input()))
ans = collections.Counter(a)
c=list(ans.values())
c=np.array(c)
print(sum(c%2))
Buggy python submission (verdict: Time Limit Exceeded):
n = input()
sz = input().split(" ")
t = []
for i in range(len(sz)) :
    t.append(int(sz[i]))

ans = 0
mod = 1e9 + 7

for i in range(len(t)) :
    for j in range(i+1, len(t)) :
        ans += t[i]*t[j]

print(int(ans%mod))

Fixed submission:
n = int(input())
sz = [int(x) for x in input().split(" ")]

ans = sum(sz)*sum(sz)

for i in sz :
    ans -= i*i

ans //= 2
ans %= (10**9+7)

print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
def floor(x) :
    return int(x)
    
s = input().split(" ")
a = int(s[0])
b = int(s[1])
n = int(s[2])
M = 0

for i in range(1,n+1) :
    if M<(floor(a*i/b)-a*floor(i/b)) :
        M = (floor(a*i/b)-a*floor(i/b))

print(M)


Fixed submission:
s = input().split()

a = int(s[0])
b = int(s[1])
n = int(s[2])

if b==1 :
    print(0)
else :
    c = min(b-1,n)
    m = (a*c)//b
    print(m)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
for a in range(n):
    breaked = True
    for b in range(-n, n):
        if a**5 - b**5 == n:
            print(a, b)
            break;
    else:
        breaked = False
    if breaked:
        break


Fixed submission:
n = int(input())
for a in range(n):
    breaked = True
    for b in range(-1000, 1000):
        if a**5 - b**5 == n:
            print(a, b)
            break;
    else:
        breaked = False
    if breaked:
        break
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

x = []
y = []

for i, elem in enumerate(a):
    x.append(i+a[i])
    y.append(i-a[i])

ans = 0

for i in x:
    ans += y.count(i)

print(ans)


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

x = []
y = {}

for i, elem in enumerate(a):
    x.append(i+a[i])
    y[i-a[i]] = y.get(i-a[i], 0) + 1

ans = 0

for i in x:
    ans += y.get(i, 0)

print(ans)

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

x = []
y = []

for i, elem in enumerate(a):
    x.append(i+a[i])
    y.append(i-a[i])

ans = 0

for j in range(n):
    for i in range(j):
        if x[i] == y[j]:
            ans += 1;

print(ans)


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

x = []
y = {}

for i, elem in enumerate(a):
    x.append(i+a[i])
    y[i-a[i]] = y.get(i-a[i], 0) + 1

ans = 0

for i in x:
    ans += y.get(i, 0)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from random import randint

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

last = {}
ans = 0;

for _ in range(10**7):
    x = randint(0, n-1)
    y = randint(0, n-1)
    if abs(x-y) == a[x]+a[y] and last.get((x, y), "Hola") == "Hola":
        ans += 1;
        last[(x, y)] = 1;
        last[(y, x)] = 1;

print(ans)


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

x = []
y = {}

for i, elem in enumerate(a):
    x.append(i+a[i])
    y[i-a[i]] = y.get(i-a[i], 0) + 1

ans = 0

for i in x:
    ans += y.get(i, 0)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from random import randint

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

last = {}
ans = 0;

for _ in range(10**8):
    x = randint(0, n-1)
    y = randint(0, n-1)
    if abs(x-y) == a[x]+a[y] and last.get((x, y), "Hola") == "Hola":
        ans += 1;
        last[(x, y)] = 1;
        last[(y, x)] = 1;

print(ans)


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

x = []
y = {}

for i, elem in enumerate(a):
    x.append(i+a[i])
    y[i-a[i]] = y.get(i-a[i], 0) + 1

ans = 0

for i in x:
    ans += y.get(i, 0)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from random import randint

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

last = {}
ans = 0;

for _ in range(10**9):
    x = randint(0, n-1)
    y = randint(0, n-1)
    if abs(x-y) == a[x]+a[y] and last.get((x, y), "Hola") == "Hola":
        ans += 1;
        last[(x, y)] = 1;
        last[(y, x)] = 1;

print(ans)


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

x = []
y = {}

for i, elem in enumerate(a):
    x.append(i+a[i])
    y[i-a[i]] = y.get(i-a[i], 0) + 1

ans = 0

for i in x:
    ans += y.get(i, 0)

print(ans)
Buggy python submission (verdict: Runtime Error):
x = int(input())
print(x//500*500*2+x%500//5*5)

Fixed submission:
a = input()
print("Yes" if a[2] == a[3] and a[4] == a[5] else "No")

Buggy python submission (verdict: Runtime Error):
x = int(input())
print(x//500*500*2+x%500//5*5)

Fixed submission:
a = input()
print("Yes" if a[2] == a[3] and a[4] == a[5] else "No")
Buggy python submission (verdict: Runtime Error):
def is_palindrome(s):
    i = 0
    n = len(s)-1
    while s[i] == s[n]:
        i += 1
        n -= 1
        if i >= n:
            break
    else:
        return False
    return True

s = input()
n = len(s)

if is_palindrome(s) and is_palindrome(s[0:(n-1)//2-1]) and is_palindrome(s[(n+3)//2-1:]):
    print("Yes")
else:
    print("No")


Fixed submission:
def is_palindrome(s):
    if len(s) > 1:
        i = 0
        n = len(s)-1
        while s[i] == s[n]:
            i += 1
            n -= 1
            if i >= n:
                break
        else:
            return False
        return True
    else:
        return True

s = input()
n = len(s)

if is_palindrome(s) and is_palindrome(s[0:(n-1)//2]) and is_palindrome(s[(n+3)//2-1:]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s = input()
if s[0] == s[1] and a[1] == a[2]:
  print("No")
else:
  print("Yes")

Fixed submission:
s = input()
if s[0] == s[1] and s[1] == s[2]:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())

s = ""
i = 0

while len(s) < n:
    s += "b"*a if i%2==0 else "r"*b
    i += 1

print(s[:n].count("b"))


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

print(n // (a + b) * a + min(a, n%(a+b)))
Buggy python submission (verdict: Runtime Error):
def ans(p, x):
    a = 0
    for i in x:
        a += (i - p)**2
    return a

n = int(input())
x = list(map(int, input().split()))

p = sum(x)//n

print(min(ans(p), ans(p+1)))


Fixed submission:
def ans(p, x):
    a = 0
    for i in x:
        a += (i - p)**2
    return a

n = int(input())
x = list(map(int, input().split()))

p = sum(x)//n

print(min(ans(p, x), ans(p+1, x)))
Buggy python submission (verdict: Runtime Error):
if (n := int(input())) > 0:
  for _ in range(n):
    input()

Fixed submission:
class Counter(dict):
  def __missing__(self, i):
    return 0

n = int(input())

s = Counter()

for _ in range(n):
  i = input()
  s[i] += 1

s = list(sorted(s.items(), key=lambda x: -x[1]))
m = s[0][1]

ans = []
for key, value in s:
  if value == m:
    ans.append(key)
  else:
    break

ans.sort()

print('\n'.join(ans))

Buggy python submission (verdict: Runtime Error):
class Counter(dict):
  def __missing__(self, i):
    return 0

n = int(input())

s = Counter()

for _ in range(n):
  i = input()
  s[i] += 1

s = dict(sorted(s.items(), key=lambda x: x[1]))
m = s.values()[0]

ans = []
for i in s:
  if s[i] == m:
    ans.append(i)

print('\n'.join(ans))

Fixed submission:
class Counter(dict):
  def __missing__(self, i):
    return 0

n = int(input())

s = Counter()

for _ in range(n):
  i = input()
  s[i] += 1

s = list(sorted(s.items(), key=lambda x: -x[1]))
m = s[0][1]

ans = []
for key, value in s:
  if value == m:
    ans.append(key)
  else:
    break

ans.sort()

print('\n'.join(ans))
Buggy python submission (verdict: Runtime Error):
input()
a = input().split()

x = {}
for i in a:
	if x.get(i, False):
		print("No")
		break
    x[i] = True
else:
	print("Yes")


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

ans = "YES"
x = {}
for i in a:
    if x.get(i, False):
        ans = "NO"
        break
    x[i] = True

print(ans)

Buggy python submission (verdict: Runtime Error):
input()
a = input().split()

x = {}
for i in a:
	if x.get(i, False):
		print("No")
		break
    x[i] = True
else:
	print("Yes")

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

ans = "YES"
x = {}
for i in a:
    if x.get(i, False):
        ans = "NO"
        break
    x[i] = True

print(ans)
Buggy python submission (verdict: Runtime Error):
# unihernandez22
# https://atcoder.jp/contests/abc151/tasks/abc151_c
# implementation

class Counter(dict):
    def __missing__(self, i):
        return 0

n, m = map(int, input().split())

passed = 0
penalties = Counter()

ac = {}

for i in range(m):
    p, s = input().split()
    if not ac.get(p, False):
        if s == "WA": penalties[p] += 1
        elif s == "AC":
            passed += 1
            ac[p] = True

x = 0
for i in penalties:
    if ac[i]:
        x += penalties[i]

print(passed, x)


Fixed submission:
# unihernandez22
# https://atcoder.jp/contests/abc151/tasks/abc151_c
# implementation

class Counter(dict):
    def __missing__(self, i):
        return 0

class BoolDict(dict):
    def __missing__(self, i):
        return False

n, m = map(int, input().split())

passed = 0
penalties = Counter()

ac = BoolDict()

for i in range(m):
    p, s = input().split()
    if not ac[p]:
        if s == "WA": penalties[p] += 1
        elif s == "AC":
            passed += 1
            ac[p] = True

x = 0
for i in penalties:
    if ac[i]:
        x += penalties[i]

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

ans = 0
for i in range(1, len(x)):
  ans += min(b, (x[i]-x[i-1]+a-1)//a*a)

print(ans)

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

ans = 0
for i in range(1, len(x)):
  ans += min(b, (x[i]-x[i-1])*a)

print(ans)

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

ans = 0
for i in range(1, x):
  ans += min(b, (x[i]-x[i-1]+a-1)//a*a)

print(ans)

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

ans = 0
for i in range(1, len(x)):
  ans += min(b, (x[i]-x[i-1])*a)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# unihernandez22 & Vicfred
# https://atcoder.jp/contests/abc166/tasks/abc166_d
# math, probability
from random import randint

n = int(input())

for _ in range(10**8):
    x = randint(-1000,1000)
    y = randint(-1000,1000)
    if x**5 - y**5 == n:
        print(x,y)
        break;



Fixed submission:
# unihernandez22
# https://atcoder.jp/contests/abc166/tasks/abc166_d
# math
n = int(input())
for a in range(n):
    breaked = True
    for b in range(-1000, 1000):
        if a**5 - b**5 == n:
            print(a, b)
            break;
    else:
        breaked = False
    if breaked:
        break

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
for a in range(-1000,1000):
    for b in range(-1000, 1000):
        if a**5 - b**5 == n:
            print(a, b)
            break;


Fixed submission:
# unihernandez22
# https://atcoder.jp/contests/abc166/tasks/abc166_d
# math
n = int(input())
for a in range(n):
    breaked = True
    for b in range(-1000, 1000):
        if a**5 - b**5 == n:
            print(a, b)
            break;
    else:
        breaked = False
    if breaked:
        break
Buggy python submission (verdict: Runtime Error):
# Vicfred
# https://atcoder.jp/contests/abc132/tasks/abc132_b
# implementation
n = int(input())
p = list(map(int,input()))

answer = 0
for i in range(1, n-1):
    if p[i-1] < p[i] < p[1+1] or p[i-1] > p[i] > p[i+1]:
        answer += 1

print(answer)



Fixed submission:
# Vicfred
# https://atcoder.jp/contests/abc132/tasks/abc132_b
# implementation
n = int(input())
p = list(map(int,input().split()))

answer = 0
for i in range(1, n-1):
    if p[i-1] < p[i] < p[i+1] or p[i-1] > p[i] > p[i+1]:
        answer += 1

print(answer)
Buggy python submission (verdict: Runtime Error):
# Vicfred
# https://atcoder.jp/contests/abc042/tasks/abc042_a
# sorting
import algorithm, strutils, sequtils

var line = stdin.readLine.split.map(parseInt)
line.sort
if line == [5, 5, 7]:
  echo "YES"
else:
  echo "NO"



Fixed submission:
# Vicfred
# https://atcoder.jp/contests/abc042/tasks/abc042_a
# implementation, sorting
ins = list(map(int, input().split()))
ins.sort()

if ins == [5, 5, 7]:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):

h,w = map(int,input().split())

def isvalid(r,c):
    return 0 <= r < h and 0 <= c < w

g = [input() for _ in range(h)]
d = [1,0,-1,0]
queue = [(0,0)]
dist = [[1000000]* h for _ in range(w)]
dist[0][0] = 0
if g[0][0] == '#':
    dist[0][0] = 1
while len(queue) > 0:
    next_queue = []
    for r,c in queue:
        for i in range(4):
            cos = dist[r][c]
            nr = r + d[i]
            nc = c + d[1^i]
            if not isvalid(nr,nc):
                continue
            if  g[r][c] != g[nr][nc]:
                cos += 1
            if cos < dist[nr][nc]:
                dist[nr][nc] = cos
                next_queue.append((nr,nc))
    queue = next_queue
print((dist[h-1][w-1] + 1)//2)

Fixed submission:

h,w = map(int,input().split())

def isvalid(r,c):
    return 0 <= r < h and 0 <= c < w

g = [input() for _ in range(h)]
d = [1,0]
queue = [(0,0)]
dist = [[1000000]* w for _ in range(h)]
dist[0][0] = 0
if g[0][0] == '#':
    dist[0][0] = 1
while len(queue) > 0:
    next_queue = []
    for r,c in queue:
        for i in range(2):
            cos = dist[r][c]
            nr = r + d[i]
            nc = c + d[1^i]
            if not isvalid(nr,nc):
                continue
            if  g[r][c] != g[nr][nc]:
                cos += 1
            if cos < dist[nr][nc]:
                dist[nr][nc] = cos
                next_queue.append((nr,nc))
    queue = next_queue
print((dist[h-1][w-1] + 1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
H,W,M = map(int, input().split())
width = [0]*W
height = [0]*H

st = set()
for i in range(M):
  y, x = map(int, input().split())
  st.add((x - 1,y - 1))
  width[x-1] += 1
  height[y-1] += 1

indexW = [i for i, v in enumerate(width) if v == max(width)]
indexH = [i for i, v in enumerate(height) if v == max(height)]

maxW = max(width)
maxH = max(height)

ans = maxW + maxH 

#それぞれ列と行の最大値の中から適当に１つずつ列と行を選ぶ
tmpX = indexW[0]
tmpY = indexH[0]

#HeightとWidthのそれぞれの最大値の点(x, y)に爆弾がない場合があるかどうか
flag = 0

#print(f"maxW : {maxW}")
#print(f"maxH : {maxH}")
#print(f"set : {st}")
#print(f"indexH {indexH}")
#print(f"indexW {indexW}")

#Heightの最大値と、widthのそれぞれを全探索
for x in indexW:
  y = tmpY
  if not (x, y) in st:
    flag = 1
    break


for y in indexH:
  x = tmpX
  if not (x, y) in st:
    flag = 1
    break

if flag == 1:
  print(ans)
else:
  print(ans - 1);


Fixed submission:
H,W,M = map(int, input().split())
width = [0]*W
height = [0]*H

st = set()
for i in range(M):
  y, x = map(int, input().split())
  st.add((x - 1,y - 1))
  width[x-1] += 1
  height[y-1] += 1

maxW = max(width)
maxH = max(height)

indexW = [i for i, v in enumerate(width) if v == maxW]
indexH = [i for i, v in enumerate(height) if v == maxH]

ans = maxW + maxH 

#それぞれ列と行の最大値の中から適当に１つずつ列と行を選ぶ
tmpX = indexW[0]
tmpY = indexH[0]

#HeightとWidthのそれぞれの最大値の点(x, y)に爆弾がない場合があるかどうか
flag = 0

#print(f"indexH {indexH}")
#print(f"indexW {indexW}")

#Heightの最大値と、widthのそれぞれを全探索
for x in indexW:
  y = tmpY
  if not (x, y) in st:
    flag = 1
    break


for y in indexH:
  x = tmpX
  if not (x, y) in st:
    flag = 1
    break

if flag == 1:
  print(ans)
else:
  print(ans - 1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
array = list(map(int, input().split()))

ans = 1
for i in range (n):
    if array[i] == 0:
        ans = 0

for i in range (n):
    ans *= array[i]

if ans > 1e18:
    print(-1)
else:
    print(ans)


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

ans = 1
a.sort()
if a[0] == 0:
  ans = 0
for i in range (n):
  ans *= a[i]
  if ans > 1e18:
    ans = -1
    break

print(ans)

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

ans = 1
for i in range (n):
    if array[i] == 0:
        ans = 0

for i in range (n):
    ans *= array[i]

if ans > 1e18:
    print(-1)
else:
    print(ans)


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

ans = 1
a.sort()
if a[0] == 0:
  ans = 0
for i in range (n):
  ans *= a[i]
  if ans > 1e18:
    ans = -1
    break

print(ans)
Buggy python submission (verdict: Runtime Error):
x = int(input())
money = 100
year = 0

while money < x:
    money += money // 100;
    money = math.floor(money)
    year += 1
    
print(year)

Fixed submission:
x = int(input())

ans = 0
money = 100
while money < x:
  money *= 1.01
  money = int(money)
  ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())
ans = b - a + 1

def lcm(x, y):
  return (x * y) // math.gcd(x, y)

a -= 1
ans = ans - (b//c) - (b//d) + (b//(lcm(c,d)))
ans = ans + (a//c) + (a//d) - (a//(lcm(c,d)))
print(ans)

Fixed submission:
from fractions import gcd
a, b, c, d = map(int, input().split())
ans = b - a + 1

def lcm(x, y):
  return (x * y) // gcd(x, y)

a -= 1
ans = ans - (b//c) - (b//d) + (b//(lcm(c,d)))
ans = ans + (a//c) + (a//d) - (a//(lcm(c,d)))
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())
ans = b - a + 1

def lcm(x, y):
  return (x * y) // math.gcd(x, y)

a -= 1
ans = ans - b//c - b//d + b//(lcm(c,d))
ans = ans + a//c + a//d - a//(lcm(c,d))
print(ans)

Fixed submission:
from fractions import gcd
a, b, c, d = map(int, input().split())
ans = b - a + 1

def lcm(x, y):
  return (x * y) // gcd(x, y)

a -= 1
ans = ans - (b//c) - (b//d) + (b//(lcm(c,d)))
ans = ans + (a//c) + (a//d) - (a//(lcm(c,d)))
print(ans)
Buggy python submission (verdict: Runtime Error):
k = int(input())

for (int i = 0; i++; i< k)
	print("ACL")

Fixed submission:
k = int(input())

for i in range(k):
	print("ACL" , end = "")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
i = 0
ans = 0
tmp = 0
while(i < n - 1):
    j = 1
    while(i + j < n):
        tmp += a[i + j]
        j += 1
    ans += (a[i] * tmp) % (10**9 + 7)
    i+=1
    tmp = 0
ans = ans % (10**9 + 7)
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
i = 0
tmp = 0
tmpura = 0
while(i < n):
    tmp += a[i]
    i+=1
tmp=tmp **2
i = 0
while (i < n):
    tmpura += a[i]**2
    i+=1
tmpura=tmpura
ans = ((tmp - tmpura)//2)%(10**9+7)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
i = 0
ans = 0
while(i < n - 1):
    j = 1
    while(i + j < n):
        ans += (a[i] * a[i+j]) % (10**9 + 7)
        j+=1
    i+=1
ans = ans % (10**9 + 7)
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
i = 0
tmp = 0
tmpura = 0
while(i < n):
    tmp += a[i]
    i+=1
tmp=tmp **2
i = 0
while (i < n):
    tmpura += a[i]**2
    i+=1
tmpura=tmpura
ans = ((tmp - tmpura)//2)%(10**9+7)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
i = 0
ans = 0
while(i < n - 1):
    j = 1
    while(i + j < n):
        ans += a[i] * a[i+j]
        j+=1
    i+=1
ans = ans % (10**9 + 7)
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
i = 0
tmp = 0
tmpura = 0
while(i < n):
    tmp += a[i]
    i+=1
tmp=tmp **2
i = 0
while (i < n):
    tmpura += a[i]**2
    i+=1
tmpura=tmpura
ans = ((tmp - tmpura)//2)%(10**9+7)
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n%2=0:
  print(1/2)
else:
  print((n+1)/(2*n))


Fixed submission:
n=int(input())
if n%2==0:
  print(0.5)
else:
  print((n+1)/(2*n))

Buggy python submission (verdict: Runtime Error):
n=int(input())
if n%2=0:
  print(1//2)
else:
  print((n+1)//2)

Fixed submission:
n=int(input())
if n%2==0:
  print(0.5)
else:
  print((n+1)/(2*n))

Buggy python submission (verdict: Runtime Error):
n=int(input())
print((n+1)//2n)

Fixed submission:
n=int(input())
if n%2==0:
  print(0.5)
else:
  print((n+1)/(2*n))
Buggy python submission (verdict: Runtime Error):
s=input()
if s=="Sunny":
  print("Cloudy")
elif s==Cloudy:
  print("Rainy")
else:
  print("Sunny")


Fixed submission:
s=input()
if s=="Sunny":
  print("Cloudy")
elif s=="Cloudy":
  print("Rainy")
else:
  print("Sunny")

Buggy python submission (verdict: Runtime Error):
s=input()
if s==Sunny:
  print("Cloudy")
elif s==Cloudy:
  print("Rainy")
else:
  print("Sunny")

Fixed submission:
s=input()
if s=="Sunny":
  print("Cloudy")
elif s=="Cloudy":
  print("Rainy")
else:
  print("Sunny")
Buggy python submission (verdict: Runtime Error):
s=input()
test=0
i=0
n=len(s)
if n%2==0:
   while  i<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
else:
   while i+1<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
   else:
      if s[i+1]=="L":
         test+=1
if test==0:
   print("Yes")
else:
   print("No")


Fixed submission:
s=input()
test=0
i=0
n=len(s)
if n%2==0:
   while  i<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
else:
   while i+1<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
   else:
      if s[i]=="L":
         test+=1
if test==0:
   print("Yes")
else:
   print("No")

Buggy python submission (verdict: Runtime Error):
s=input()
test=0
i=0
n=len(s)
if n%2==0:
   while  i<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
else:
   while i+1<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
   else:
      if s[i+1]="L":
         test+=1
if test==0:
   print("Yes")
else:
   print("No")


Fixed submission:
s=input()
test=0
i=0
n=len(s)
if n%2==0:
   while  i<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
else:
   while i+1<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
   else:
      if s[i]=="L":
         test+=1
if test==0:
   print("Yes")
else:
   print("No")