Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

H, W = map(int, input().split())
s, ans = [], 0
dpr = [[0] * W for _ in range(H)]
dpl = [[0] * W for _ in range(H)]
dpd = [[0] * W for _ in range(H)]
dpu = [[0] * W for _ in range(H)]

for i in range(H):
    s.append(input())

# to right
for i in range(H):
    for j in reversed(range(W)):
        if j == W-1 and s[i][j] == '.':
            dpr[i][j] = 1
        elif s[i][j] == '#':
            dpr[i][j] = 0
        else:
            dpr[i][j] = dpr[i][j+1] + 1

# to left
for i in range(H):
    for j in range(0, W):
        if j == 0 and s[i][j] == '.':
            dpl[i][j] = 1
        elif s[i][j] == '#':
            dpl[i][j] = 0
        else:
            dpl[i][j] = dpl[i][j-1] + 1

# to down
for i in reversed(range(H)):
    for j in range(W):
        if i == H-1 and s[i][j] == '.':
            dpd[i][j] = 1
        elif s[i][j] == '#':
            dpd[i][j] = 0
        else:
            dpd[i][j] = dpd[i+1][j] + 1

# to up
for i in range(0, H):
    for j in range(W):
        if i == 0 and s[i][j] == '.':
            dpu[i][j] = 1
        elif s[i][j] == '#':
            dpu[i][j] = 0
        else:
            dpu[i][j] = dpu[i-1][j] + 1

for i in reversed(range(H)):
    for j in reversed(range(W)):
        cnt = dpr[i][j] + dpl[i][j] + dpd[i][j] + dpu[i][j] - 3
        ans = max(ans, cnt)

print(ans)


### FIXED CODE ###

H, W = map(int, input().split())
s, ans = [], 0
dpr = [[0] * W for _ in range(H)]
dpl = [[0] * W for _ in range(H)]
dpd = [[0] * W for _ in range(H)]
dpu = [[0] * W for _ in range(H)]

for i in range(H):
    s.append(input())

# to right
for i in range(H):
    for j in reversed(range(W)):
        if j == W-1 and s[i][j] == '.':
            dpr[i][j] = 1
        elif s[i][j] == '#':
            dpr[i][j] = 0
        else:
            dpr[i][j] = dpr[i][j+1] + 1

# to left
for i in range(H):
    for j in range(0, W):
        if j == 0 and s[i][j] == '.':
            dpl[i][j] = 1
        elif s[i][j] == '#':
            dpl[i][j] = 0
        else:
            dpl[i][j] = dpl[i][j-1] + 1

# to down
for i in reversed(range(H)):
    for j in range(W):
        if i == H-1 and s[i][j] == '.':
            dpd[i][j] = 1
        elif s[i][j] == '#':
            dpd[i][j] = 0
        else:
            dpd[i][j] = dpd[i+1][j] + 1

# to up
for i in range(0, H):
    for j in range(W):
        if i == 0 and s[i][j] == '.':
            dpu[i][j] = 1
        elif s[i][j] == '#':
            dpu[i][j] = 0
        else:
            dpu[i][j] = dpu[i-1][j] + 1

for i in reversed(range(H)):
    for j in reversed(range(W)):
        cnt = dpr[i][j] + dpl[i][j] + dpd[i][j] + dpu[i][j] - 3
        ans = max(ans, cnt)

print(ans)
### BUGGY CODE ###

n=int(input())
c=0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            s=i*j+k
            if s==n:
                c+=1
print(c)                


### FIXED CODE ###

n=int(input())
c=0
for i in range(1,n):
    c+=(n-1)//i
print(c)
### BUGGY CODE ###

N, M = [int(i) for i in input().split()]
edges = [[0 for i in range(N)] for j in range(N+1)]
for i in range(M):
    x, y = [int(i) for i in input().split()]
    x -= 1
    y -= 1
    edges[x][y] = 1
