Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
n= int(input())
condition=True

for i in range(n):
  Q = [i for i in input().split()]
  if Q[0] =='1':
    if condition ==True:
      condition=False
    else:
      condition=True
  else:
    if Q[1]=='1':
      if condition ==True:
        S = Q[2]+S
      else:
        S =S+Q[2]
    else:
      if condition==True:
        S =S+Q[2]
      else:
        S = Q[2]+S
    #print(S)

if condition ==False:
  S=S[::-1]
print(S)

Fixed submission:
from collections import deque

S = deque(input())
n= int(input())
condition=True

for i in range(n):
  Q = [i for i in input().split()]
  if Q[0] =='1':
    if condition ==True:
      condition=False
    else:
      condition=True
  else:
    if Q[1]=='1':
      if condition ==True:
        S.appendleft(Q[2])
      else:
        S.append(Q[2])
    else:
      if condition==True:
        S.append(Q[2])
      else:
        S.appendleft(Q[2])
    #print(S)

if condition ==False:
  S.reverse()

for i in S:
  print(i, end='')

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

for i in range(n):
  Q = [i for i in input().split()]
  if Q[0] =='1':
    S = S[::-1]
    #print(S)
  else:
    if Q[1]=='1':
      S = Q[2]+S
    else:
      S =S+Q[2]
    #print(S)
print(S)

Fixed submission:
from collections import deque

S = deque(input())
n= int(input())
condition=True

for i in range(n):
  Q = [i for i in input().split()]
  if Q[0] =='1':
    if condition ==True:
      condition=False
    else:
      condition=True
  else:
    if Q[1]=='1':
      if condition ==True:
        S.appendleft(Q[2])
      else:
        S.append(Q[2])
    else:
      if condition==True:
        S.append(Q[2])
      else:
        S.appendleft(Q[2])
    #print(S)

if condition ==False:
  S.reverse()

for i in S:
  print(i, end='')

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

for i in range(n):
  Q = [i for i in input().split()]
  if Q[0] =='1':
    S = S[::-1]
    #print(S)
  else:
    if Q[1]=='1':
      S = Q[2]+S
    else:
      S =S+Q[2]
    #print(S)
print(S)

Fixed submission:
from collections import deque

S = deque(input())
n= int(input())
condition=True

for i in range(n):
  Q = [i for i in input().split()]
  if Q[0] =='1':
    if condition ==True:
      condition=False
    else:
      condition=True
  else:
    if Q[1]=='1':
      if condition ==True:
        S.appendleft(Q[2])
      else:
        S.append(Q[2])
    else:
      if condition==True:
        S.append(Q[2])
      else:
        S.appendleft(Q[2])
    #print(S)

if condition ==False:
  S.reverse()

for i in S:
  print(i, end='')
Buggy python submission (verdict: Runtime Error):
import fractions
N = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, N):
    ans = ans * a[i] // fractions.gcd(ans, a[i])
 
total=0  
for i in range(0,N):
  if total+ ans/a[i] >= 10**9+7:
    total = (total+ans//a[i])%(10**9+7)
  else:
    total+= ans//a[i]

Fixed submission:
import fractions
N = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, N):
    ans = ans * a[i] // fractions.gcd(ans, a[i])
 
total=0  
for i in range(0,N):
    total+= ans//a[i]

print(total%(10**9+7))

Buggy python submission (verdict: Runtime Error):
import fractions
N = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, N):
    ans = ans * a[i] // fractions.gcd(ans, a[i])

total=0  
for i in range(0,N):
  if total+ ans/a[i] >= 10**9+7:
    total = (total+ans/a[i])%(10**9+7)
  else:
    total+= ans/a[i]
  
  
  
print(int(total))

Fixed submission:
import fractions
N = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, N):
    ans = ans * a[i] // fractions.gcd(ans, a[i])
 
total=0  
for i in range(0,N):
    total+= ans//a[i]

print(total%(10**9+7))
Buggy python submission (verdict: Runtime Error):
import sys

N =int(input())

for a in range(1,10):
  for b in range(1,10):
    if a*b == N:
      print('yes')
      sys.exit()
print('no')

Fixed submission:
A,B = map(int, input().split())
if (A<=9) & (B<=9):
  print(A*B)
else:
  print(-1)

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if (A<=9) & (B<=9):
  print(A*B)
else:
  print(-1)

Fixed submission:
A,B = map(int, input().split())
if (A<=9) & (B<=9):
  print(A*B)
