Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
s=0
import math
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            s+=math.gcd(math.gcd(a,b),c)
print(s)


Fixed submission:
k=int(input())
s=0
import math
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            s+=math.gcd(math.gcd(a,b),c)
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import math
k=int(input())
s=0
for a,b,c in itertools.product(range(1,k+1), repeat=3):
    g=math.gcd(math.gcd(a,b),c)
    s+=g
print(s)


Fixed submission:
k=int(input())
s=0
import math
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            s+=math.gcd(math.gcd(a,b),c)
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import math
k=int(input())
s=0
for a,b,c in itertools.product(range(1,k+1), repeat=3):
    g=math.gcd(math.gcd(a,b),c)
    s+=g
print(s)


Fixed submission:
k=int(input())
s=0
import math
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            s+=math.gcd(math.gcd(a,b),c)
print(s)

Buggy python submission (verdict: Runtime Error):
import itertools
import math
k=int(input())
s=0
for a,b,c in itertools.combinations_with_replacement(range(1,n+1), 3):
    g=math.gcd(math.gcd(a,b),c)
    s+=g
print(s)

Fixed submission:
k=int(input())
s=0
import math
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            s+=math.gcd(math.gcd(a,b),c)
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
s=0
import math
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            g=math.gcd(math.gcd(a,b),c)
            s+=g
print(s)


Fixed submission:
k=int(input())
s=0
import math
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            s+=math.gcd(math.gcd(a,b),c)
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
s=0
import fractions
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            g=fractions.gcd(fractions.gcd(a,b),c)
            s+=g
print(s)

Fixed submission:
k=int(input())
s=0
import math
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            s+=math.gcd(math.gcd(a,b),c)
print(s)
Buggy python submission (verdict: Runtime Error):
m,n=map(int,input().split())
a=sorted(list(map(int,input().split())))
s=0
for j in range(n):
  s+=a[j]
for i in range(n):
  if a[n-i] < s/(4*m):
    if i!=0:
      a=a[n-i+1:]
      break
    else:
      a=[]
      break
if len(a) >= m:
  print("Yes")
else:
  print("No")

Fixed submission:
n,m=map(int,input().split())
a=sorted(list(map(int,input().split())))[::-1]
print("Yes" if 4*m*a[m-1]>=sum(a) else "No")
Buggy python submission (verdict: Runtime Error):
X,Y,A,B,C=map(int,input().split())
p=sorted(list(map(int,input().split())))
q=sorted(list(map(int,input().split())))
r=sorted(list(map(int,input().split())))
for i in range(min(X,Y)):
  if p[A-X+i] > q[B-Y+i]:
    if r[-1] >= q[B-Y+i]:
      del q[B-Y+i]
      q.insert(B-Y+i,r[-1])
      del r[-1]
      r.insert(0,0)
      if r[-1] > p[A-X+i]:
        del p[A-X+i]
        p.insert(A-X+i,r[-1])
        del r[-1]
        r.insert(0,0)
  else:
    if r[-1] > p[A-X+i]:
      del p[A-X+i]
      p.insert(A-X+i,r[-1])
      del r[-1]
      r.insert(0,0)
      if r[-1] > q[B-Y+i]:
        del q[B-Y+i]
        q.insert(B-Y+i,r[-1])
        del r[-1]
        r.insert(0,0)
if X>Y:
  for j in range(X-Y):
    if p[A-X+Y+j] < r[-1]:
      del p[A-X+Y+j]
      p.insert(A-X+Y+j,r[-1])
      del r[-1]
      r.insert(0,0)
if X<Y:
  for j in range(Y-X):
    if q[B-Y+X+j] < r[-1]:
      del q[B-Y+X+j]
      q.insert(B-Y+X+j,r[-1])
      del r[-1]
      r.insert(0,0)
P=sorted(p)
Q=sorted(q)
sc=0
for k in range(X):
  sc+=P[A-X+k]
for l in range(Y):
  sc+=Q[B-Y+l]
print(sc)


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

Buggy python submission (verdict: Runtime Error):
K,N=map(int,input().split())
A=list(map(int,input().split()))
List=[]
for i in range(N):
  b=abs(A[i]-A[i-1])
  List.append(b)
