Problem:


Score : 300 points

Problem Statement

Given is a positive integer N.
How many tuples (A,B,C) of positive integers satisfy A \times B + C = N?

Constraints

 2 \leq N \leq 10^6

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer.

Sample Input 1

3

Sample Output 1

3

There are 3 tuples of integers that satisfy A \times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).

Sample Input 2

100

Sample Output 2

473

Sample Input 3

1000000

Sample Output 3

13969985



Sample input:
3


Sample output:
3

Submission status: Accepted

Solution code:
def solve():
    ans = 0
    for a in range(1, N):
        for b in range(1, N):
            c = N - a * b
            if c <= 0:
                break
            ans += 1
    return ans


N = int(input())
ans = solve()
print(ans)

Submission status: Accepted

Solution code:
def ri():
    return int(input())


def rii():
    return [int(v) for v in input().split()]


def solve():
    N = ri()
    ans = 0
    for a in range(1, N):
        b = 1
        while b * a < N:
            ans += 1
            b += 1
    print(ans)


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import math
import sys
input = sys.stdin.readline


def main():
    N = int(input())

    answer = 0
    for a in range(1, math.ceil(N**(1 / 2))):
        for b in range(a, N):
            c = (N - a * b)
            if c <= 0:
                break
            if a != b:
                answer += 2
            else:
                answer += 1
    print(answer)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
 
for a in range(1,N):
    b = N//a
    if a*b == N:
        b -= 1
    ans += b
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1, n):
    ans += (n-1)//i

print(ans)

Submission status: Accepted

Solution code:
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def resolve():
    N = int(sys.stdin.readline())
    N1 = N - 1

    ans = 0
    for i in range(1, N):
        ans += N1//i
    print(ans)
if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

