qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n = int(input())
a = list(map(int, input().split()))

ans = []

i = 1
adjacent = 1

while i < n:
  if a[i] == a[i - 1]:
    adjacent += 1
  else:
    ans.append((adjacent + 1) // 2)
    adjacent = 1
  i += 1
  
ans.append((adjacent + 1) // 2)
print(sum(ans))

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

ans = []

i = 1
adjacent = 1

while i < n:
  if a[i] == a[i - 1]:
    adjacent += 1
  else:
    ans.append(adjacent // 2)
    adjacent = 1
  i += 1
  
ans.append(adjacent // 2)
print(sum(ans))
Buggy code:
# n = int(input())
# colors = list(map(int, input().split()))
n = 14
colors = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 1, 2, 3, 4]
ans = []
i = 0
cnt = 0
while True:
    if i == n-1:
        cnt += 1
        ans.append(cnt)
        break
    if colors[i] != colors[i+1]:
        cnt += 1
        ans.append(cnt)
        cnt = 0
    else:
        cnt += 1
    i += 1


ans = list(map(lambda x: x //2, ans))
print(sum(ans))


Fixed code:
n = int(input())
colors = list(map(int, input().split()))
# n = 14
# colors = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 1, 2, 3, 4]
ans = []
i = 0
cnt = 0
while True:
    if i == n-1:
        cnt += 1
        ans.append(cnt)
        break
    if colors[i] != colors[i+1]:
        cnt += 1
        ans.append(cnt)
        cnt = 0
    else:
        cnt += 1
    i += 1


ans = list(map(lambda x: x //2, ans))
print(sum(ans))
Buggy code:
N = int(input())
l = list(map(int,input().split(" ")))
num_n =[]
i=1
for j in range(N-1):
    if l[j] == l[j+1]:
        i+=1
    else:
        num_n.append(int(i/2))
        i=1
print(sum(num_n))

Fixed code:
N = int(input())
l = list(map(int,input().split(" ")))
num_n =[]
i=1
for j in range(N-1):
    if l[j] == l[j+1]:
        i+=1
    else:
        num_n.append(int(i/2))
        i=1
num_n.append(int((i+0.1)/2))
print(sum(num_n))
Buggy code:
N = int(input())
lis = list(map(int,input().split()))
l = []
i = 0
x = 0
while(True):
  if i == N-1:
    x += 1
    l.append(x)
    break
  if lis[i] != lis[i+1]:
    x += 1
    l.append(x)
    x = 0
  else:
    x += 1
s = 0
for i in lis:
  s += (i//1)
print(s)

Fixed code:
N = int(input())
lis = list(map(int,input().split()))
l = []
i = 0
x = 0
while(True):
  if i == N-1:
    x += 1
    l.append(x)
    break
  if lis[i] != lis[i+1]:
    x += 1
    l.append(x)
    x = 0
  else:
    x += 1
  i += 1
s = 0
for i in l:
  s += (i//2)
print(s)
Buggy code:
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(1,n-1):
    if a[i]==a[i-1]:
        a[i]=10000%(a[i]+a[i+1])-1
        ans+=1
print(ans)

Fixed code:
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(1, n):
	if a[i] == a[i-1]:
		ans+=1
		a[i] = 10000
print(ans)
Buggy code:
n=int(input())
a=list(map(int,input().split()))
a.append(0)
tl=0
count=0
for i in range(n):
    if a[i+1]==a[i]:
        tl+=1
    elif tl!=0:
        count+=tl//2
        tl=0
print(count)

Fixed code:
n=int(input())
a=list(map(int,input().split()))
a.append(0)
tl=1
count=0
for i in range(n):
    if a[i]==a[i+1]:
        tl+=1
    else:
        count+=tl//2
        tl=1
print(count)
Buggy code:
from sys import stdin


def get(l, r):
    for i in range(1, 10001):
        if i != l and i != r:
            return i
    assert False, 'damepo'


def main():
    N = int(stdin.readline().rstrip())
    a = [int(x) for x in stdin.readline().rstrip().split()]
    count = 0
    for i, x in enumerate(a[1:-1]):
        idx = i + 1
        l = a[idx - 1]
        r = a[idx + 1]
        if (l == x and x != r) or (l == x == r) or ((idx == len(a) - 2) and x == r):
            x = get(l, r)
            count += 1
            a[idx] = x
    print(a)
    print(count)


if __name__ == '__main__':
    main()


Fixed code:
from sys import stdin


def get(l, r):
    for i in range(1, 10001):
        if i != l and i != r:
            return i
    assert False, 'damepo'


def main():
    N = int(stdin.readline().rstrip())
    a = [int(x) for x in stdin.readline().rstrip().split()]

    count = 0
    if N == 2:
        if a[0] == a[1]:
            count += 1
    else:
        for i, x in enumerate(a[1:-1]):
            idx = i + 1
            l = a[idx - 1]
            r = a[idx + 1]
            if (l == x and x != r) or (l == x == r) or ((idx == len(a) - 2) and x == r):
                x = get(l, r)
                count += 1
                a[idx] = x
        # print(a)
    print(count)


if __name__ == '__main__':
    main()
Buggy code:
N=int(input())
A=list(map(int,input().split()))
count = 0
for i in range(N-1):
  if A[i]=A[i+1]:
    A[i+1]=0
    count +=1
print(count)

Fixed code:
N = int(input())
A = list(map(int,input().split()))
answer = 0
for i in range(1,N) :
    if A[i] - A[i-1] == 0 :
        answer += 1
        A[i] = -1
print(answer)
Buggy code:
n = int(input())
a = list(map(int,input().split()))
cnt = 1
ans = 0
for i in range(1,n):
    if a[i]==a[i-1]:
        cnt+=1
    else:
        ans+=cnt//2
        cnt=1
print(ans)

Fixed code:
n = int(input())
a = [i for i in map(int , input().split())]
cnt = [1 for i in range(n)]
j = 0

for i in range(1,n) :
    if a[i] == a[i-1] :
        cnt[j] += 1
    else :
        j += 1


ans = 0
for i in range(j+1) :
    if cnt[i] != 1 :
        ans += cnt[i] // 2

print(ans)
Buggy code:
N = int(input())
L = list(map(int, input().split()))
d = [(L[i+1]-L[i]) for i in range(len(L)-1)]
b = False
c = 0
ans = 0
for i in d:
    if i==0:
        b = True
    else :
        b = False
    if b:
        c += 1
    else :
        ans += (-(-c//2))
        c = 0
print(ans)

Fixed code:
N = int(input())
L = list(map(int, input().split()))
d = [(L[i+1]-L[i]) for i in range(len(L)-1)]
b = False
c = 0
ans = 0
for i in d:
    if i==0:
        b = True
    else :
        b = False
    if b:
        c += 1
    else :
        ans += (-(-c//2))
        c = 0
if b:
    ans += (-(-c//2))
print(ans)
Buggy code:
# s = input()
n = int(input())

a = list(map(int,input().split()))
a.append(10**10)
counter = 1
ans = 0
for i in range(n):
    if a[i] == a[i+1]:
        counter += 1
    else:
        if counter %2 == 0 and counter != 1 :
            ans += counter/2
        elif counte %2 != 0 and counter != 1:
            ans += int(counter/2)
        counter = 1
print(int(ans))

Fixed code:
n = int(input())
a = list(map(int,input().split()))
a.append(10**10)
counter = 1
ans = 0
for i in range(n):
    if a[i] == a[i+1]:
        counter += 1
    else:
        if counter %2 == 0 and counter != 1 :
            ans += counter/2
        elif counter %2 != 0 and counter != 1:
            ans += int(counter/2)
        counter = 1
print(int(ans))
Buggy code:
N = input()
data = input().split()
bef = -1
count = 0
result = 0
for i in data:
	if bef != data[i]:
		if count > 1:
			result += int(count) / 2
		count = 1
		bef = data[i]
	else:
		count++
print(result)

Fixed code:
N = input()
data = input().split()
bef = -1
count = 0
result = 0

for i in range(len(data)):
	t = int(data[i])
	if bef != t:
		if count > 1:
			result += int(count / 2)
		count = 1
		bef = t
	else:
		count += 1

if count > 1:
	result += int(count / 2)
print(result)
Buggy code:
N  = int(input())
a = [int(i) for i in input().split()]
a.append(N+1)
dupe = []

temp = 1
for i in range(N):
    if a[i] == a[i+1]:
        temp += 1
    elif temp != 0:
        dupe.append(temp)
        temp = 1

print(dupe)
b = [int(i/2) for i in dupe]
print(sum(b))

Fixed code:
N  = int(input())
a = [int(i) for i in input().split()]
a.append(N+1)
dupe = []

temp = 1
for i in range(N):
    if a[i] == a[i+1]:
        temp += 1
    elif temp != 0:
        dupe.append(temp)
        temp = 1

b = [int(i/2) for i in dupe]
print(sum(b))
Buggy code:
n=int(input());a=list(map(int,input().split()));c,ans=1,0
for i in range(n-1)
  if a[i]==a[i+1]:c+=1
  else:
    if c>=2:ans+=c//2
    c=1
print(ans)

Fixed code:
n=int(input())
a=list(map(int,input().split()))
c=1
ans=0
for i in range(1,n):
    #print(c)
    if a[i]==a[i-1]:
        c+=1
        if i==n-1:
            ans+=c//2
    else:
        ans+=c//2
        c=1
print(ans)
Buggy code:
n=int(input())
a=list(map(int,input().split()))
ans=0
cnt=1
for i in range(n):
    if a[i]==a[i+1]:
        cnt+=1
    else:
        ans+=cnt/2
        cnt=1
print(cnt)


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

k=0
t=0
ans=0
for i in range(n):
	if a[i]==k:
		t+=1
	else:
		ans+=t//2
		k=a[i]
		t=1
ans+=t//2
print(ans)
Buggy code:
N = int(input())
a = list(map(int, input().split()))
a = [0] + a + [0]
count = 0
for i in range(1, N+1):
	if a[i] == a[i-1]:
		count += 1
		a[i] = 2

print(count)

Fixed code:
N = int(input())
a = list(map(int,input().split()))
count = 0

for i in range(N-1):
    if a[i] == a[i+1]:
        a[i+1] = -1
        count += 1

print(count)
Buggy code:
n=int(input())
a=list(map(int,input().split()))
cnt=0
for i in range(1,len(a)):
  if a[i-1]=a[i]:
    cnt+=1
print(cnt)

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

cnt = 0
for i in range(1,n):
    if a[i-1] == a[i]:
        a[i] = -1
        cnt += 1
print(cnt)
Buggy code:
N=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(N-1):
    if a[i]==a[i+1]:
        ans+=1
print(ans)

Fixed code:
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(1, n):
  if a[i]==a[i-1]:
    a[i]=-1
    ans += 1
print(ans)
Buggy code:
N = int(input())
a = list(map(int,input().split()))
ans = 0
now = a[0]
i = 1
while i < N:
    if now == a[i]:
        ans += 1
        i += 2
        if i == N-1:
            break
        now = a[i+1]
    else:
        now = a[i]
        i += 1
print(ans)


Fixed code:
N = int(input())
a = list(map(int,input().split()))
i = 1
ans = 0
while i < N:
    if a[i] == a[i-1]:
        ans += 1
        i += 2
    else:
        i += 1
print(ans)
Buggy code:
print(input()[::int(input())]

Fixed code:
print(input()[::int(input())])
Buggy code:
S = input()
w = int(input())
for i in range(len(S)):
  if w != 1 and (i + 1) % w == 1 :
    print(S[i], end = "")
  elif w == 1:
    print(S[i])


Fixed code:
S = input()
w = int(input())
for i in range(len(S)):
  if w != 1 and (i + 1) % w == 1 :
    print(S[i], end = "")
  elif w == 1:
    print(S[i], end = "")
Buggy code:
S=input()
w=int(input())
n=len(S)
T=""
for i in range (0,n+1,w):
  T+=S[i]
print(T)

Fixed code:
S=input()
w=int(input())
n=len(S)
T=""
for i in range (0,n,w):
  T+=S[i]
print(T)
Buggy code:
S = str(input())
w = int(input())
idx = w
ans = ""
while idx <= len(S):
  ans += S[idx]
  idx += w
print(ans)

Fixed code:
S = str(input())
w = int(input())
idx = 0
ans = ""
while idx < len(S):
  ans += S[idx]
  idx += w
print(ans)
Buggy code:
S = input()
W = int(input())
res = ''
for i in range((len(S) + W - 1) // W):
    res = ''.join((res, S[3 * i]))
print(res)

Fixed code:
S = input()
W = int(input())
res = ''
for i in range((len(S) + W - 1) // W):
    res = ''.join((res, S[W * i]))
print(res)
Buggy code:
s = input()
n = int(input())
print(s[0::3])

Fixed code:
s = input()
n = int(input())
print(s[0::n])
Buggy code:
L = list(input())
w = int(input())
i = 0
while i<=len(L):
  print(L[i],end="")
  i+=3

Fixed code:
L = list(input())
w = int(input())
i = 0
while i<len(L):
  print(L[i],end="")
  i+=w
Buggy code:
s = input()
w = int(input())
ans = ""
for i in range(len(s) // w):
    ans = ans + s[i * w]

print(ans)

Fixed code:
s=input()
w=int(input())
n=-(-len(s)//w)
ans=""
for i in range(n):
  ans=ans+s[w*i]
print(ans)
Buggy code:
s = list(input())
w = int(input())
index = 0
l = []
while index <= len(s) - 1:
  print(index)
  l.append(s[index])
  index += w
print(*l, sep="")

Fixed code:
s = list(input())
w = int(input())
index = 0
l = []
while index <= len(s) - 1:
  l.append(s[index])
  index += w
print(*l, sep="")
Buggy code:
S = input()
w = int(input())
s = ''
if w == 1:
  print(S)
else:
  for i in range((len(S) // w) + 1):
    s += S[i * w]
print(s)


Fixed code:
S = input()
w = int(input())
s = ''
if w == 1:
  print(S)
else:
  if len(S) % w == 0:
    for i in range(len(S) // w):
      s += S[i * w]
    print(s)
  else:
    for i in range((len(S) // w) + 1):
      s += S[i * w]
    print(s)
Buggy code:
s=str(input())
y="".join([s[i] for i in range(0,len(s),w)])
print(y)

Fixed code:
s,w=str(input()),int(input())
y="".join([s[i] for i in range(0,len(s),w)])
print(y)
Buggy code:
s=list(input())
w=int(input())
x=[]
y=''
ans=''
count=[]
for i in range(len(s)):
    y+=s[i]
    if len(list(y))==w:
        x.append(y)
        y=''
    if i==len(s)-1:
        x.append(y)
for j in range(len(x)-1):
    count=list(x[j])
    ans+=count[0]
print(ans)


Fixed code:
s=list(input())
w=int(input())
x=[]
y=''
ans=''
count=[]
for i in range(len(s)):
    y+=s[i]
    if len(list(y))==w:
        x.append(y)
        y=''
    if i==len(s)-1 and y!='':
        x.append(y)
for j in range(len(x)):
    count=list(x[j])
    ans+=count[0]
print(ans)
Buggy code:
s = input()
w = int(input())
ans = ""
for i in range(len(s)//w+1):
    ans = ans + s[i*w]
print(ans)

Fixed code:
s = input()
w = int(input())
ans = ""
for i in range((len(s) // w) + 1):
    if i * w < len(s):
        ans += s[i * w]
print(ans)
Buggy code:
S,w=input(),int(input())
print(S[0::3])

Fixed code:
S,w=input(),int(input())
print(S[0::w])
Buggy code:
s = input()
w = int(input())
ans = ''
for i in range(len(s)):
    ans+=s[i*w]
    if (i+1) * w > len(s):
        break
print(ans)

Fixed code:
s = input()
w = int(input())
ans = ''
for i in range(len(s)):
    ans+=s[i*w]
    if (i+1) * w > len(s) - 1:
        break
print(ans)
Buggy code:
s = input()
w = int(input())
ans = ''
count = 0
while count <= len(s):
  ans += s[count]
  count += w
print(ans)

Fixed code:
s = input()
w = int(input())
ans = ''
count = 0
while count <= len(s)-1:
  ans += s[count]
  count += w
print(ans)
Buggy code:
s,a=input(),int(input());ans=""
for i in range(len(s)):
  if i%n==0:ans+=s[i]
print(ans)

Fixed code:
s,n=input(),int(input());ans=""
for i in range(len(s)):
  if i%n==0:ans+=s[i]
print(ans)
Buggy code:
from sys import stdin
moji=(stdin.readline().rstrip())
N=int(stdin.readline().rstrip())
ans=moji[0]
for i in range(1,len(moji)):
    if i*N > len(moji):
        break
    ans=ans+moji[i*N]
print(ans)

Fixed code:
from sys import stdin
moji=(stdin.readline().rstrip())
N=int(stdin.readline().rstrip())
ans=moji[0]
ite=len(moji)
for i in range(1,ite+1):
    if i*N > len(moji)-1:
        break
    ans=ans+moji[i*N]
print(ans)
Buggy code:
s=input()
n=input()
a=[]
for i in range(0,len(s),n):
	a.append(s[i])
print(*a,sep="")

Fixed code:
s=input()
n=int(input())
a=[]
for i in range(0,len(s),n):
	a.append(s[i])
print(*a,sep="")
Buggy code:
S = input()
w = int(input())

for index, s in enumerate(S):
    if index % w == 0:
        sys.stdout.write(s)



Fixed code:
import sys

S = input()
w = int(input())

for index, s in enumerate(S):
    if index % w == 0:
        sys.stdout.write(s)
Buggy code:
s = input()
w = int(input())

length = len(s)

output = s[0]
i = w

while(i<length):
    output += s[w]
    i += w

print(output)


Fixed code:
s = input()
w = int(input())

length = len(s)

output = s[0]
i = w

while(i<length):
    output += s[i]
    i += w

print(output)
Buggy code:
S = input()
w = int(input())
s = ''
for i in range((len(S) // w) + 1):
  s += S[i * w]
print(s)

Fixed code:
S = input()
w = int(input())
iter = int((len(S) - 1) / w) + 1
s = ''

for i in range(iter):
    s += S[w*i]

print(s)
Buggy code:
s=input()
n=int(input())
ans=''
for i in range(n):
  if i%n==0:
    ans+=s[i]
print(ans)
    

Fixed code:
s = input()
n = int(input())
ans = ""
for i in range(len(s)):
    if i % n == 0:
       ans += str(s[i])
print(ans)
Buggy code:
s = int(input())
w = input()
S = ''
for i in range(0,len(w),s):
  S = S+w[i]

Fixed code:
w = input()
s = int(input())
S = ''
for i in range(0,len(w),s):
  S = S+w[i]
print(S)
Buggy code:
S = input()
w = int(input())
l = len(S)
ret = ""
if S % w:
  for i in range(1 + S // w):
    ret += S[i * w]
else:
  for i in range(S // w):
    ret += S[i * w]
print(ret)

Fixed code:
S = input()
w = int(input())
l = len(S)
ret = ""
if l % w:
  for i in range(1 + l // w):
    ret += S[i * w]
else:
  for i in range(l // w):
    ret += S[i * w]
print(ret)
Buggy code:
def output(string, digit):
    _output=""
    for i in range(len(string)):
        if i%digit==0:
            _output= _output+string[i]
        else: pass
    return _output

s=input()
d=int(input())
output(s, d)

Fixed code:
def output(string, digit):
    _output=""
    for i in range(len(string)):
        if i%digit==0:
            _output=_output+string[i]
        else: pass
    return _output

s=str(input())
d=int(input())
print(output(s, d))
Buggy code:
def main():
    s_i = input()
    n_i = int(input())
    ans = ""
    while True:
        if len(s_i) < n_i:
            if n_i == 1:
                break
            else:
                if s_i == "":
                    break
                else:
                    ans += s_i[0]
                    break
        else:
            ans += s_i[:n_i][0]
            s_i = s_i[n_i:]
            print(ans)


if __name__ == "__main__":
    main()

Fixed code:
def main():
    s_i = input()
    n_i = int(input())
    ans = ""
    while True:
        if len(s_i) < n_i:
            if s_i != "":
               ans += s_i[0]
               break
            else:
                break
        else:
            ans += s_i[:n_i][0]
            s_i = s_i[n_i:]
    print(ans)


if __name__ == "__main__":
    main()
Buggy code:
S = input()
w = input()
ans = ''

for i in range(0, w, len(S)):
    lit = S[i:i+w]
    ans = ans + lit[0]


Fixed code:
S = input()
w = input()
w = int(w)
ans = ''

for i in range(0, len(S), w):
    lit = S[i:i+w]
    ans = ans + lit[0]

print(ans)
Buggy code:
# -*- coding: utf-8 -*-
import sys
S = input()
w = int(input())
x = 0

S_list = list(S)

while True:
    sys.stdout.write(S_list[x])
    x = x + w
    if x > len(S_list) or x + w > len(S_list):
        break


Fixed code:
# -*- coding: utf-8 -*-
import sys
S = input()
w = int(input())
x = 0

S_list = list(S)

sys.stdout.write(S_list[0])
while True:
    x = x + w
    if x >= len(S_list):
        break
    sys.stdout.write(S_list[x])
Buggy code:
S = list(input())
w = int(input())

L = len(S)

ans = []

for i in range(0,L,w):
	if i < L-1:
		ans.append(S[i])


print (''.join(ans))

Fixed code:
S = list(input())
w = int(input())

L = len(S)

ans = []

for i in range(0,L,w):
	if i <= L-1:
		ans.append(S[i])


print (''.join(ans))
Buggy code:
s=input().split()
num=int(input())
ans = ""
for i in range(0, len(s[0]) + 1, num ):
  ans=ans+s[0][i]
print(ans)

Fixed code:
s=input().split()
num=int(input())
ans = ""
for i in range(0, len(s[0]), num):
  ans=ans+s[0][i]
print(ans)
Buggy code:
S = list(input())
w = int(input())
li = [S[w*i] for i in range(len(S)//w + 1)]
result = ''.join(li)

print(result)

Fixed code:
S = list(input())
w = int(input())
li = [S[w*i] for i in range((len(S)-1)//w + 1)]
result = ''.join(li)

print(result)
Buggy code:
s=input()
w=int(input())
a=''
for i in range(0,len(s)//w+1):
    a+=s[w*i]
print(a)


Fixed code:
s=input()
w=int(input())
a=''
for i in range(0,(len(s)-1)//w+1):
    a+=s[w*i]
print(a)
Buggy code:
S = input()
N = int(input())

output=[]

print(len(S))

for i in range(len(S)):
  if i%N==0:
    output.append(S[i])
    
output2 = ''.join(output)

print(output2)

Fixed code:
S = input()
N = int(input())

output=[]

for i in range(len(S)):
  if i%N==0:
    output.append(S[i])
    
output2 = ''.join(output)

print(output2)
Buggy code:
s=input()
w=int(input())
ans=""
for i in range(-len(s)//-w):
    ans+=s[i*w]
print(ans)


Fixed code:
s=input()
w=int(input())

t=""
for i in range(-(-len(s)//w)):
	t+=s[w*i]
print(t)
Buggy code:
a=input()
b=int(input())
print(a[::3])

Fixed code:
a=input()
b=int(input())
print(a[::b])
Buggy code:
s, w =input(), int(input())
ans = ''
c = 0
while c < len(s)-1:
    ans += s[c]
    c += w
print(ans)

Fixed code:
s, w =input(), int(input())
ans = ''
c = 0
while c < len(s):
    ans += s[c]
    c += w
print(ans)
Buggy code:
s = input()
w = int(input())
a = ''
for i in range(int(len(s)/w)+1):
  a += s[i*3]
print(a)

Fixed code:
s = input()
w = int(input())

a = ""
for i in range((len(s) - 1) // w + 1):
    a += s[w * i]
print(a)
Buggy code:
S = input()
w = input()
ans = ''

for i in range(0, len(S), w):
    lit = S[i:i+w]
    ans = ans + lit[0]

print(ans)
    

Fixed code:
S = input()
w = int(input())
ans = ""
for i in range(0, len(S), w):
    ans += S[i]
print(ans)
Buggy code:
s = int(input())
w = input()
S = ''
for i in range(0,len(w),s):
  S = S+w[i]
print(S)

Fixed code:
s=input()
w=int(input())

ans=''
for i in range(0, len(s), w):
    ans+=s[i]
print(ans)
Buggy code:
s = input()
w = int(input())
ans = ''
for i in range(0 ,len(s) , w):
  ans += s[i:i+w][0]

print(ans)s = input()
w = int(input())
ans = ''
for i in range(0 ,len(s) , w):
  ans += s[i]

print(ans)

Fixed code:
s = list(input())
w = int(input())

ans = ""
for i in range(0, len(s), w):
    ans += s[i]
print(ans)
Buggy code:
n = int(input())
if n%2 == 0:
    print(n/2)
else:
    print(n*2)

Fixed code:
n = int(input())
if n%2 == 0:
    print(int(n))
else:
    print(int(n*2))
Buggy code:
N = int(input())

if (N % 2 == 0) :
	print(2)
else :
	print(2*N)


Fixed code:
N = int(input())

print(N if N%2==0 else 2*N)
Buggy code:
n = int(input())

if n % 2 == 0:
    print(n*2)
else:
    print(n)


Fixed code:
n = int(input())

if n % 2 == 0 :
    print(n)
else:
    print(n*2)
Buggy code:
n = input()

if n % 2 == 0:
  print(n)
else:
  print(2*n)

Fixed code:
n = int(input())

if (n%2 == 0):
    print(n)
else:
    print(2*n)
Buggy code:
n = int(input())

if (n%2 == 0):
    print(2)
else:
    print(2*n)

Fixed code:
n = int(input())

print(n if n%2==0 else 2*n)
Buggy code:
n = int(input())
if n % 2 == 0:
    print(2)
else:
    print(2 * n)

Fixed code:
n = int(input())
if n % 2 == 0:
    print(n)
else:
    print(n*2)
Buggy code:
n = int(input())
if n%2 == 0:
    print(n/2)
    exit()
print(n*2)

Fixed code:
n = int(input())
if n%2 == 0:
    print(n)
    exit()
print(n*2)
Buggy code:
N = input()

if N % 2 != 0:
    answer = N * 2
    print(answer)
else:
    print(N)


Fixed code:
N = int(input())

if N % 2 != 0:
    answer = N * 2
    print(answer)
else:
    print(N)
Buggy code:
N=int(input())
if N%2=0:
    ans=N
else:
    ans=N*2
print(ans)

Fixed code:
N = int(input())

if N % 2 == 0:
	print(N)
else:
	print(N * 2)
Buggy code:
n = int(input())
if n&1:
    print(2*n)
else
    print(n)


Fixed code:
n = int(input())
if n&1:
    print(2*n)
else:
    print(n)
Buggy code:
N=input()
if N%2==0:
    print(N)
else:
    print(N*2)
    

Fixed code:
N=input()
N=int(N)
if N%2==0:
    print(N)
else:
    print(N*2)
Buggy code:
import math
N=int(input())
print(2*N//gcd(2,N))

Fixed code:
import math
N=int(input())
print(2*N//math.gcd(2,N))
Buggy code:
N = input()
if N % 2 == 0:
    print(N)
else:
    print(N * 2)

Fixed code:
N = int(input())

if N%2 == 0 :
    print(N)
else :
    print(N*2)
Buggy code:
N=int(input())
if N%2==0:
  print(N)
else
  print(N*2)

Fixed code:
N = int(input())

print(N if N % 2 == 0 else N*2)
Buggy code:
N=int(input())
import math
print(2*n//math.gcd(2,N))

Fixed code:
import math
n = int(input())
print(int(2 * n / math.gcd(2, n)))
Buggy code:
N=int(input())
if N/2==N//2:
    print(N)
else:
    print(n*2)

Fixed code:
N=int(input())
if N/2==N//2:
    print(N)
else:
    print(N*2)
Buggy code:
N = int(input())

print(N + N % 2)

Fixed code:
N = int(input())
print(N+N%2*N)
Buggy code:
if int(input())%2==0:
  print(N)
else:
  print(2*N)

Fixed code:
N =int(input())

if N % 2 != 0:
    print(2*N)
else:
    print(N)
Buggy code:
n = int(input)
if n%2 == 0:
  print(n)
else:
  print(2*n)

Fixed code:
n=int(input())

if n % 2 == 0:
  print(n)
else:
  print(n*2)
Buggy code:
x = int(input)

if x%2 == 0:
  print(x)
else:
  print(x*2)

Fixed code:
x = int(input())
 
if x%2 == 0:
  print(x)
else:
  print(x*2)
Buggy code:
N=int(input())

if N%==0:
  print(N)
else:
  print(2*N)

Fixed code:
N = int(input())

if N%2 == 0:
    print (N)
else:
    print (2* N)
Buggy code:
N = input()
if N % 2 == 0:
  print(N)
else:
  print(N*2)

Fixed code:
N = int(input())
if N % 2 == 0 :
    print(N)
else :
    print(2*N)