SL=sorted(List)
print(K-SL[-1])

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

Buggy python submission (verdict: Runtime Error):
K,N=map(int,input().split())
A=list(map(int,input().split()))
d=0
for i in range(N-1):
  if d == 0 and A[i+1]-A[0] >= K/2:
    d=d+A[i]-A[0]+K-A[i+1]
if d == 0:
  d=d+A[N-1]-A[N-2]
print(d)

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

Buggy python submission (verdict: Runtime Error):
K,N=map(int,input().split())
A=list(map(int,input().split()))
d=0
for i in range(N-1):
  b=A[i+1]-A[i]
  if d == 0 and A[i+1]-A[0] >= K/2:
    d=d+A[i]-A[0]+K-A[i+1]
if d == 0:
  d=d+A[N-1]
print(d)

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

Buggy python submission (verdict: Runtime Error):
K,N=map(int,input().split())
A=list(map(int,input().split()))
d=0
for i in range(N-1):
  b=A[i+1]-A[i]
  if A[i+1]-A[0] >= K/2:
    d=d+A[i]-A[0]+K-A[i+1]
print(d)
  

Fixed submission:
S=input()
if S[2] == S[3] and S[4] == S[5]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N=int(input())
M=int(input())
print(N*(N-1)/2+M*(M-1)/2)

Fixed submission:
N,M=map(int,input().split())
print(int(N*(N-1)/2+M*(M-1)/2))
Buggy python submission (verdict: Runtime Error):
S=input()
N=len(S)
S1=S[:((N+1)/2)]
S2=S[((N+3)/2):]
if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1]:
  print("Yes")
else:
  print("No")

Fixed submission:
S=input()
N=len(S)
S1=S[:int((N-1)/2)]
S2=S[int((N+1)/2):]
if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1]:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S=input()
N=len(S)
S1=S[:(N+1)/2]
S2=S[(N+3)/2:]
if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1]:
  print("Yes")
else:
  print("No")

Fixed submission:
S=input()
N=len(S)
S1=S[:int((N-1)/2)]
S2=S[int((N+1)/2):]
if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
List=""
while len(List) < N:
    List=+="b"*A+"r"*B
if len(List) >= N:
  ans=List[:N]
  print(ans.count("b"))


Fixed submission:
S=input()
if S == "AAA" or S == "BBB":
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
List=""
while len(List) < N:
    List+="b"*A+"r"*B
if len(List) >= N:
  ans=List[:N]
  print(ans.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):
N,A,B=map(int,input().split())
List=""
while len(List) < N:
    List=List+"b"*A
    List=List+"r"*B
if len(List) >= N:
  ans=List[:N]
  print(ans.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):
N,A,B=map(int,input().split())
List=""
while len(List) < N:
    List=List+"b"*A
  for j in range(B):
    List=List+"r"*B
if len(List) >= N:
  ans=List[:N]
  print(ans.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):
a,b=map(int,input().split())
na=int(a*12.5)
nb=b*10
x=0
for i in range(8):
  nai=na+i
  for j in range(10):
    nbj=nb+j
    if nai == nbj:
      x=1
      y=nai
      break
  if x==1:
    print(y)
    break:
  if x==0 and i==7:
    print("-1")

Fixed submission:
a,b=map(int,input().split())
x=0
for i in range(2000):
  if x == 0 and int(i*0.08) == a and int(i*0.10) == b:
    print(i)
    x=1
  if x == 0 and i == 1299:
    print("-1")
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations as com

n=int(input())
L=list(map(int,input().split()))
ans=0
for i,j,k in com(L,3):
    if i+j>k and j+k>i and k+i>j:
        ans+=1
print(ans)

Fixed submission:
import bisect
n=int(input())
L=sorted(list(map(int,input().split())))
ans=0
for i in range(n-1):
    for j in range(i+1,n):
        ans+=bisect.bisect_left(L,L[i]+L[j])-(j+1)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations as com
def tri(a,b,c):
  if a+b>c and b+c>a and c+a>b:
    return 1
  else:
    return 0