else:
  print(-1)

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A<=9 & B<=9:
  print(A*B)
else:
  print(-1)

Fixed submission:
A,B = map(int, input().split())
if (A<=9) & (B<=9):
  print(A*B)
else:
  print(-1)

Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
if A<=9 & B<=9:
  print(A*B)
else:
  -1

Fixed submission:
A,B = map(int, input().split())
if (A<=9) & (B<=9):
  print(A*B)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
import bisect

N = int(input())
L = list(map(int, input().split()))
L = sorted(L)
ans = 0
for i in range(N):
  for j in range(i+1, N):
    min_sum = L[i]+L[j]
    more_than = bisect.bisect_left(L[j+1:], min_sum)
    ans += more_than
print(ans)

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

if A <= 2*B:
  print(int(0))
else:
  print(A-2*B)

Buggy python submission (verdict: Runtime Error):
import bisect
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
 
 
def solve2():
    N = int(input())
    L = list(map(int, input().split()))
    L = sorted(L)
    ans = 0
    for i in range(N):
        for j in range(i+1, N):
            min_sum = L[i]+L[j]
            more_than = bisect.bisect_left(L[j+1:], min_sum)
            ans += more_than
    print(ans)
 
 
solve2()

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

if A <= 2*B:
  print(int(0))
else:
  print(A-2*B)
Buggy python submission (verdict: Runtime Error):
n=int(input())

if n%2 ==1:
  print(1/2+1/2n)
else:
  print(0.5)

Fixed submission:
n = int(input())

if n%2 ==0:
  print(0.5)
else:
  s=1/2+1/(2*n)
  print(s)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = [int(i) for i in input().split()]

for j in range(1, n+1):
  for i in range(n):
    if A[i] ==j:
      print(i+1, end=" ")

Fixed submission:
n = int(input())
A = [int(i) for i in input().split()]

L=[0]*n

for i in range(n):
  s = A[i]
  L[s-1] = i+1

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

print(max(a+b,a*b,a-b,a/b))

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

print(max(a+b,a*b,a-b))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l_list=[]

for _ in range(n):
  l=sorted(input())
  l_list.append(l)

count=0

for i in range(n):
  for j in range(i+1,n,1):
    if l_list[i] == l_list[j]:
      count+=1
print(count)

Fixed submission:
from math import factorial
def com(n,r):
  if n<r:
    return 0
  return int(factorial(n) // factorial(r) // factorial(n-r))

n=int(input())
l_list=[]

for _ in range(n):
  l=sorted(input())
  l_list.append(l)

l_list = sorted(l_list)

count=0

ans = 0
i = 0
j = 1
while i < n:
  tmp = 0
  while i + j < n and l_list[i] == l_list[i + j]:
    tmp += 1
    j += 1
  if tmp != 0:
    ans += com(tmp+1, 2)
  i += j
  j = 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())

count=0
for i in range(k+1):
  if i+2*k-s >=0:
    for j in range(k+1):
      if (s-(i+j)<=k)&(s-(i+j)>=0):
        count+=1
print(count)

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

count=0
for i in range(k+1):
  for j in range(k+1):
    if (s-(i+j)<=k)&(s-(i+j)>=0):
      count+=1
print(count)

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

count=0
for i in range(k+1):
  if i+2*k-s >=0:
    for j in range(k+1):
      if i+j+k-s>=0:
        for h in range(k+1):
          if i+j+h ==s:
            count+=1
print(count)

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

count=0
for i in range(k+1):
  for j in range(k+1):
    if (s-(i+j)<=k)&(s-(i+j)>=0):
      count+=1
print(count)

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

count=0
for i in range(k+1):
  for j in range(k+1):
    for h in range(k+1):
      if i+j+h ==s:
        count+=1
print(count)

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

count=0
for i in range(k+1):
  for j in range(k+1):
    if (s-(i+j)<=k)&(s-(i+j)>=0):
      count+=1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().split()))
S = 0
for i in range(N - 1):
  T = 0
  for j in range(N - i - 1):
    # print(As[i], As[i + 1 + j])
    T += As[i + 1 + j]
  T = T % 1000000007
  S += As[i] * T
print(S % 1000000007)

Fixed submission:
N = int(input())
As = list(map(int, input().split()))
S = 0
T = 0
for i in range(N):
  S += As[i]
  T += (As[i] * As[i]) % 1000000007
# print(S)
# print(T)
A = S*S % 1000000007
B = T % 1000000007
X = (A - B) % 1000000007

