Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
word = input().rstrip()
n = int(input())
hanten = 0
lhanten = ""
r = ""
for i in range(n):
    a = input().rstrip().split(" ")
    if a[0] == "1":
        hanten = (hanten + 1) % 2
        # word = word[::-1]
        # print(word)
    else:
        if (a[1] == "2" and hanten == 0) or (a[1] == "1" and hanten == 1):
            r += a[2]
            # print("rtuika")
        else:
            lhanten += a[2]
            # print("ltuika")

if hanten == 0:
    print(lhanten[::-1] + word + r)
else:
    print(r[::-1] + word[::-1] + lhanten)

Fixed submission:
word = input().rstrip()
n = int(input())
hanten = 0
lhantenlist = []
rlist = []
for i in range(n):
    a = input().rstrip().split(" ")
    if a[0] == "1":
        hanten = (hanten + 1) % 2
        # word = word[::-1]
        #print(word)
    else:
        if (a[1] == "2" and hanten == 0) or (a[1] == "1" and hanten == 1):
            rlist.append(a[2])
            #print("rtuika: ",rlist)
        else:
            lhantenlist.append(a[2])
            #print("ltuika: ",lhantenlist)

lhanten="".join(lhantenlist)
r="".join(rlist)

if hanten == 0:
    anslist=[lhanten[::-1],word,r]
    ans="".join(anslist)
else:
    anslist = [r[::-1], word[::-1], lhanten]
    ans="".join(anslist)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
word = input().rstrip()
n = int(input())
for i in range(n):
    a = input().rstrip().split(" ")
    if a[0] == "1":
        if len(word) == 1:
            pass
        else:
            word = word[::-1]
            # print(word)
    else:
        if a[1] == "2":
            word = word + a[2]
            # print("rtuika")
        else:
            word = a[2] + word
            # print("ltuika")
print(word)

Fixed submission:
word = input().rstrip()
n = int(input())
hanten = 0
lhantenlist = []
rlist = []
for i in range(n):
    a = input().rstrip().split(" ")
    if a[0] == "1":
        hanten = (hanten + 1) % 2
        # word = word[::-1]
        #print(word)
    else:
        if (a[1] == "2" and hanten == 0) or (a[1] == "1" and hanten == 1):
            rlist.append(a[2])
            #print("rtuika: ",rlist)
        else:
            lhantenlist.append(a[2])
            #print("ltuika: ",lhantenlist)

lhanten="".join(lhantenlist)
r="".join(rlist)

if hanten == 0:
    anslist=[lhanten[::-1],word,r]
    ans="".join(anslist)
else:
    anslist = [r[::-1], word[::-1], lhanten]
    ans="".join(anslist)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

limit = 1E18
n = int(input())
total = 1
# A string
line = str(input())

if line.startswith("0 ") or " 0" in line:
    print(0)
    exit()

for i in line.split():
    x = int(i)
    total *= x

print(-1 if total > limit else total)

Fixed submission:
limit = 1E18
n = int(input())
total = 1
# A string
line = str(input())

if line.startswith("0 ") or " 0" in line:
    print(0)
    exit()

for i in line.split():
    x = int(i)
    total *= x
    if total > limit:
        print(-1)
        exit()

print(-1 if total > limit else total)

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

limit = 1E18
n = int(input())
total = 1
# A string
line = str(input())
for i in line.split():
    x = int(i)
    total *= x

print(-1 if total > limit else total)

Fixed submission:
limit = 1E18
n = int(input())
total = 1
# A string
line = str(input())

if line.startswith("0 ") or " 0" in line:
    print(0)
    exit()

for i in line.split():
    x = int(i)
    total *= x
    if total > limit:
        print(-1)
        exit()

print(-1 if total > limit else total)

Buggy python submission (verdict: Runtime Error):
limit = 1E18
n = input()
total = 0
for i in range(n):
  x = input()
  total += x
  if total > limit:
    print(-1)
    exit()
    
print(total)