n=int(input())
L=list(map(int,input().split()))
ans=0
for i,j,k in com(L,3):
    ans+=tri(i,j,k)
print(ans)
        

Fixed submission:
import bisect
n=int(input())
L=sorted(list(map(int,input().split())))
ans=0
for i in range(n-1):
    for j in range(i+1,n):
        ans+=bisect.bisect_left(L,L[i]+L[j])-(j+1)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ara = [input() for _ in range(n)]
pref = []
suff = []

for s in ara:
	pos = neg = 0
	for ch in s:
		if ch == '(':
			pos += 1
		elif pos == 0:
			neg += 1
		else:
			pos -= 1
	if pos >= neg:
		pref.append([pos, neg])
	else:
		suff.append([pos, neg])


pref.sort(key=lambda x: x[1])
suff.sort(key=lambda x: x[0], reverse=True)

totPos = 0

ara = pref + suff

for pos, neg in ara:
	if neg > totPos:
		print("No")
		exit(0)
	totPos -= neg
	totPos += pos


if totPos != 0:
	print("No")
else:
	print("Yes")


Fixed submission:
s = input()
t = input()
if t.startswith(s):
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 0
big = pow(10,9) + 7
for i in range(n-1):
  for j in range(i+1,n):
    ans += a[i] * a[j]
    ans %= big
    
print(ans)

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

big = pow(10,9) + 7
sums = pow(sum(a),2)
a_2 = list(map(lambda x: x ** 2, a))

print(((sums-sum(a_2)) // 2)%big)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
a = list(map(int, input().split()))

after = 1
for i in range(k):
  after *= a[i]

ans_list = [after]
for i in range(n-k):
  ans_list.append(ans_list[i] / a[i] * a[k+i])

for i in range(n-k):
  if ans_list[i] < ans_list[i+1]:
    print("Yes")
  else:
    print("No")

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

for i in range(n-k):
  if a[i] < a[i+k]:
    print("Yes")
  else:
    print("No")

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

first = 1
for i in range(k):
  first *= a[i]

tmp_index = 0
for i in range(n-k):
  before = first
  after = first / a[tmp_index] * a[k+i]
  if before < after:
    print("Yes")
  else:
    print("No")
  first = after
  tmp_index += 1

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

for i in range(n-k):
  if a[i] < a[i+k]:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a_list = sorted(map(int, input().split()),reverse=True)

if n <= 2:
  a_list.pop(-1)
  print(sum(a_list))
else:
  ans = 0
  ans += a_list.pop(0)
  cnt = 2
  while 1:
    if cnt == n:
      break
    if n - cnt >= 2:
      ans += a_list.pop(0) * 2
      cnt += 2
    else:
      ans += a_list.pop(0) * 1
      cnt += 1
      
print(ans)

Fixed submission:
n = int(input())
a_list = sorted(map(int, input().split()),reverse=True)

ans = 0
ans += a_list.pop(0)
cnt = 2
times_2 = 0
times_1 = 0
while 1:
  if cnt == n:
    break
  if n - cnt >= 2:
    cnt += 2
    times_2 += 1
  else:
    cnt += 1
    times_1 += 1
      
ind = 0
for i in range(times_2):
  ans += 2 * a_list[i]
  ind += 1
  
for i in range(times_1):
  ans += a_list[ind + i]

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

a, b=[0], [0]
for i in range(N):
  a.append(a[i]+A[i])
  for i in range(M):
    b.append(b[i]+B[i])
    
ans, j=0, M
for i in range(N+1):
  if a[i]>K:
    break
  while b[j]>K-a[i]:
    j-=1
  ans=max(ans, i+j)
  
print(ans)

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

a, b=[0], [0]
for i in range(N):
  a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])
    
ans, j=0, M
for i in range(N+1):
  if a[i]>K:
    break
  while b[j]>K-a[i]:
    j-=1
  ans=max(ans, i+j)
  
print(ans)

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

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

# まずaを全部読む
# 全部読めたならbも読む
# 最後の本を捨てて、それがなければどこまでいけるかを試す