print((X * int((1000000007 + 1)/2)) % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().split()))
S = 0
for i in range(N - 1):
  for j in range(N - i - 1):
    # print(As[i], As[i + 1 + j])
    S += As[i] * As[i + 1 + j]
print(S % 1000000007)

Fixed submission:
N = int(input())
As = list(map(int, input().split()))
S = 0
T = 0
for i in range(N):
  S += As[i]
  T += (As[i] * As[i]) % 1000000007
# print(S)
# print(T)
A = S*S % 1000000007
B = T % 1000000007
X = (A - B) % 1000000007

print((X * int((1000000007 + 1)/2)) % 1000000007)
Buggy python submission (verdict: Runtime Error):
import sys

def prepare(X):
    N = 101
    List = [X] * N
    for i in range(0, 50):
        List[2*i+1] -= i+1
        List[2*i+2] += i+1
    return List

def remove(List, N, PList):
    for Num in range(N):
        List.pop( List.index(PList[Num]) )
    print(List[0])
if(__name__ == "__main__"):

    XY = input().strip().split()
    X = int(XY[0])
    N = int(XY[1])

    PList = [0] * N
    if(N > 0):
        P_str = input().strip().split()

        for i in range(N):
            PList[i] = int( P_str[i] )

        List = prepare(X)
        remove(List, N, PList)
    else:
        print(X)


Fixed submission:
import sys

def prepare(X):
    N = 101
    List = [X] * N
    for i in range(0, 50):
        List[2*i+1] = X-i-1
        List[2*i+2] = X+i+1
    return List

def remove(List, N, PList):
    for Num in range(N):
        if(PList[Num] in List):
            List.pop( List.index(PList[Num]) )
    print(List[0])
if(__name__ == "__main__"):

    XY = input().strip().split()
    X = int(XY[0])
    N = int(XY[1])

    PList = [0] * N
    if(N > 0):
        P_str = input().strip().split()

        for i in range(N):
            PList[i] = int( P_str[i] )

        List = prepare(X)
        remove(List, N, PList)
    else:
        print(X)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

def replace(Str):
    Len = len(Str)
    for Num in range(Len):
        if(Str[Num]== "?"):
            Str = Str[:Num] + 'D' + Str[Num+1:]
    return Str

if(__name__ == "__main__"):
    Str = input()

    Stred = replace(Str)
    print(Stred)


Fixed submission:
import sys



if(__name__ == "__main__"):
    Str = input()

    Stred = Str.replace('?', 'D')
    print(Stred)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
flag_1 = 0
flag_2 = 0

for n in range(N):
    count = 0
    for x in range(1,100):
        if flag_1 == 1:
            flag_1 = 0
            break
        for y in range(1,100):
            if flag_2 == 1:
                flag_2 =0
                break
            for z in range(1,100):
                culc = x**2 + y**2 + z**2 + x*y + y*z + z*x - (n + 1)
                if culc == 0:
                    count += 1
                elif culc > 0:
                    if z == 1:
                        flag_2 += 1
                        if y == 1:
                            flag_1 += 1

                    break
                elif culc < 0:
                    continue

    print(count)

Fixed submission:
N = int(input())
ans = [0] * 11000

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            culc = x*x + y*y + z*z + x*y + y*z + z*x
            if culc <= 11000:
                ans[culc] += 1

for i in range(1,N+1):
    print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
flag = 0

for n in range(N):
    count = 0
    for x in range(1,100):
        for y in range(1,100):
            for z in range(1,100):
                culc = x**2 + y**2 + z**2 + x*y + y*z + z*x - (n + 1)
                if culc == 0:
                    count += 1
                elif culc > 0:
                    break
                elif culc < 0:
                    continue

    print(count)

Fixed submission:
N = int(input())
ans = [0] * 11000

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            culc = x*x + y*y + z*z + x*y + y*z + z*x
            if culc <= 11000:
                ans[culc] += 1

for i in range(1,N+1):
    print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
d={}
l = list(map(int, input().split()))
for i in range(len(l)):
    d[i+1] = l[i]

city = 1
l2 = [1]
while True:
    city = d[city]
    if city in l2:
        break
    l2.append(city)

first = l2.index(city)
if len(l2) <= k:
    if city == l2[-1]:
        print(city)
    else:
        l2 = l2[first:]
        print(l2[(k-first)%(len(l2))])
else:
    print(l2[k])

Fixed submission:
n,k = map(int, input().split())
l = [0]+list(map(int, input().split()))

journey = [1]