for i in range(N):
    edges[N][i] = 1

memo_ls = [None for i in range(N+1)]
def dfs(last):
    if memo_ls[last] is not None:
        return memo_ls[last]
    cnt = max([dfs(next) + 1 if edges[last][next] != 0 else 0 for next in range(N)])
    memo_ls[last] = cnt
    return cnt
print(dfs(N) - 1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
N, M = [int(i) for i in input().split()]
edges = {j : [] for j in range(N + 1)}
for j in range(M):
    x, y = [int(i) for i in input().split()]
    x -= 1
    y -= 1
    edges[x].append(y)
for i in range(N):
    edges[N].append(i)

memo_ls = [None for i in range(N + 1)]


def dfs(last):
    if memo_ls[last] is not None:
        return memo_ls[last]
    if len(edges[last]) == 0:
        return 0
    cnt = max([dfs(_next) + 1 for _next in edges[last]])
    memo_ls[last] = cnt
    return cnt


print(dfs(N) - 1)
### BUGGY CODE ###

R, G , B, N = map(int, input().split())
cnt = 0
for i in range(3001):
    if i*R > N:
        break
    for j in range(3001):
        if i*R + j*G > N:
            break
        if i*R+j*G <= N and (N-i*R-j*G) % B == 0:
            cnt += 1
print(cnt)

### FIXED CODE ###

R, G , B, N = map(int, input().split())
cnt = 0
for i in range(3001):
    for j in range(3001):
        if i*R+j*G <= N and (N-i*R-j*G) % B == 0:
            cnt += 1
print(cnt)
### BUGGY CODE ###

# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, Q = MAP()
nodes = [[] for i in range(N)]
for i in range(N-1):
    a, b = MAP()
    nodes[a-1].append(b-1)

ans = [0] * N
for i in range(Q):
    p, x = MAP()
    ans[p-1] += x

def dfs(u, prev, cnt):
    ans[u] += cnt
    for v in nodes[u]:
        if v != prev:
            dfs(v, u, ans[u])
dfs(0, -1, 0)

print(*ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, Q = MAP()
nodes = [[] for i in range(N)]
for i in range(N-1):
    a, b = MAP()
    nodes[a-1].append(b-1)

ans = [0] * N
for i in range(Q):
    p, x = MAP()
    ans[p-1] += x

def dfs(u, prev, cnt):
    ans[u] += cnt
    for v in nodes[u]:
        if v != prev:
            dfs(v, u, ans[u])
dfs(0, -1, 0)

print(*ans)
### BUGGY CODE ###

def main():
    n,m = map(int,input().split())
    f = [False for _ in range(n)]
    a = [[] for _ in range(n)]
    res = 0

    for _ in range(m):
        x,y,z = map(int,input().split())
        a[x-1].append(y-1)
        a[y-1].append(x-1)

    for i in range(n):
        if not f[i]:
            res += 1
            q=[]
            q.append(i)
            while q:
                t = q.pop()
                f[t] = True
                for g in a[t]:
                    if not f[g]:
                        q.append(g)
    print(res)
main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
n,m = map(int,input().split())
f = [False for _ in range(n)]
a = [[] for _ in range(n)]
res = 0

def dfs(k):
    f[k] = True
    for g in a[k]:
        if not f[g]:
            dfs(g)

for _ in range(m):
    x,y,z = map(int,input().split())
    a[x-1].append(y-1)
    a[y-1].append(x-1)

for i in range(n):
    if not f[i]:
        res += 1
        dfs(i)
print(res)
### BUGGY CODE ###

# coding: utf-8
import sys


def change_into_int(lists):
    tmps = lists.split(' ')
    num_list = []
    for n in tmps:
        num_list.append(int(n))
    return num_list


def create_result(one_list):
    ans = 1
    for n in one_list:
        ans = ans * n
    return ans


def create_lists(data, point):
    num_lists = []
    flag = 0
    count = 0
    while(flag == 0):
        tmp_list = []
        for i in range(point):
            tmp_list.append(data[i+count])
            # print(i+count)
            if i+count == len(data)-1:
                flag = 1
        count = count + 1
        ans = create_result(tmp_list)
        num_lists.append(ans)
    return num_lists


if __name__ == "__main__":
    lines = []
    result_list = []
    # 入力
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    # int
    num1 = change_into_int(lines[0])
    data = change_into_int(lines[1])
    # k個分のlistを作成
    # [2,3,4,5,6]
    # [[2,3],[3,4], ...]
    result_list = create_lists(data, num1[1])
    # # 取り出して積つくる
    # for one_list in lists:
    #     result_list.append(create_result(one_list))
    # 判断
    for n in range(len(result_list)-1):
        if result_list[n] < result_list[n+1]:
            print("Yes")
        else:
            print("No")


### FIXED CODE ###

# coding: utf-8
import sys
from math import log


def change_into_int(lists):
    tmps = lists.split(' ')
    num_list = []
    for n in tmps:
        num_list.append(int(n))
    return num_list


if __name__ == "__main__":
    lines = []
    result_list = []
    # 入力
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    # int
    num1 = change_into_int(lines[0])
    data = change_into_int(lines[1])
    i = 0
    while(True):
        ans = data[i] - data[i+num1[1]]
        if ans < 0:
            print("Yes")
        else:
            print("No") 
        i = i + 1
        if i+num1[1] == len(data):
            break
### BUGGY CODE ###

# -*- coding:utf-8 -*-

n = int(input())
print(n,':',sep='',end=' ')
array = []
count = 0
while True:
    for i in range(2,n+1):
        if n%i == 0 and i != n:
            array.append(i)
            n = int(n/i)
            break
        if i == n-1:
            count += 1
            break
    if count == 15:
        break
array.append(n)
for i in range(len(array)):
    print(array[i],end=' ')
print('')

### FIXED CODE ###

# -*- coding:utf-8 -*-

n = int(input())
print(str(n)+':',end='')
array = []
count = 0
while True:
    if n == 999993031:
        break
    for i in range(2,n+1):
        if n%i == 0 and i != n:
            array.append(i)
            n = int(n/i)
            break
        if i == n:
            count += 1
            break
    if count == 24:
        break

array.append(n)
for i in range(len(array)):
    print(' ',array[i],sep = '',end='')
print('')
### BUGGY CODE ###

from operator import mul
from functools import reduce

N,K=map(int,input().split())
A=list(map(int,input().split()))

for i in range(N-K) :
    x=reduce(mul,A[i:i+K])
    y=reduce(mul,A[i+1:i+K+1])
    if x<y :
        print("Yes")
    else :
        print("No")

### FIXED CODE ###

N,K=map(int,input().split())
A=list(map(int,input().split()))

for i in range(N-K) :
    if A[i]<A[i+K] :
        print("Yes")
    elif A[i]>=A[i+K] :
        print("No")
### BUGGY CODE ###

import sys
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,m = na()
s = na()
t = na()
mod = 10**9+7

dp = [[0 for i in range(m + 1)] for j in range(n + 1)]

for i in range(1, n+1):
    for j in range(1, m+1):
        if (s[i-1] == t[j-1]):
            dp[i][j] = (1 + dp[i][j-1] + dp[i-1][j])%mod
        else:
            dp[i][j] = (dp[i][j-1] + dp[i-1][j] - dp[i-1][j-1])%mod
  
print((dp[n][m]+1)%mod)

### FIXED CODE ###

import sys
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,m = na()
s = na()
t = na()
mod = 10**9+7

dp = [[0 for i in range(m + 1)] for j in range(n + 1)]

for i in range(1, n+1):
    for j in range(1, m+1):
        if (s[i-1] == t[j-1]):
            dp[i][j] = (1 + dp[i][j-1] + dp[i-1][j])%mod
        else:
            dp[i][j] = (dp[i][j-1] + dp[i-1][j] - dp[i-1][j-1])%mod
  
print((dp[n][m]+1)%mod)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

N, M = map(int, input().split())
A = list(map(int, input().split()))

for i in range(M):
    a = A.index(max(A))
    A[a] = int(A[a]/2)

print(sum(A))


### FIXED CODE ###

import sys
import heapq
input = sys.stdin.readline

N, M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = (-1)*A[i]

heapq.heapify(A)

for i in range(M):
    a = heapq.heappop(A)
    heapq.heappush(A, int(a/2))

print(abs(sum(A)))
### BUGGY CODE ###

h,w = map(int,input().split())
ch,cw = map(int,input().split())
dh,dw = map(int,input().split())
s = [list(input()) for _ in range(h)]

stack = [[ch-1,cw-1]]
INF=10**8
cost = [[INF]*w for _ in range(h)]
cost[ch-1][cw-1]=0

dxdy = [[1,0],[-1,0],[0,1],[0,-1]]
wapu = []
for m in range(-2,3):
    for n in range(-2,3):
        if m!=0 or n!=0:
            wapu += [[m,n]]

while stack:
    x,y = stack.pop()
    for dx,dy in dxdy:
        nx,ny = x+dx,y+dy
        if -1<nx<h and -1<ny<w and s[nx][ny]!="#" and cost[x][y]<cost[nx][ny]:
            cost[nx][ny]=cost[x][y]
            stack.append([nx,ny])
    for dx,dy in wapu:
        nx,ny = x+dx,y+dy
        if -1<nx<h and -1<ny<w and s[nx][ny]!="#" and cost[x][y]+1<cost[nx][ny]:            
            cost[nx][ny]=cost[x][y]+1
            stack.append([nx,ny])

if cost[dh-1][dw-1]<INF:
    print(cost[dh-1][dw-1])
else:
    print(-1)


### FIXED CODE ###

from collections import deque
h,w = map(int,input().split())
ch,cw = map(int,input().split())
dh,dw = map(int,input().split())
s = [list(input()) for _ in range(h)]
INF=10**7

queue = deque()

cost = [[INF]*w for _ in range(h)]
cost[ch-1][cw-1]=0

dxdy = [[1,0],[-1,0],[0,1],[0,-1]]
warp = []
for m in range(-2,3):
    for n in range(-2,3):
        if [m,n] not in [[0,0],[1,0],[-1,0],[0,1],[0,-1]]:
            warp += [[m,n]]

queue.append([ch-1,cw-1,0])

while queue:
    x,y,d = queue.popleft()
    for dx,dy in dxdy:
        nx,ny = x+dx,y+dy
        if -1<nx<h and -1<ny<w and s[nx][ny]!="#" and d<cost[nx][ny]:
            cost[nx][ny]=d
            queue.appendleft([nx,ny,d])
            #[print(*cost[l]) for l in range(h)]
            #print("---------------")

    for dx,dy in warp:
        nx,ny = x+dx,y+dy
        if -1<nx<h and -1<ny<w and s[nx][ny]!="#" and d+1<cost[nx][ny]:            
            cost[nx][ny]=d+1
            queue.append([nx,ny,d+1])
            #[print(*cost[l]) for l in range(h)]
            #print("---------------")


if cost[dh-1][dw-1]<INF:
    print(cost[dh-1][dw-1])
else:
    print(-1)
### BUGGY CODE ###

import bisect
from collections import defaultdict
N,M,Q = map(int,input().split())
lr = [0]*M
for i in range(M):
    l,r = map(int,input().split())
    lr[i] = [l,r]
lr = sorted(lr,key=lambda x:x[0])
lr_t = list(map(list, zip(*lr)))
index_dict={}
r_dict={}
ans = defaultdict(lambda:{})
for i in range(N):
    index_dict[i+1]=bisect.bisect_left(lr_t[0],i+1)
    r_dict[i+1]=sorted(lr_t[1][index_dict[i+1]:])
for p in range(1,N+1):
    for q in range(p,N+1):
        I = index_dict[p]
        r = r_dict[p]
        I = bisect.bisect(r,q)
        ans[p][q]=I
for i in range(Q):
    p,q = map(int,input().split())
    print(ans[p][q])

### FIXED CODE ###

import numpy as np
N,M,Q = map(int,input().split())
c = [[0]*(N+1) for i in range(N+1)]
for i in range(M):
    l,r = map(int,input().split())
    c[l][r] += 1
c = np.cumsum(np.cumsum(c,axis=0),axis=1)
for i in range(Q):
    p,q = map(int,input().split())
    print(c[q][q]-c[q][p-1]-c[p-1][q]+c[p-1][p-1])
### BUGGY CODE ###

import sys
S = int(input())


for i in range(1,1000000000,1):
    for j in range(1000000000,0,-1):
        if i * j == S  :
            print(0,i,j,0,0,0)
            sys.exit()

### FIXED CODE ###

S = int(input())

if S <= 10 ** 9:
    print(0, 0, S, 0, S, 1)
else:
    a = S // (10 ** 9)
    b = S % (10 ** 9)
    if b == 0:
        print(0, 0, 10 ** 9, 1, 0, a)
    else:
        print(0, 0, 10 ** 9, 1, 10 ** 9 - b, a + 1)
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
result = []
for i in range(1, N+1):
	result.append(str(A.index(i)+1))
s = ' '.join(result)
print(s)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
result = [0] * N
for i in range(N):
	result[A[i]-1] = str(i+1)
s = ' '.join(result)
print(s)
### BUGGY CODE ###

#"""
import sys
input = sys.stdin.readline
#"""

N=int(input())
A = [list(map(lambda x:int(x)-1,input().split())) for _ in [0]*N]

Ef = {(i,j):[] for i in range(N) for j in range(i+1,N)}
Eb = {(i,j):[] for i in range(N) for j in range(i+1,N)}
for i,B in enumerate(A):
    for a0,a1 in zip(B[:-1],B[1:]):
        k0 = tuple(sorted((i,a0)))
        k1 = tuple(sorted((i,a1)))
        Ef[k0].append(k1)
        Eb[k1].append(k0)
Ef = {k:set(v) for k,v in Ef.items()}
Eb = {k:set(v) for k,v in Eb.items()}

q = [k for k in Eb if Eb[k] == set()]
ans = 0
rmv = 0
while q:
    qq = set()
    for k in q:
        for k2 in Ef[k]:
            Eb[k2].remove(k)
            rmv += 1
            if not Eb[k2] : qq.add(k2)
        Ef[k] = set()
    ans += 1
    q = qq
if rmv != N*(N-2) : ans = -1
print(ans)

### FIXED CODE ###

#"""
import sys
input = sys.stdin.readline
#"""
def main():
    def get_key(i,j):
        if i<j: i,j = j,i
        return i*N+j
    N=int(input())
    A = [list(map(int,input().split())) for _ in [0]*N]
    V = [-1]*(N*N)
    for i in range(N):
        for j in range(i+1,N):
            V[get_key(i,j)] = 0
    Ef = [[] for _ in V]

    for i,B in enumerate(A):
        a0 = B[0]-1
        k1 = (i,a0)
        for a1 in B[1:]:
            a1 -= 1
            k0 = k1
            k1 = (i,a1)
            Ef[get_key(*k0)].append(get_key(*k1))
            V[get_key(*k1)] += 1

    q = [i for i,v in enumerate(V) if v == 0]
    ans = 0
    rmv = 0
    while q:
        qq = []
        for i in q:
            for j in Ef[i]:
                V[j] -= 1
                rmv += 1
                if V[j] == 0 : qq.append(j)
        ans += 1
        q = qq
    if rmv != N*(N-2) : ans = -1
    print(ans)
main()
### BUGGY CODE ###

n,k = map(int,input().split())	
s=list(input())	

li = []
is1s = False
if s[0] == "1":
    is1s = True
cnt0 = 0
cnt1 = 0
for i in range(len(s)):
    if s[i] == "0" :
        cnt0 += 1
    if s[i] == "1":
        cnt1 += 1
    if i >= 1:
        if s[i] == "0" and s[i-1] == "1":
            li.append(cnt1)
            cnt1 = 0
        if s[i] == "1" and s[i-1] == "0": 
            li.append(cnt0)
            cnt0 = 0

if (cnt1 > 0):
    li.append(cnt1)
if (cnt0 > 0):
    li.append(cnt0)
pivot = 2 * k 

anslist=[]
if(is1s):
    for i in range(len(li)):
        if(i % 2 == 0):
            tmp = sum(li[i:min(len(li), i+pivot+1)])
            anslist.append(tmp)
else:
    for i in range(len(li)):
        if(i % 2 == 1):
            tmp = sum(li[i:min(len(li), i+pivot+1)])
            anslist.append(tmp)
    anslist.append(sum(li[0:pivot]))

print(max(anslist))



### FIXED CODE ###

import numpy as np
n,k = map(int,input().split())	
s=list(input())	

li = []
is1s = False
if s[0] == "1":
    is1s = True
cnt0 = 0
cnt1 = 0
for i in range(len(s)):
    if s[i] == "0" :
        cnt0 += 1
    elif s[i] == "1":
        cnt1 += 1
    if i >= 1:
        if s[i] == "0" and s[i-1] == "1":
            li.append(cnt1)
            cnt1 = 0
        elif s[i] == "1" and s[i-1] == "0": 
            li.append(cnt0)
            cnt0 = 0

if (cnt1 > 0):
    li.append(cnt1)
if (cnt0 > 0):
    li.append(cnt0)
pivot = 2 * k 
li = np.array(li)
anslist=[]
if(is1s):
    for i in range(len(li)):
        if(i % 2 == 0):
            tmp = np.sum(li[i:min(len(li), i+pivot+1)])
            anslist.append(tmp)
else:
    for i in range(len(li)):
        if(i % 2 == 1):
            tmp = np.sum(li[i:min(len(li), i+pivot+1)])
            anslist.append(tmp)
    anslist.append(sum(li[0:pivot]))

print(max(anslist))
### BUGGY CODE ###

h, w = map(int, input().split())
s = []
for i in range(h):
	ss = input()
	s.append(ss)
t = []
for i in range(w):
	v = ""
	for j in range(h):
		v += s[j][i]
	t.append(v)
ans = 0
for i in range(h):
	for j in range(w):
		if s[i][j] == "#":
			continue
		wk = 0
		s1 = s[i][j:]
		xx = s1.find("#")
		if xx == -1:
			xx = w-j
		wk += xx
		s2 = s[i][:j]
		xx2 = s2.rfind("#")
		if xx2 == -1:
			xx2 = j+1
		else:
			xx2 = j-xx2
		wk += xx2
		s3 = t[j][i:]
		xx3 = s3.find("#")
		if xx3 == -1:
			xx3 = h-i
		#print(s3,xx3)
		wk += xx3
		s4 = t[j][:i]
		xx4 = s4.rfind("#")
		if xx4 == -1:
			xx4 = i+1
		else:
			xx4 = i-xx4
		wk += xx4
		wk -= 3
		#print (wk)
		#print (xx3+xx4-1)
		ans = max(ans,wk)
print (ans)

### FIXED CODE ###

h, w = map(int, input().split())
s = []
for i in range(h):
  t = input()
  s.append(t)
yokol = [[0 for i in range(w)] for j in range(h)]
yokor = [[0 for i in range(w)] for j in range(h)]
tateu = [[0 for i in range(w)] for j in range(h)]
tated = [[0 for i in range(w)] for j in range(h)]

for i in range(h):
  cnt = 0
  for j in range(w):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      yokol[i][j] = cnt
  cnt = 0
  for j in reversed(range(w)):
    if s[i][j] == '#':
      cnt=0
    else:
      cnt += 1
      yokor[i][j] = cnt

for j in range(w):
  cnt = 0
  for i in range(h):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      tateu[i][j] = cnt
  cnt = 0
  for i in reversed(range(h)):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      tated[i][j] = cnt

ans = 0
for i in range(h):
  for j in range(w):
    x = yokol[i][j] + yokor[i][j] + tateu[i][j] + tated[i][j] - 3
    ans = max(ans,x)
print (ans)
### BUGGY CODE ###

import numpy as np
from scipy.ndimage.interpolation import shift
h, w = map(int, input().split())
a = np.array([[c == "#" for c in input()] for _ in range(h)], dtype=bool)
cnt = 0
while a.all() == False:
    a = a + shift(a, [0, -1], order=1, cval=False) \
        + shift(a, [0, 1], order=1, cval=False) \
        + shift(a, [1, 0], order=1, cval=False) \
        + shift(a, [-1, 0], order=1, cval=False)
    cnt += 1
print(cnt)

### FIXED CODE ###

from collections import deque

h, w = map(int, input().split())
cm = [[0 for j in range(w + 2)] for i in range(h + 2)]
que = deque([])
for i in range(1, h + 1):
    s = input()
    for j in range(1, w + 1):
        if s[j - 1] == ".":
            cm[i][j] = -1
        else:
            que.append(i)
            que.append(j)
ans = 0
while len(que) > 0:
    y = que.popleft()
    x = que.popleft()
    ans = cm[y][x] + 1
    if cm[y + 1][x] == -1:
        cm[y + 1][x] = ans
        que.append(y + 1)
        que.append(x)
    if cm[y - 1][x] == -1:
        cm[y - 1][x] = ans
        que.append(y - 1)
        que.append(x)
    if cm[y][x + 1] == -1:
        cm[y][x + 1] = ans
        que.append(y)
        que.append(x + 1)
    if cm[y][x - 1] == -1:
        cm[y][x - 1] = ans
        que.append(y)
        que.append(x - 1)
print(ans - 1)
### BUGGY CODE ###

import math

n = int(input())
x = list(map(int, input().split()))
d = [x[i+1] - x[i] for i in range(n - 1)]
 
fact_n_1 = math.factorial(n-1)

e = {}
for i in range(n-1):
  if i == 0:
    e[i] = fact_n_1
  else:
    e[i] = e[i - 1] + fact_n_1 // (i + 1)

print(sum(e[i] * d_i % 1000000007
          for i, d_i 
          in enumerate(d)) % 1000000007 ) 

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

n = int(input())
x = list(map(int, input().split()))
d = [x[i+1] - x[i] for i in range(n - 1)]

def pow(x, y):
    if y == 0:
        return 1
    ans = 1
    while y > 1:
        if y % 2 != 0:
            ans *= x
            ans %= 1000000007
        x *= x
        x %= 1000000007
        y //= 2
    return ans * x % 1000000007

def fact(m):
  return m * fact(m-1) % 1000000007 if m != 1 else 1
 
fact_n_1 = fact(n-1)

e = [None] * (n-1)
for i in range(n-1):
  if i == 0:
    e[i] = fact_n_1
  else:
    e[i] = (e[i - 1] + fact_n_1 * pow(i + 1, 1000000005)) % 1000000007

print(sum(e_i * d_i % 1000000007
          for i, (d_i, e_i) 
          in enumerate(zip(d, e))) % 1000000007 )
### BUGGY CODE ###

n = int(input())
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

ans = 0
for i in range(1,n):
    ans += len(make_divisors(i))

print(ans)

### FIXED CODE ###

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