Fixed submission:
limit = 1E18
n = int(input())
total = 1
# A string
line = str(input())

if line.startswith("0 ") or " 0" in line:
    print(0)
    exit()

for i in line.split():
    x = int(i)
    total *= x
    if total > limit:
        print(-1)
        exit()

print(-1 if total > limit else total)

Buggy python submission (verdict: Runtime Error):
N = int(input())
num = list(map(int, input().split()))
ans = num.prod()

Fixed submission:
N = int(input())
num = list(map(int, input().split()))
answer = 1
if 0 in num:
  print(0)
else:
  for i in range(N):
    if answer*num[i] <= 10**18:
      answer = answer*num[i]
      if i == N-1:
        print(answer)
    else:
      print(-1)
      break

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in a:
    ans *= i
if ans > 10 ** 18:
    ans = -1
print(ans)

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

if 0 in A:
    print(0)
    quit()

ans = 1
for a in A:
    ans *= a
    if ans > 1000000000000000000:
        print(-1)
        quit()

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

penalty = [0] * n
isAC = [False] * n

for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == "WA":
        if not isAC[p]:
            penalty[p] += 1
    else:
        isAC[p] = True
for i in range(n)
    if not isAC[i]:
        penalty[i] = 0
print(sum(isAC), sum(penalty))

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

penalty = [0] * n
isAC = [False] * n

for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == "WA":
        if not isAC[p]:
            penalty[p] += 1
    else:
        isAC[p] = True
for i in range(n):
    if not isAC[i]:
        penalty[i] = 0
print(sum(isAC), sum(penalty))
Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())

if x == 2:
    print(2)
    quit()
li = [2]
for i in range(3, 10 ** 6, 2):
    for j in li:
        if i % j == 0:
            break
    else:
        if i >= x:
            print(i)
            quit()
        li.append(i)

Fixed submission:
x = int(input())

if x == 2:
    print(2)
    quit()
li = [2]
for i in range(3, 10**6, 2):
    for j in li:
        if i % j == 0:
            break
    else:
        if i >= x:
            print(i)
            quit()
        li.append(i)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
flag = [0] * N
for _ in range(M):
    L, R = map(int, input().split())
    L -= 1
    R -= 1
    for i in range(L, R+1):
        flag[i] += 1
count = 0
for i in range(N):
    if flag[i] == M:
        count += 1
print(count)

Fixed submission:
N, M = map(int, input().split())
L = []
R = []
for i in range(M):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)
ans = min(R) - max(L) + 1
if ans < 0:
    ans = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
t, a = map(int, input().split())
li = list(map(int, input().split()))
x = 55
ind = 0
for i in li:
    mean = t - li[i] * 0.006
    sa = abs(mean - a)
    if sa < x:
        x = sa
        ind = i + 1
print(ind)

Fixed submission:
n = int(input())
t, a = map(int, input().split())
li = list(map(int, input().split()))
x = 10**9
ind = 0
for i in range(n):
    mean = t - li[i] * 0.006
    sa = abs(mean - a)
    if sa < x:
        x = sa
        ind = i + 1
print(ind)
Buggy python submission (verdict: Runtime Error):
a, b, c, x = map(int, input().split())
count = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            if i * 500 + j * 100 + k * 50 == x:
                count += 1
print(count)

Fixed submission:
a, b, c, x = [int(input()) for _ in range(4)]
count = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500 * i + 100 * j + 50 * k == x:
                count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
abyb = a * b
if abyb % 2 == 0:
    print("Even")
else:
    print("Odd")

Fixed submission:
a, b = map(int, input().split())
if (a * b) % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
abyb = a * b
if abyb % 2 = 0:
    print("Even")
else:
    print("Odd")

Fixed submission:
a, b = map(int, input().split())
if (a * b) % 2 == 0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Runtime Error):
nums = [int(input()) for _ in range(int(input()))]
nums_dict = dict()
for i in nums:
    nums_dict[i] = True
print(len(nums_dict.keys()))