for i in range(1, N):
    ans += (N-1) // i

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
print(sum([(n-1)//a for a in range(1, n)]))

Submission status: Accepted

Solution code:
n = int(input())

total = 0

for i in range(1, 10**6 + 1):
    for j in range(1, 10**6 + 1):
        m = n - i * j
        if m > 0:
            total += 1
        else:
            break

print(total)

Submission status: Accepted

Solution code:
n = int(input()); x = 0
for i in range(1, n): x += (n-1)//i
print(x)

Submission status: Accepted

Solution code:
n = int(input())
print(sum([(n - 1) // i for i in range(1, n)]))

Submission status: Accepted

Solution code:
n = int(input())
c = 0
for a in range(1, n): c += (n-1)//a
print(c)

Submission status: Accepted

Solution code:
N = int(input())

result = 0
for a in range(1, N):
  result += (N - 1) // a

print(result)

Submission status: Accepted

Solution code:
n = int(input())
res = 0
for i in range(1,n+1):
  for j in range(1,n+1):
    if i*j < n:
      res += 1
    else:
        break
print(res)

Submission status: Accepted

Solution code:
import sys

N = int(sys.stdin.readline())

ans = 0
for i in range(1, N):
    ans += (N - 1) // i
print(ans)

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def main():
    N = NI()
    ans = 0
    for a in range(1, N):
        ans += N // a
        if N % a == 0:
            ans -= 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    ans = 0

    for a in range(1, N):
        for b in range(1, N):
            x = a * b
            if x >= N:
                break
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for a in range(1,n):
  ans += (n-1) // a
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0

for i in range(3,n):
  for j in range(1,n//i+1):
    if i * j < n:
      cnt +=1
      
print(cnt+n-1+(n-1)//2)

Submission status: Accepted

Solution code:
n = int(input())
print(sum((n - 1) // i for i in range(1, n)))

Submission status: Accepted

Solution code:
import collections
MAXN = 10**6+10
sieve = [i for i in range(MAXN+1)]
p = 2
while p*p <= MAXN:
    if sieve[p] == p:
        for q in range(2*p,MAXN+1,p):
            if sieve[q] == q:
                sieve[q] = p
    p += 1
    
def prime(a):
    tmp = []
    while a > 1:
        tmp.append(sieve[a])
        a //= sieve[a]
    return collections.Counter(tmp)
 
def main():
    N = int(input())
    ans = 0
    for c in range(1, N):
        p = prime(N - c)
        tmp = 1
        for v in p.values():
            tmp *= (v + 1)
        ans += tmp
    return ans
 
if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
from sys import stdin
input = stdin.readline

N = int(input())
cnt = 0
for A in range(1, N):
    B = (N - 1)//A
    cnt += B

print(cnt)

Submission status: Accepted

Solution code:
n = int(input()) - 1
ans = 0
for i in range(1,n+1):
    ans += n // i
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

k=0

for s in range(1,N):
  k += (N-1) // s
   
  
print (k)

Submission status: Accepted

Solution code:
n = int(input())
c = 0
for i in range(1,n):
    c+=(n-1)//i
print(c)

Submission status: Accepted

Solution code:
n=int(input())
ans=0
for a in range(1, n):
    ans+=(n - 1)//a
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import numpy as np
import numba
from numba import njit, b1, i4, i8, f8

input = sys.stdin.readline


def I():
    return int(input())


@njit((i8,), cache=True)
def main(n):
    table = np.zeros(n, np.int64)

    for i in range(1, n):
        table[::i] += 1

    ans = 0
    for n in table[1:]:
        q, r = divmod(n, 2)
        ans += q * 2 + 1 * r

    return ans


N = I()

print(int(main(N)))

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for a in range(1, N):
    # a * b <= N - 1 となるような b の数 = (N-1)//a
    ans += (N - 1) // a
print(ans)

Submission status: Accepted

Solution code:
N = int(input()) -1
ans = 0

for i in range(1,N+1):
    ans += N // i
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

cnt = 0
for a in range(1, N):
    cnt += (N-1) // a

print(cnt)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    ans = 0

    for a in range(1, n):
        ans += (n - 1) // a

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1,n+1):
    ans += (n-1)//i
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

dp = [1]*(n)
dp[0] = 0

for i in range(2, n):
  for j in range(i, n, i):
    dp[j] += 1
    
print(sum(dp))

Submission status: Accepted

Solution code:
#約数の個数の和（１~N）約数そのものを求めないので「速い」
def yakusu_num(N):
    ans =0
    for i in range(1,N+1):
        ans +=N//i #項数
    return ans


# 初期入力
import sys
input = sys.stdin.readline  #文字列では使わない

N = int(input())
ans =yakusu_num(N-1)

print(ans)

Submission status: Accepted

Solution code:
n=int(input())-1;print(sum(n//-~i for i in range(n)))

Submission status: Accepted

Solution code:
import math
N = int(input())

# A*B < N (イコールだめ）
ans = 0
for i in range(1,N):
  ans += (N-1) // i
  
print(ans)

Submission status: Accepted

Solution code:
import math
N=int(input())
ans=0
for a in range(1,N):#A固定
    ans+=N//a
    if N%a==0:
        ans-=1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for i in range(1, N + 1):
    ans += (N - 1) // i

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

total = 0
for i in range(1, n + 1):
    j = n // i
    if n % i == 0:
        j -= 1
    total += j

print(total)

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

def floor(a,b):
    return a//b

N = I()

ans = 0

for i in range(1,10**6+1):
    ans += floor((N-1),i)

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
ans =0
for i in range(1,N):ans += (N-1)//i
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

cnt = 0

for a in range(1, n):
    cnt += ((n - 1) // a)

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for A in range(1, N):
    ans += (N - 1) // A

print(ans)

Submission status: Accepted

Solution code:
M = 10 ** 6
d = [0] * (M+1)

for a in range(1, M+1):
    for b in range(a, M+1):
        n = a * b
        if n > M:
            break
        d[n] += 2 - (a==b)


N = int(input())
ans = 0
for c in range(1, N):
    ans += d[N - c]

print(ans)

Submission status: Accepted

Solution code:
def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError("n is int-type.")
    if n < 2:
        raise ValueError("n is more than 2")
    data = [i for i in range(2, n + 1)]
    for d in data:
        data = [x for x in data if (x == d or x % d != 0)]
    return data
 
p_list = get_sieve_of_eratosthenes(10**3)
 
def factorization_counta(n):
    arr = []
    temp = n
    for i in p_list:
        if i * i > n:
            break
        elif temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append(cnt)
            
    if temp != 1:
        arr.append(1)
    if arr == []:
        arr.append(1)
    return arr

def main():
    N = int(input())
    ans = 1
    for c in range(2, N):
        p = factorization_counta(c)
        tmp = 1
        for v in p:
            tmp *= (v + 1)
        ans += tmp
    return ans
 
if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
for a in range(1,n):
    cnt += (n-1)//a
print(cnt)

Submission status: Accepted

Solution code:
def solve():
    N = int(input())

    numDivs = [0] * (N+1)
    for div in range(1, N+1):
        for x in range(div, N+1, div):
            numDivs[x] += 1

    ans = 0
    for C in range(1, N+1):
        ans += numDivs[N-C]

    print(ans)


solve()

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1,n):
    ans += (n-1)//i
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = 1
ans = 0
 
# while a < n/2:
#     b = 2
#     while a * b < n:
#         ans += 1
#         b += 1
#     a += 1
 
# print(ans+2*(n-2)+1)
for i in range(1,n):
    ans += (n-1)//i

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for a in range(1, n):
  ans += (n - 1) // a
  
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for a in range (1,n):
    for b in range(a, n, a):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:

def main():
    N = int(input())
    num = 0
    B = 1

    for A in range(1, N):
        for B in range(1, N):
            if N - A * B >= 1:
                num = num + 1
            else:
                break

    print(num)


main()

Submission status: Accepted

Solution code:
import math

N = int(input())
ans = 0
for A in range(1, N):
    lb = 1
    ub = math.ceil(N / A) - 1
    # ub = N // A - int(N % A == 0)
    ans += ub - lb + 1
print(ans)

Submission status: Accepted

Solution code:
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    n = int(input())
    ans = 0
    for i in range(1,n):
        ans += (n-1)//i

    print(ans)
        

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
x = 0
for i in range(n - 1):
    x += int((n - 1) / (i + 1))
print(x)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0

for i in range(1, n):
    ans += (n - 1)//i
        
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
c = 0
for i in range(1,N):
  if i**2 >= N:
    break
  c += 1
for i in range(1,N):
  for j in range(i+1,N):
    if i*j >= N:
      break
    c += 2
print(c)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for a in range(1, N):
    ans += (N-1) // a
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
for a in range(1, n):
    for b in range(1, ((n-1)//a)+1):
        c = n - a*b
        if c <= 0: break
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
L = [0]*(N)
for i in range(1,N):
    for j in range(1,(N-1)//i+1):
        L[j*i]+=1
print(sum(L))

Submission status: Accepted

Solution code:
N=int(input())-1
ans=0
for i in range(1,N+1):
    ans+=(N//i)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for a in range(1, N + 1):
    for b in range(1, N + 1):
        if a * b <= N - 1:
            ans += 1
        else:
            break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

count = 0
for i in range(1,N+1):
    for j in range(1,N+1):
        if N - i*j >= 1:
            count += 1
        else:
            break

print(count)

Submission status: Accepted

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())


N = I()
print(sum((N-1)//i for i in range(1,N)))

# 対称性を利用して、計算量を O(N**.5) にすることも可能

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = 0
ve = math.floor(math.sqrt(N))
for st in range(ve):
    tmp = math.floor(N/(st+1)-0.000001)
    score = 2*(tmp - st)
    if score > 0:
        score -= 1
    ans += score
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
for a in range(1, n):
    for b in range(1, ((n-1)//a)+1):
        c = n - a*b
        if c <= 0: break
        if a*b + c == n: cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import math


def main():
    n = int(input())
    # n, k = map(int, input().split())
    # h = list(map(int, input().split()))
    # s = input()
    # h = [int(input()) for _ in rane(n)]

    ans = 0

    for i in range(1, n):
        ans += (n - 1) // i
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for A in range(1,N):
  ans += (N-1) // A
print(ans)

Submission status: Accepted

Solution code:

N = int(input())

cnt=0
for A in range(1,N):
    for B in range(1,N):
        if A*B >= N:
            break
        else:
            cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
N=int(input())
print(sum([((N-1)//1)//i for i in range(1, N)]))

Submission status: Accepted

Solution code:
import sys

N = int(input())

result = 0
for a in range(1, N):
    if N % a == 0:
        b_count = N // a - 1
    else:
        b_count = N // a
    result += b_count

print(result)

Submission status: Accepted

Solution code:
N = int(input())
 
ans = 0
for a in range(1,N):
    ans += (N-1)//a
        
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
count = 0
for i in range(1,n):
  count += (n-1)//i
print(count)

Submission status: Accepted

Solution code:
def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    
    return table
n=int(input())
print(sum(num_divisors_table(n-1)))

Submission status: Accepted

Solution code:
import math
N=int(input())

def era(n):
  prime=[]
  furui=list(range(2,n+1))
  while furui[0]<math.sqrt(n):
    prime.append(furui[0])
    furui=[i for i in furui if i%furui[0]!=0]
  return prime+furui

furui=era(10**6+7)
minfac=list(range(10**6+8))
for i in furui:
  for j in range(i,(10**6+7)//i+1):
    if minfac[i*j]==i*j:
      minfac[i*j]=i

ans=0   
for i in range(1,N):
  temp=1
  temp2=1
  l=1
  while i != 1:
    if minfac[i]!=l:
      temp*=temp2
      temp2=2
    else:
      temp2+=1
    l=minfac[i]
    i//=l
  temp*=temp2
  ans+=temp
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
for a in range(1, n):
    bn = (n-1) // a
    for b in range(1, bn+1):
        c = n-(a*b)
        if c<=0: break
        if a*b + c == n:
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0

for a in range(1,n):
    if n%a == 0:
        ans += n//a -1
    else:
        ans += n//a

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
import math
import statistics
import itertools
a=int(input())
# b=input()
# c=[]
# for i in a:
#     c.append(int(i))
# A,B,C= map(int,input().split())
# f = list(map(int,input().split()))
# g = [input() for _ in range(a)]
count=0
for i in range(1,a):
    count+=(a-1)//i
print(count)

Submission status: Accepted

Solution code:
def c_a_times_b_plus_c():
    N = int(input())
    return sum((N - 1) // a for a in range(1, N))

print(c_a_times_b_plus_c())

Submission status: Accepted

Solution code:
N=int(input())
x=0
for i in range(1,N):
  x=x+(N-1)//i
print(x)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for i in range(1, N):
    ans += (N - 1) // i

print(ans)

Submission status: Accepted

Solution code:
n=int(input(''))
p=0
for i in range(n-1):
    a=i+1
    p=p+(n-1)//a
print(p)

Submission status: Accepted

Solution code:
import os
import sys
from atexit import register
from io import BytesIO
sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))
input = lambda: sys.stdin.readline().rstrip('\r\n')
raw_input = lambda: sys.stdin.readline().rstrip('\r\n')

# (int(x) for x in input().split())d.
n = int(input())
ans = 0
for a in xrange(1,n+1):
    for b in xrange(a, n+1):
        if (a*b < n):
            if (a==b):
                ans += 1
            else:
                ans += 2
        else:
            break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for a in range(1,N):
    if a**2 < N:
        ans += 1
    for b in range(a+1,N):
        if a * b < N:
            ans += 2
        else:
            break

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
cnt = 0
for a in range(1, N):
    for b in range(a, N, a):
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
from collections import Counter
def resolve():
    n = int(input())

    sieve = list(range(n + 1))
    primes = []
    for i in range(2, n + 1):
        if sieve[i] == i:
            primes.append(i)
        for p in primes:
            if p * i > n or sieve[i] < p:
                break
            sieve[p * i] = p

    ans = 0
    for i in range(1, n):
        C = Counter()
        while i > 1:
            C[sieve[i]] += 1
            i //= sieve[i]
        score = 1
        for val in C.values():
            score *= val + 1
        ans += score
    print(ans)
resolve()

Submission status: Accepted

Solution code:
n = int(input())
a = 0
for i in range(1,n):
  for j in range(i,n,i):
    a+=1
print(a)

Submission status: Accepted

Solution code:
N=int(input())
Sum=0
for a in range(1,N):
  Sum+=(N-1)//a
  
print (Sum)

Submission status: Accepted

Solution code:
import math

N = int(input())

count = 0
for A in range(1, N):
    for B in range(1, math.ceil(N/A)):
        if A * B < N:
            count += 1
print(count)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for a in range(1, N):
  ans += (N-1) // a

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
for a in range(1, n):
  cnt += ~-n//a
print(cnt)

Submission status: Accepted

Solution code:
n=int(input())
ans=0
for i in range(n-1):
  a=i+1
  ans+=(n-1)//a
print(ans)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    ans = 0
    for i in range(1,n):
        if n%i==0:
            ans+=n//i-1
        else:
            ans+=n//i
    print(ans)
main()

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
for i in range(1, n):
    cnt += (n-1)//i
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for a in range(1, N):
  ans += (N - 1) // a
print(ans)

Submission status: Accepted

Solution code:
# import sys
# import math #sqrt,gcd,pi
# import decimal
# import queue # queue
import bisect
# import heapq # priolity-queue
# from time import time
# from itertools import product,permutations,\
    # combinations,combinations_with_replacement
# 重複あり順列、順列、組み合わせ、重複あり組み合わせ
# import collections # deque
# from operator import itemgetter,mul
# from fractions import Fraction
# from functools import reduce

# mod = int(1e9+7)
mod = 998244353
INF = 1<<50

def readInt():
    return list(map(int,input().split()))

def main():
    n = int(input())
    ans = 0
    for i in range(1,n+1):
        ans += (n-1)//i
    print(ans)
    return

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

for a in range(1,N,1):
    ans = ans + (N-1)//a

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1, n):
  ans += (n - 1) // i
print(ans)

Submission status: Accepted

Solution code:
def resolve():
  N = int(input())
  count = 0

  for A in range(1, N):
    count += ((N-1)//A)
  print(count)

if __name__ == "__main__":
  resolve()

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())

if n == 1:
    print(0)
else:
    lis = [i for i in range(n+1)]
    for i in range(2, int(n**0.5) + 1):
        if lis[i] == i:
            lis[i] = i
            for j in range(i**2, n+1, i):
                if lis[j] == j:
                    lis[j] = i
#print(lis)
def bunkai(m):
    ans = []
    now = lis[m]
    cnt = 1
    for i in range(m):
        m = m//lis[m]
        if now == lis[m]:
            cnt += 1
        else:
            ans.append(cnt)
            cnt = 1
            now = lis[m]
        
        if m == 1:
            break
    return ans

ans = 1
for i in range(2,n):
    tmp = 1
    yaku = bunkai(i)
    for i in yaku:
        tmp *= (i +1)
    ans += tmp

print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())

cnt =0
for a in range(1,N):
    cnt += math.floor((N-1)/a)

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())

count = 0

for a in range(1, n):
    b = (n -1) // a
    count += b

print(count)

Submission status: Accepted

Solution code:
def main():
    N = int(input())

    answer = 0
    for A in range(1, N):
        answer = answer + (N - 1) // A

    print(answer)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for a in range(1, N):
	ans += (N - 1) // a
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
ans=0
for i in range(1,n+1):
    ans+=n//i
    if n%i==0:
        ans-=1
print(ans)

Submission status: Accepted

Solution code:
import sys
import math
 
input = sys.stdin.readline
 
N = int(input())
 
total = 0
for i in range(1, N):
    total += (N-1) // i
 
print(total)

Submission status: Accepted

Solution code:
N = int(input())
s = 0
for i in range(1, N):
  b = (N - 1) // i
  s += b
print(s)

Submission status: Accepted

Solution code:
import sys
readline=sys.stdin.readline

N=int(readline())
# 1～(N - 1)の約数を数える

ans = 0
for i in range(1, N):
  for j in range(i, N, i):
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
import math
import numpy as np
n = int(input())
li = np.zeros(n, dtype=np.int)
ans = 0
i = 1
while i < n:
    ans += (n-1)//i
    i += 1
print(ans)

Submission status: Accepted

Solution code:
import math
N=int(input())

ans=0
for i in range(1,N):
    ans+=(N-1)//i
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
from operator import mul
from functools import reduce


def main():
    n = int(input())
    p = [1] * (n + 1)
    for i in range(2, n + 1):
        if p[i] != 1:
            continue
        for j in range(i, n + 1, i):
            if p[j] == 1:
                p[j] = i
    ans = 1
    for i in range(2, n):
        m = i
        k = defaultdict(int)
        while m > p[m]:
            k[p[m]] += 1
            m //= p[m]
        k[m] += 1
        ans += reduce(mul, [e + 1 for e in k.values()])
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

N, = map(int, input().split())
R = 0
for i in range(1, N+1):
    R += (N-1)//i
print(R)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0

for a in range(1, n):
    ans += (n - 1) // a

print(ans)

Submission status: Accepted

Solution code:
import sys
import math

input = sys.stdin.readline

N = int(input())

total = 0
for i in range(1, N):
    total += (N-1) // i

print(total)

Submission status: Accepted

Solution code:
from sys import stdin
readline = stdin.readline
def i_input(): return int(readline().rstrip())
def i_map(): return map(int, readline().rstrip().split())
def i_list(): return list(i_map())


def main():
    N = i_input()
    ans = 0
    for a in range(1, N):
        ans += (N - 1) // a
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
ans=0
for i in range(1,n):
  ans+=(n-1)//i
print(ans)

Submission status: Accepted

Solution code:
from __future__ import division, print_function
# https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py
import os
import sys
from difflib import SequenceMatcher
# seqMatch = SequenceMatcher(None,str1,str2) 
 #  # find match of longest sub-string 
    #  # output will be like Match(a=0, b=0, size=5) 
    #  match = seqMatch.find_longest_match(0, len(str1), 0, len(str2))
from io import BytesIO, IOBase
from collections import Counter,deque
from heapq import heapify,heappush,heappop
from math import gcd,ceil,sqrt,log2,log
from itertools import accumulate,repeat,permutations,compress

from operator import itemgetter
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def rl():
    return list(map(int,input().split()))
def arp(arr):
    return ' '.join([str(i) for i in arr])
    

################################

n = int(input())
ans = 0 
for i in range(1, n): 
    if n%i == 0:
        ans += n//i-1
    else:
        ans += n//i
print(ans)






















































































































###################################################################################
# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    ans = 0
    for i in range(1, n):
        ans += (n - 1) // i
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

N=int(input())

count=0
for i in range(1,N):
    for j in range(1,(N-1)//i+1):
        count+=1
        
print(count)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for a in range(1, N):
  ans += (N - 1) // a 
print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = 0
for a in range(1,N):
    ans = ans + math.floor((N - 1)/a)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
s = 0
for a in range(1, N):
  s += (N-1)//a
print(s)

Submission status: Accepted

Solution code:
N=int(input())
ans = 0
for i in range(1,N):
    ans += (N-1)//i
print(ans)

Submission status: Accepted

Solution code:
# 解説AC
N = int(input())

ans = 0
for a in range(1, N):
    ans += (N - 1) // a

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for a in range(1, N):
    ans += (N-1)//a
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
print(sum((n-1)//a for a in range(1,n)))

Submission status: Accepted

Solution code:
n = int(input())
ans  = 0 
for  a in range(1, n):
        ans += (n-1) // a
print(ans)

Submission status: Accepted

Solution code:

N=int(input())

ans=0
for a in range(1,N):
    ans+=int((N-1)//a)

print(ans)