ans = 0
cost = 0
b_i = 0
while cost <= k:
  ans += 1
  if ans >= n:
    cost += b[n-ans]
    b_i += 1
  else:
    cost += a[ans]

max_ans = ans
if b_i == 0:
  for i in range(ans-1,-1,-1):
    ans -= 1
    cost -= a[i]
    while cost <= k and b_i < m:
      ans += 1
      cost += b[b_i]
      b_i += 1
    max_ans = max(max_ans, ans)
else:
  for i in range(n-1,-1,-1):
    ans -= 1
    cost -= a[i]
    while cost <= k and b_i < m:
      ans += 1
      cost += b[b_i]
      b_i += 1
    max_ans = max(max_ans, ans)
    
if not (a[0] >= k and b[0] >= k):
  print(max_ans)
else:
  print(0)

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

a, b=[0], [0]
for i in range(N):
  a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])
    
ans, j=0, M
for i in range(N+1):
  if a[i]>K:
    break
  while b[j]>K-a[i]:
    j-=1
  ans=max(ans, i+j)
  
print(ans)

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

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

# まずaを全部読む
# 全部読めたならbも読む
# 最後の本を捨てて、それがなければどこまでいけるかを試す

ans = 0
cost = 0
b_i = 0
while cost <= k:
  ans += 1
  if ans >= n:
    cost += b[n-ans]
    b_i += 1
  else:
    cost += a[ans]

max_ans = ans
if b_i == 0:
  for i in range(ans-1,-1,-1):
    ans -= 1
    cost -= a[i]
    while cost <= k and b_i < m:
      ans += 1
      cost += b[b_i]
      b_i += 1
    max_ans = max(max_ans, ans)
else:
  for i in range(n-1,-1,-1):
    ans -= 1
    cost -= a[i]
    while cost <= k and b_i < m:
      ans += 1
      cost += b[b_i]
      b_i += 1
    max_ans = max(max_ans, ans)
    
if not a[0] >= k and b[0] >= k:
  print(max_ans)
else:
  print(0)

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

a, b=[0], [0]
for i in range(N):
  a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])
    
ans, j=0, M
for i in range(N+1):
  if a[i]>K:
    break
  while b[j]>K-a[i]:
    j-=1
  ans=max(ans, i+j)
  
print(ans)
Buggy python submission (verdict: Runtime Error):
x,n = input().split()
x = int(x)
if int(n) != 0:
  p = list(map(int, input().split()))
else:
  p = []

all_list = [i for i in range(1,101)]
p = reversed(sorted(p))

for i in p:
  all_list.pop(i-1)
  
if x in all_list:
  ans = x
else:
  abs_ = 100
  for i in all_list:
    if abs(x - i) < abs_:
      abs_ = abs(x - i)
      ans = i

print(ans)

Fixed submission:
x,n = input().split()
x = int(x)
if int(n) != 0:
  p = list(map(int, input().split()))
else:
  p = []

all_list = [i for i in range(1,101)]
p = reversed(sorted(p))

for i in p:
  all_list.pop(i-1)
  
all_list.insert(0,0)
all_list.insert(0,-1)
all_list.append(101)

if x in all_list:
  ans = x
else:
  abs_ = 1000
  for i in all_list:
    if abs(x - i) < abs_:
      abs_ = abs(x - i)
      ans = i

print(ans)

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

all_list = [i for i in range(1,101)]
p = reversed(sorted(p))

for i in p:
  all_list.pop(i-1)
  
if x in all_list:
  ans = x
else:
  abs_ = 100
  for i in all_list:
    if abs(x - i) < abs_:
      abs_ = abs(x - i)
      ans = i

print(ans)

Fixed submission:
x,n = input().split()
x = int(x)
if int(n) != 0:
  p = list(map(int, input().split()))
else:
  p = []

all_list = [i for i in range(1,101)]
p = reversed(sorted(p))

for i in p:
  all_list.pop(i-1)
  
all_list.insert(0,0)
all_list.insert(0,-1)
all_list.append(101)

if x in all_list:
  ans = x
else:
  abs_ = 1000
  for i in all_list:
    if abs(x - i) < abs_:
      abs_ = abs(x - i)
      ans = i

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