for i in range(2*n):
    next = l[journey[-1]]
    journey.append(next)
if k <= n+1:
    print(journey[k])
    exit()

end = n
start = n-1

while journey[start] != journey[end]:
    start -= 1

period = end - start
k %= period

while k < n:
    k += period

print(journey[k])

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
d={}
l = list(map(int, input().split()))
for i in range(len(l)):
    d[i+1] = l[i]

city = 1
l2 = [1]
while True:
    city = d[city]
    if city in l2:
        break
    l2.append(city)
first = l2.index(city)
if len(l2) <= k:
    if city == l2[-1]:
        print(city)
    else:
        l2 = l2[first:]
        print(l2[(k-first)%(len(l2))])
else:
    print(l2[k])

Fixed submission:
n,k = map(int, input().split())
l = [0]+list(map(int, input().split()))

journey = [1]

for i in range(2*n):
    next = l[journey[-1]]
    journey.append(next)
if k <= n+1:
    print(journey[k])
    exit()

end = n
start = n-1

while journey[start] != journey[end]:
    start -= 1

period = end - start
k %= period

while k < n:
    k += period

print(journey[k])

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

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

city = 1
l2 = [1]
while True:
    city = l[city-1]
    if city in l2:
        break
    l2.append(city)
first = l2.index(city)
if len(l2) <= k:
    if city == l2[-1]:
        print(city)
    elif city == l2[city]:
        print(city)
    else:
        l2 = l2[first:]
        print(l2[(k-first)%(len(l2))])
else:
    print(l2[k])

Fixed submission:
n,k = map(int, input().split())
l = [0]+list(map(int, input().split()))

journey = [1]

for i in range(2*n):
    next = l[journey[-1]]
    journey.append(next)
if k <= n+1:
    print(journey[k])
    exit()

end = n
start = n-1

while journey[start] != journey[end]:
    start -= 1

period = end - start
k %= period

while k < n:
    k += period

print(journey[k])
Buggy python submission (verdict: Time Limit Exceeded):
a,b,n=map(int,input().split())

max = 0
if b - 1 > n:
    x = n
else:
    x = b - 1