Fixed submission:
print("2018/01/" + input()[-2:])
Buggy python submission (verdict: Runtime Error):
n, yen = map(int, input().split())
for x in range(n + 1):
    for y in range(n - x + 1):
        z = n - x - y
        if yen == x * 10000 + y * 5000 + z * 1000:
            print(x + " " + y + " " + z)
            exit(0)
print("-1 -1 -1")

Fixed submission:
n, y = map(int, input().split())
for senyen in range(n + 1):
    for gosenyen in range(n + 1 - senyen):
        manyen = n - senyen - gosenyen
        if senyen * 1000 + gosenyen * 5000 + manyen * 10000 == y:
            print(manyen, gosenyen, senyen)
            exit(0)
print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
total = 0
for i in range(1, n+1):
    x = sum([int(j) for j in str(i)])
        if a <= x <= b:
            total = total + x
print(total)

Fixed submission:
n, a, b = map(int, input().split())
count = 0
for i in range(1, n+1):
    s = sum(int(x) for x in str(i))
    if a <= s <= b:
        count += i
print(count)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
x = (a + b) / 2
print(math.ceil(x))

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

Fixed submission:
n = input()
print("Yes" if n[0] == n[2] else "No")
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
li = []
for i in range(len(s)):
    if s[i] == "A":
        for j in range(i + 1, len(s)):
            if s[j] == "Z":
                li.append(j - i + 1)
print(max(li))

Fixed submission:
s = input()
for i in range(len(s)):
    if s[i] == "A":
        start = i
        break
for j in range(len(s) - 1, -1, -1):
    if s[j] == "Z":
        end = j
        break
print(end - start + 1)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
li = []
for i in range(len(s)):
    for j in range(len(s)):
        if s[i] == "A" and s[j] == "Z" and i < j:
            li.append(j - i + 1)
print(max(li))

Fixed submission:
s = input()
for i in range(len(s)):
    if s[i] == "A":
        start = i
        break
for j in range(len(s) - 1, -1, -1):
    if s[j] == "Z":
        end = j
        break