ans = 1
for i in a_list:
              ans *= i
              
if ans > pow(10,18):
              print(-1)
else:
              print(ans)

Fixed submission:
n = int(input())
a_list = list(map(int, input().split()))
ans = 1
for i in a_list:
  ans *= i
  if ans > 1000000000000000000:
    break

if ans > 1000000000000000000 and 0 not in a_list:
              print("-1")
elif 0 in a_list:
              print(0)
else:
              print(ans)
Buggy python submission (verdict: Runtime Error):
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

n = int(input())

ans = []
used_list = []

def solve(n, used_list):
  if n == 1:
    return len(used_list)
  div_list = sympy.divisors(n)[1:]
  for i in div_list:
    z_kouho = factorization(i)
    if i not in used_list and len(z_kouho) == 1:
      used_list.append(i)
      return solve(int(n/i),used_list)
  
  return len(used_list)
      
print(solve(n, used_list))

Fixed submission:
def make_divisors(n):
    lower_divisors = []
    upper_divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)

    upper_divisors.reverse()
    return lower_divisors + upper_divisors

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

n = int(input())

ans = []
used_list = []

def solve(n, used_list):
  if n == 1:
    return len(used_list)
  div_list = make_divisors(n)[1:]
  for i in div_list:
    z_kouho = factorization(i)
    if i not in used_list and len(z_kouho) == 1:
      used_list.append(i)
      return solve(int(n/i),used_list)
  
  return len(used_list)
      
print(solve(n, used_list))
Buggy python submission (verdict: Runtime Error):
X = int(input())

_range = int(pow(X,1/5))
for i in range(-1*_range-1,_range+2):
  for j in range(-1*_range-1,_range+2):
    if pow(i,5) - pow(j,5) == X:
      ans_a = i
      ans_b = j
      break
      
print(ans_a,ans_b)

Fixed submission:
X = int(input())

_range = int(pow(X,1/5))
for i in range(-2*_range-1,2*_range+2):
  for j in range(-2*_range-1,2*_range+2):
    if pow(i,5) - pow(j,5) == X:
      ans_a = i
      ans_b = j
      break
      
print(ans_a,ans_b)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A_list = list(map(int,input().split()))

for i in range(1,N+1):
  print(A_list.count(i))

Fixed submission:
import collections

N = int(input())

A_list = list(map(int,input().split()))
c = collections.Counter(A_list)

for i in range(1,N+1):
  print(c[i])
Buggy python submission (verdict: Runtime Error):
N = int(input())

_sum = N * (1+N)/2