while x <= n:
    tmp = (a * x // b) - a * (x // b)
    if max < tmp: max = tmp
    x += b

print(max)

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

max = 0
if b - 1 > n:
    x = n
else:
    x = b - 1

max = (a * x // b) - a * (x // b)

print(max)

Buggy python submission (verdict: Time Limit Exceeded):
def floor(a, b, x):
    ans = (a * x // b) - a * (x // b)
    return ans

a,b,n=map(int,input().split())
max = 0
if b - 1 > n:
    x = n
else:
    x = b - 1

while x <= n:
    tmp = floor(a,b,x)
    if max < tmp: max = tmp
    x += b

print(max)

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

max = 0
if b - 1 > n:
    x = n
else:
    x = b - 1

max = (a * x // b) - a * (x // b)

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

for i in range(n):
    print(a.count(i+1))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
l = [0] * n

for i in range(1,n):
    l[a[i-1] - 1] += 1
for i in range(n):
    print(l[i])
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

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

n = int(input())
sum = 0

for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            sum += gcd(i, j, k)

print(sum)

Fixed submission:
import math
from functools import reduce

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

n = int(input())
sum = 0

for i in range(1,n+1):
    for j in range(1,i+1):
        for k in range(1,j+1):
            if i == j and j == k:
                sum += gcd(i, j, k)
            elif i == j or j == k or k == i:
                sum += 3 * gcd(i, j, k)
            else:
                sum += 6 * gcd(i, j, k)


print(sum)
Buggy python submission (verdict: Runtime Error):
akacaka
S = []
S_reverse = []
S_first = []
S_first_reverse = []
S_last = []
S_last_reverse = []

S = list(input())
S_reverse = S.copy()
S_reverse.reverse()
S_first = S[:len(S)//2]
S_last = S[(len(S)+1)//2:]
S_first_reverse = S_first.copy()
S_first_reverse.reverse()
S_last_reverse = S_last.copy()
S_last_reverse.reverse()


if S != S_reverse:
    print("No")
elif S_first == S_first_reverse and S_last == S_last_reverse:
    print("Yes")
else:
    print("No")

Fixed submission:
S = []
S_reverse = []
S_first = []
S_first_reverse = []
S_last = []
S_last_reverse = []

S = list(input())
S_reverse = S.copy()
S_reverse.reverse()
S_first = S[:len(S)//2]
S_last = S[(len(S)+1)//2:]
S_first_reverse = S_first.copy()
S_first_reverse.reverse()
S_last_reverse = S_last.copy()
S_last_reverse.reverse()


if S != S_reverse:
    print("No")
elif S_first == S_first_reverse and S_last == S_last_reverse:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
mport math

eight, ten = map(int, input().split())

eight_price = eight / 0.08
ten_price = ten / 0.1

if eight_price >= ten_price:
    bigger = eight_price
    if (bigger // 10) != ten:
        print("-1")
    else:
        print(math.ceil(bigger))
else:
    bigger = ten_price
    if (bigger * 8 // 100) != eight:
        print("-1")
    else:
        print(math.ceil(bigger))

Fixed submission:
import math

eight, ten = map(int, input().split())

eight_price = eight / 0.08
ten_price = ten / 0.1

if eight_price >= ten_price:
    bigger = eight_price
    if (bigger // 10) != ten:
        print("-1")
    else:
        print(math.ceil(bigger))
else:
    bigger = ten_price
    if (bigger * 8 // 100) != eight:
        print("-1")
    else:
        print(math.ceil(bigger))
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
ans = 0

while True:
    if n >= k: 
        n //= k
        ans += 1
    elif n <= 1: break

print(ans+1)

Fixed submission:
n,k = map(int, input().split())
ans = 0

while True:
    n //= k
    ans += 1
    if n == 0: break

print(ans)

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

while True:
    if n >= k: 
        n //= k
        ans += 1
    if n <= 1: break

print(ans+1)

Fixed submission:
n,k = map(int, input().split())
ans = 0

while True:
    n //= k
    ans += 1
    if n == 0: break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
strings = []
nums = []
for i in range(n):
    string = input()
    if string not in strings:
        strings.append(string)
        nums.append(1)
    else:
        nums[strings.index(string)] += 1

l = []
Mx = max(nums)
for i in range(len(strings)):
    if nums[i] == Mx:
        l.append(strings[i])
l.sort()

for i in l:
    print(i)


Fixed submission:
n = int(input())
dic = {}
for i in range(n):
    string = input()
    if string not in dic:
        dic[string] = 1
    else:
        dic[string] += 1

Mx = max(dic.values())
ans = []
for key in dic.keys():    
    if dic[key] == Mx:
        ans.append(key)
ans.sort()
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
strings = []
nums = []
for i in range(n):
    string = input()
    if string not in strings:
        strings.append(string)
        nums.append(1)
    else:
        nums[strings.index(string)] += 1

l = []
Mx = max(nums)
for i in range(len(strings)):
    if nums[i] == Mx:
        l.append(strings[i])
l.sort()

for i in l:
    print(i)

Fixed submission:
n = int(input())
dic = {}
for i in range(n):
    string = input()
    if string not in dic:
        dic[string] = 1
    else:
        dic[string] += 1

Mx = max(dic.values())
ans = []
for key in dic.keys():    
    if dic[key] == Mx:
        ans.append(key)
ans.sort()
for i in ans:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
def expect(p, i, j):
    sum=0
    for l in range(j-i+1):
        sum += (1 + p[i + l]) / 2
    return sum

n,k = map(int, input().split())
p=list(map(int, input().split()))
max = 0

for j in range(n-k+1):
    tmp = expect(p, j, k+j-1)
    if max < tmp: max = tmp
print(max)

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

for i in range(len(p)):
    p[i] = (1+p[i]) / 2
    
max = 0

for i in range(k):
    max += p[i]
tmp = max

for i in range(n-k):
    tmp = tmp - p[i] + p[i+k]
    if max < tmp: max = tmp
print(max)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(sys.stdin.readline().strip())

eroot_n = int(pow(n, 0.5))
res = 0
for num_a in range(1, eroot_n + 1):
    for num_b in range(num_a, n):
        """
        print(num_a)
        print(num_b)
        print('\n')
        """
        if num_a * num_b >= n:
            continue
        if num_a == num_b:
            res = res + 1
        else:
            res = res + 2
print(res)

Fixed submission:
import sys
n = int(sys.stdin.readline().strip())

eroot_n = int(pow(n, 0.5))
res = 0
for num_a in range(1, eroot_n + 1):
    limit_b = int(n / num_a) + 1
    for num_b in range(num_a, limit_b):
        """
        print(num_a)
        print(num_b)
        print('\n')
        """
        if num_a * num_b >= n:
            continue
        if num_a == num_b:
            res = res + 1
        else:
            res = res + 2
print(res)