print(end - start + 1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = (map(int,list(input().split())))
tmp = 1
for i in A:
    tmp = tmp * i
    if tmp == 0:
        print(tmp)
        quit()

if tmp > 10**18:
        tmp=-1
        print(tmp)
        quit()
    
print(tmp)

Fixed submission:
n = int(input())
A = (map(int,list(input().split())))
tmp = 1
for i in A:
    tmp = tmp * i
    if tmp == 0:
        print(tmp)
        quit()
    if tmp > 10**18:
        if 0 in A:
            print(0)
            quit()
        tmp=-1
        print(tmp)
        quit()
    
print(tmp)
Buggy python submission (verdict: Runtime Error):
import math
def yo(a,b,th):
    thr = math.radians(th)
    cosa = math.cos(thr)
    kk = 4.56425719433005567605
    ttt = (a**2 + b**2 - kk**2) / (2*a*b)
    acosa = math.acos(ttt)
    ttt = math.degrees(acosa)
    tmp = float(a**2) + float(b**2) - float(2*b*a*cosa)
    re = float(math.sqrt(tmp))
    return re
A,B,h,m = map(int, input().split())
longdig = ((h*60+m)%360) * 6
shortdig = (h*60+m) * 0.5
theta = abs(longdig - shortdig)
print(yo(A,B,theta))

Fixed submission:
import math
def yo(a,b,th):
    thr = math.radians(th)
    cosa = math.cos(thr)
    tmp = float(a**2) + float(b**2) - float(2*b*a*cosa)
    re = float(math.sqrt(tmp))
    return re
A,B,h,m = map(int, input().split())
longdig = m * 6
shortdig = (h*60+m) * 0.5
theta = abs(longdig - shortdig)
print(yo(A,B,theta))
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, k = map(int, input().split())
box = []
result = 0

if c == 0:
    if a >= k:
        print(k)
    else:
        print(a)
    quit()

for i in range(a):
    box.append(1)
for i in range(b):
    box.append(0)
for i in range(c):
    box.append(-1)

for i in range(k):
    result = result + box[i]

print(result)

Fixed submission:
a, b, c, k = map(int, input().split())
box = []
result = 0

if k <= a:
    print(k)
    quit()
else:
    k = k - a
    result = a
    if k <= b:
        print(result)
        quit()
    else:
        k = k - b
        if k <= c:
            result = result - k
            print(result)
            quit()
        else:
            result = result -c
            print(result)
            quit()
Buggy python submission (verdict: Runtime Error):
S = input()
slen = len(S)
Sint = int(S)
count = 0
for i in range(slen-3):
    for j in range(i+3,slen):
        s4 = int(S[i:j+1])
        if s4 % 2019 == 0:
            count = count + 1
        
print(count)

Fixed submission:
s, w=map(int, input().split())

if s <= w:
    print('unsafe')
else:
    print('safe')
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S = []
for i in range(N):
    s = input()
    if s in S:
        continue
    S.append(s)

print(len(S))

Fixed submission:
N=int(input())
S = []
for i in range(N):
    s = input()
    S.append(s)

print(len(list(set(S))))
Buggy python submission (verdict: Runtime Error):
a,b=map(int, input().split())
if (a*b) % 2 == 0:
  print(Even)
else :
  print(Odd)

Fixed submission:
a,b=map(int, input().split())
if (a*b) % 2 == 0:
  print('Even')
else :
  print('Odd')
Buggy python submission (verdict: Runtime Error):
dic = {"A":1,"B":2,"C":3,"D":4,"E":5,"F":6}
X = input('X>>')
Y = input('Y>>')
for key in dic:
    if key == X:
        x = dic[key]
    if key == Y:
        y = dic[key]
if x > y:
    print('>')
elif x < y:
    print('<')
else:
    print('=')

Fixed submission:
dic = {"A":1,"B":2,"C":3,"D":4,"E":5,"F":6}
X,Y = input().split()
for key in dic:
    if key == X:
        x = dic[key]
    if key == Y:
        y = dic[key]
if x > y:
    print('>')
elif x < y:
    print('<')
else:
    print('=')
Buggy python submission (verdict: Runtime Error):
n,m=int(input().split())
print(int(n*m))

Fixed submission:
from decimal import *
n,m=input().split()
n=Decimal(n)
m=Decimal(m)
n*=m
print(Decimal(n).quantize(Decimal('1.'), rounding=ROUND_DOWN))
Buggy python submission (verdict: Time Limit Exceeded):
def isprime(x):
    for i in range(2,int(x**0.5)+1):
        if x%i==0:
            return False
    return x!=1
def sieve(m):
    n=1
    primes = {}
    arr=set([])
    for i in range(2, int(m ** 0.5) + 1):
        a = n // i
        b = m // i
        for k in range(max(2, a), b + 1):
            c = i * k
            primes[c] = 1

    for i in range(max(n, 2), m + 1):
        if i not in primes:
            arr.add(i)

    return arr
arr=sieve(10**7)
dic={}
n=int(input())

if isprime(n):
    print(1)
    exit()
for i in arr:
    if n%i==0:
        cnt=0
        while n%i==0:
            cnt+=1
            n//=i
        dic[i]=cnt
ans=0
for i in dic:
    x=dic[i]
    r=(-1+(1+8*x)**0.5)//2
    ans+=r
print(int(ans))




Fixed submission:
def isprime(x):
    for i in range(2,int(x**0.5)+1):
        if x%i==0:
            return False
    return x!=1


dic={}
n=int(input())
t=int(n**0.5)+1
for i in range(2,t):
    cnt=0
    while n%i==0:
        cnt+=1
        n//=i
    dic[i]=cnt
if n!=1:
    dic[n]=1
ans=0
for i in dic:
    x=dic[i]
    r=(-1+(1+8*x)**0.5)//2
    ans+=r
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
def isprime(x):
    for i in range(2,int(x**0.5)+1):
        if x%i==0:
            return False
    return x!=1

dic={}
n=int(input())
i=2
if isprime(n):
    print(1)
    exit()
while n>1:
    if n%i==0:
        cnt=0
        if isprime(i):
            while n%i==0:
                cnt+=1
                n//=i
        dic[i]=cnt
        # cnt=0
        # if isprime(n//i):
        #     while n%(n//i)==0:
        #         cnt+=1
        #         n//=(n//i)
        #     dic[n//i]=cnt
    i+=1
ans=0
for i in dic:
    x=dic[i]
    r=(-1+(1+8*x)**0.5)//2
    ans+=r
print(int(ans))




Fixed submission:
def isprime(x):
    for i in range(2,int(x**0.5)+1):
        if x%i==0:
            return False
    return x!=1


dic={}
n=int(input())
t=int(n**0.5)+1
for i in range(2,t):
    cnt=0
    while n%i==0:
        cnt+=1
        n//=i
    dic[i]=cnt
if n!=1:
    dic[n]=1
ans=0
for i in dic:
    x=dic[i]
    r=(-1+(1+8*x)**0.5)//2
    ans+=r
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
nums = input().split()
nums = [int(s) for s in nums]
result = 1
for num in nums:
  result = result * num
if 10**18 < result:
  result = -1
print(result)

Fixed submission:
N = int(input())
nums = input().split()
end = False
result = 1
for num in nums:
  if num == "0":
    print(0)
    end = True
    break
if not end:
  nums = [int(s) for s in nums]
  for num in nums:
    result = result * num
    if 10**18< result:
      result = -1
      break
  print(result)
Buggy python submission (verdict: Runtime Error):
import math
a,b,c = map(int, input().split('.'))
print(math.floor(a*b + a*c/100))

Fixed submission:
import math
a,b = map(str, input().split())
ia = int(a)
ib1,ib2 = map(int, b.split('.'))
print(math.floor(ia*ib1 + ia*ib2//100))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l_a = list(map(int, input().split()))

for i in range(n):
    i = i + 1
    if(i == n):
        print(0)
    else:
        print(l_a.count(i))

Fixed submission:
import collections

n = int(input())
l_a = list(map(int, input().split()))
k_a = collections.Counter(l_a)

for i in range(n):
    print(k_a[i+1])
Buggy python submission (verdict: Runtime Error):
#Input
n, k = map(int, input().split())

#Process
mod = n % k
if(mod > abs(mod - k)):
    Ans = aqbs(mod - k)
else:
    Ans = mod

#Output
print(Ans)

Fixed submission:
#Input
n, k = map(int, input().split())

#Process
mod = n % k
if(mod > abs(mod - k)):
    Ans = abs(mod - k)
else:
    Ans = mod

#Output
print(Ans)
Buggy python submission (verdict: Time Limit Exceeded):
import collections

#Input
n = int(input())
l_a = list(map(int, input().split()))

#Process
d_c = collections.Counter(l_a)
for i in range(n):
    d_o = d_c.copy()
    d_o[l_a[i]] = d_o[l_a[i]] - 1
    l_o = list(d_o.values())
    Ans = 0
    for j in range(len(l_o)):
        if(l_o[j] != 1):
            Ans += int((l_o[j] - 1) * l_o[j] / 2)
    print(Ans)

Fixed submission:
import collections

#Input
n = int(input())
l_a = list(map(int, input().split()))

#Process
d_c = collections.Counter(l_a)
l_c = list(d_c.values())

#N個から選ぶ方法
o = 0
for i in range(len(l_c)):
    if(l_c[i] != 1):
        o += int((l_c[i] - 1) * l_c[i] / 2)

#Output
for i in range(n):
    print(o - d_c[l_a[i]] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
import collections

#Input
n = int(input())
l_a = list(map(int, input().split()))

#Process
for i in range(n):
    l_o = copy.copy(l_a)
    del l_o[i]
    l_c = list(collections.Counter(l_o).values())
    Ans = 0
    for j in range(len(l_c)):
        if(l_c[j] != 1):
            Ans += int((l_c[j] - 1) * l_c[j] / 2)
    print(Ans)

Fixed submission:
import collections

#Input
n = int(input())
l_a = list(map(int, input().split()))

#Process
d_c = collections.Counter(l_a)
l_c = list(d_c.values())

#N個から選ぶ方法
o = 0
for i in range(len(l_c)):
    if(l_c[i] != 1):
        o += int((l_c[i] - 1) * l_c[i] / 2)

#Output
for i in range(n):
    print(o - d_c[l_a[i]] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
import collections

#Input
n = int(input())
l_a = list(map(int, input().split()))

#Process
for i in range(n):
    l_o = copy.copy(l_a)
    del l_o[i]
    l_c = list(collections.Counter(l_o).values())
    Ans = 0
    for i in range(len(l_c)):
        for j in range(l_c[i] - 1):
            Ans += (j + 1)
    print(Ans)

Fixed submission:
import collections

#Input
n = int(input())
l_a = list(map(int, input().split()))

#Process
d_c = collections.Counter(l_a)
l_c = list(d_c.values())

#N個から選ぶ方法
o = 0
for i in range(len(l_c)):
    if(l_c[i] != 1):
        o += int((l_c[i] - 1) * l_c[i] / 2)

#Output
for i in range(n):
    print(o - d_c[l_a[i]] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
import collections

#Input
n = int(input())
l_a = list(map(int, input().split()))

#Process
for i in range(n):
    l_o = copy.copy(l_a)
    del l_o[i]
    c = collections.Counter(l_o)
    #print(c)
    #print(c.values())
    Ans = 0
    for i in range(len(list(c.values()))):
        for j in range(list(c.values())[i] - 1):
            Ans += (j + 1)

    print(Ans)

Fixed submission:
import collections

#Input
n = int(input())
l_a = list(map(int, input().split()))

#Process
d_c = collections.Counter(l_a)
l_c = list(d_c.values())

#N個から選ぶ方法
o = 0
for i in range(len(l_c)):
    if(l_c[i] != 1):
        o += int((l_c[i] - 1) * l_c[i] / 2)

#Output
for i in range(n):
    print(o - d_c[l_a[i]] + 1)
Buggy python submission (verdict: Runtime Error):
s = input()

i = 0
while i < len(s):
    if(s[i] == 'h' and s[i+1] == 'i'):
        ans = "Yes"
    else:
        ans = "No"
        break
    i += 2

print(ans)

Fixed submission:
s = input()

i = 0

if(len(s) % 2 != 0):
    ans = "No"
else:
    while i < len(s):
        if(s[i] == 'h' and s[i+1] == 'i'):
            ans = "Yes"
        else:
            ans = "No"
            break
        i += 2

print(ans)

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

i = 0
while i < len(s):
    if(s[i] == 'h' and s[i+1] == 'i'):
        ans = "Yes"
    else:
        ans = "No"
    i += 2

print(ans)

Fixed submission:
s = input()

i = 0

if(len(s) % 2 != 0):
    ans = "No"
else:
    while i < len(s):
        if(s[i] == 'h' and s[i+1] == 'i'):
            ans = "Yes"
        else:
            ans = "No"
            break
        i += 2

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

#Process
cnt = 0
Ans = 0
flag_AB = True 
while cnt < N:
    if(flag_AB):
        flag_AB = False
        if(cnt + A < N):
            Ans = Ans + A
        else:
            Ans = Ans + A - (cnt + A - N)
        cnt = cnt + A
    else:
        flag_AB = True
        cnt = cnt + B

#Output
print(Ans)

Fixed submission:
#Input
N,A,B= map(int, input().split())

#Process
nokori = 0
na = int(N / (A + B))
if((A+B)*na + A > N):
    nokori = N % (A + B)
else:
    nokori = A
Ans = A * na + nokori

#Output
print(Ans)