if N >= 3:
  _min = 3
  _max = 3 * (N // 3)
  num = (_max - _min) / 3 + 1
_sum -= num*(_min+_max)/2

if N >= 5:
  _min = 5
  _max = 5 * (N // 5)
  num = (_max - _min) / 5 + 1
_sum -= num*(_min+_max)/2

if N >= 15:
  _min = 15
  _max = 15 * (N // 15)
  num = (_max - _min) / 15 + 1
  _sum += num*(_min+_max)/2

print(int(_sum))

Fixed submission:
N = int(input())

_sum = N * (1+N)/2

if N >= 3:
  _min = 3
  _max = 3 * (N // 3)
  num = (_max - _min) / 3 + 1
  _sum -= num*(_min+_max)/2

if N >= 5:
  _min = 5
  _max = 5 * (N // 5)
  num = (_max - _min) / 5 + 1
  _sum -= num*(_min+_max)/2

if N >= 15:
  _min = 15
  _max = 15 * (N // 15)
  num = (_max - _min) / 15 + 1
  _sum += num*(_min+_max)/2

print(int(_sum))
Buggy python submission (verdict: Runtime Error):
hoge = input().split()
N = int(hoge[0])
M = int(hoge[1])

if N == 1 and m == 1:
  print(0)
else:
  n = 0
  if N != 0:
    for i in range(N-1):
      n += 1+i
  else:
    n = 0
  if M != 0:
    m = (M * (M-1)) / 2
  else:
    m = 0
  print(int(n + m))

Fixed submission:
hoge = input().split()
N = int(hoge[0])
M = int(hoge[1])

if N == 1 and M == 1:
  print(0)
else:
  n = 0
  if N != 0:
    for i in range(N-1):
      n += 1+i
  else:
    n = 0
  if M != 0:
    m = (M * (M-1)) / 2
  else:
    m = 0
  print(int(n + m))

Buggy python submission (verdict: Runtime Error):
hoge = input().split()
N = int(hoge[0])
M = int(hoge[1])

if N == 1 and m == 1:
  print(0)
else:
  n = 0
  for i in range(N-1):
    n += 1+i
  m = (M * (M-1)) / 2
  print(int(n + m))

Fixed submission:
hoge = input().split()
N = int(hoge[0])
M = int(hoge[1])

if N == 1 and M == 1:
  print(0)
else:
  n = 0
  if N != 0:
    for i in range(N-1):
      n += 1+i
  else:
    n = 0
  if M != 0:
    m = (M * (M-1)) / 2
  else:
    m = 0
  print(int(n + m))

Buggy python submission (verdict: Runtime Error):
hoge = input().split()
N = int(hoge[0])
M = int(hoge[1])

if N == 1 and m == 1:
  print(0)
else:
  n = 0
  for i in range(N-1):
    n += 1+i
  m = (M * (M-1)) / 2
  print(int(n + m))

Fixed submission:
hoge = input().split()
N = int(hoge[0])
M = int(hoge[1])

if N == 1 and M == 1:
  print(0)
else:
  n = 0
  if N != 0:
    for i in range(N-1):
      n += 1+i
  else:
    n = 0
  if M != 0:
    m = (M * (M-1)) / 2
  else:
    m = 0
  print(int(n + m))
Buggy python submission (verdict: Runtime Error):
hoge = input().split()
N = int(hoge[0])
M = int(hoge[1])

s_list = []
c_list = []

for i in range(M):
  hoge = input().split()
  s_list.append(int(hoge[0]))
  c_list.append(int(hoge[1]))
num = [10] * M

for i in range(len(s_list)):
  if s_list[i] == 1 and c_list[i] == 0:
    num[s_list[i]-1] = 100
  elif num[s_list[i]-1] == 10:
    num[s_list[i]-1] = c_list[i]
  elif num[s_list[i]-1] != c_list[i]:
    num[s_list[i]-1] = 100

if 100 in num:
  print(-1)
elif 10 in num:
  for i in range(len(num)):
    if num[i] == 10:
      num[i] = 0
  for i in range(len(num)):
    print(num[i], sep="", end="")
else:
  for i in range(len(num)):
    print(num[i], sep="", end="")

Fixed submission:
hoge = input().split()
N = int(hoge[0])
M = int(hoge[1])

s_list = []
c_list = []

for i in range(M):
  hoge = input().split()
  s_list.append(int(hoge[0]))
  c_list.append(int(hoge[1]))
num = [10] * N

for i in range(len(s_list)):
  if s_list[i] == 1 and c_list[i] == 0 and N!= 1:
    num[s_list[i]-1] = 100
  elif num[s_list[i]-1] == 10:
    num[s_list[i]-1] = c_list[i]
  elif num[s_list[i]-1] != c_list[i]:
    num[s_list[i]-1] = 100
    
if 100 in num:
  print(-1)
elif N == 1 and M == 0:
  print(0)
elif 10 in num:
  for i in range(len(num)):
    if num[i] == 10 and i == 0:
      num[i] = 1
    if num[i] == 10 and i != 0:
      num[i] = 0
  for i in range(len(num)):
    print(num[i], sep="", end="")
else:
  for i in range(len(num)):
    print(num[i], sep="", end="")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A_list = []

for i in range(N):
  A_list.append(int(input()))
  
len_org = len(A_list)
len_uniq = len(list(set(A_list)))

if len_org == len_uniq:
  print("YES")
else:
  print("NO")

Fixed submission:
N = int(input())
A_list = []

hoge = input().split()

for i in range(N):
  A_list.append(int(hoge[i]))
  
len_org = len(A_list)
len_uniq = len(list(set(A_list)))

if len_org == len_uniq:
  print("YES")
else:
  print("NO")