Harryxun/stf_run huggingface dataset:
import math

N = int(input())

# 割れるだけ割る
KMAX = math.floor(math.sqrt(N)) + 1

Kn = [N]  # N の約数であるような K
Kn1 = [N-1]  # N - 1 の約数であるような K

# N の約数であるような K (Kn)を求める
for K in range(2,KMAX):
    
    if N % K == 0:
        Kn.append(K)
        tmp = N//K
        if tmp == K:
            continue
        Kn.append(N//K)
        
Knn = []

# Kn のうち、割れるだけ割った(tN)あと、tN mod Kn == 1 であるような Kn
for K in Kn:
    tN = N
    while tN % K == 0:
        tN = tN // K  # K で割れなくなるまで割る
    
    if (tN - 1) % K == 0:
        Knn.append(K)
        
# N-1 の約数であるような K を求める
for K in range(2,KMAX):

    if (N - 1) % K == 0:
        Kn1.append(K)
        tmp = (N-1) // K
        if tmp == K:
            continue
        Kn1.append(tmp)

Knn.extend(Kn1)
Knn.remove(1)
print(len(Knn))

### FIXED CODE ###

import math

N = int(input())

# 割れるだけ割る
KMAX = math.floor(math.sqrt(N)) + 1

Kn = [N]  # N の約数であるような K
Kn1 = [N-1]  # N - 1 の約数であるような K

# N の約数であるような K (Kn)を求める
for K in range(2,KMAX):
    
    if N % K == 0:
        Kn.append(K)
        tmp = N//K
        if tmp == K:
            continue
        Kn.append(N//K)
        
Knn = []

# Kn のうち、割れるだけ割った(tN)あと、tN mod Kn == 1 であるような Kn
for K in Kn:
    tN = N
    while tN % K == 0:
        tN = tN // K  # K で割れなくなるまで割る
    
    if (tN - 1) % K == 0:
        Knn.append(K)
        
# N-1 の約数であるような K を求める
for K in range(2,KMAX):

    if (N - 1) % K == 0:
        Kn1.append(K)
        tmp = (N-1) // K
        if tmp == K:
            continue
        Kn1.append(tmp)

Knn.extend(Kn1)
if 1 in Knn:
    Knn.remove(1)
print(len(Knn))
n = int(input())
v = [int(i) for i in input().split()] 

from statistics import mode
if len(set(v))  == 1:
    print(int(len(v) / 2))
else:
    print(len(v[0::2]) - collections.Counter(v[0::2]).most_common()[0][1] + len(v[1::2]) - collections.Counter(v[1::2]).most_common()[0][1])

### FIXED CODE ###

n = int(input())
v = [int(i) for i in input().split()] 
import collections
if len(set(v))  == 1:
    print(int(len(v) / 2))
else:
    a = collections.Counter(v[0::2]).most_common()
    b = collections.Counter(v[1::2]).most_common() 
    if a[0][0] == b[0][0]:
        print(min((len(v[0::2]) - a[1][1] + len(v[1::2]) - b[0][1]),(len(v[0::2]) - a[0][1] + len(v[1::2]) - b[1][1])))
    else:
        print(len(v[0::2]) - a[0][1] + len(v[1::2]) - b[0][1])
n=int(input())
print(a*(1+a+a*a))

### FIXED CODE ###

n=int(input())
p = n +n*n+n*n*n
print(p)
def solve(N, W, weight_values):
  dp = [[0 for _ in range(W + 1)] for _ in range(N + 1)]
  dp[0][0] = 1

  for i in range(N + 1):
    i_weight, i_value = weight_values[i - 1]
    for w in range(i_weight, W + 1):
      dp[i][w] = max(dp[i - 1][w - i_weight] + i_value, dp[i - 1][w])

  print(dp[N][W])

N, W = iln()
w_v = []
for i in range(N):
  w_v = iln()
  
solve(N, W, w_v)

### FIXED CODE ###

def solve(N, W, weight_values):
  dp = [0 for _ in range(W + 1)]

  for i in range(N):
    i_weight, i_value = weight_values[i]
    for w in range(W, i_weight - 1, -1):
      # dp[w] = max(dp[w - i_weight] + i_value, dp[w])
      temp = dp[w - i_weight] + i_value
      if temp > dp[w]:
        dp[w] = temp

  print(dp[W])

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


N, W = iln()
w_v = []
for i in range(N):
  w_v.append(iln())
  
solve(N, W, w_v)
def solve():    
    n = int(input())
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))
    b = b[::-1]
    
    l = []
    num -= 1
    for i in range(n):
        if a[i] == b[i]:
            l.append(i)
            num = a[i]
    
    ind = 0
    for i in range(n):
        if b[i] != num and a[i] != num and ind < len(l):
            b[i], b[l[ind]] = b[l[ind]], b[i]
            ind += 1
    
    if ind < len(l):
        print('No')
    else:
        print('Yes')
        print(*b)
    
                        
if __name__ == "__main__":
    solve()
             

### FIXED CODE ###

def solve():    
    n = int(input())
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))
    b = b[::-1]
    
    l = []
    num = -1
    for i in range(n):
        if a[i] == b[i]:
            l.append(i)
            num = a[i]
    
    ind = 0
    for i in range(n):
        if b[i] != num and a[i] != num and ind < len(l):
            b[i], b[l[ind]] = b[l[ind]], b[i]
            ind += 1
    
    if ind < len(l):
        print('No')
    else:
        print('Yes')
        print(*b)
    
                        
if __name__ == "__main__":
    solve()
A, B, C, D, E, F = map(int, input().split())

water = []
for a in range(31):
    for b in range(31):
        if a * A + b * B <= F:
            water.append(a * A + b * B)
water = list(set(water))
water.remove(0)

sugar = []

for c in range(3001):
    for d in range(3001):
        if c * C + d * D <= F:
            sugar.append(c * C + d * D)
sugar = list(set(sugar))
sugar.remove(0)

memo = []
for w in water:
    for s in sugar:
        if w + s <= F and s/w <= E/100:
            memo.append([s/(s+a),w+s, s])
memo.sort(reverse=True)
print(memo[0][1], memo[0][2])

### FIXED CODE ###

A, B, C, D, E, F = map(int, input().split())
ans = []
water = []
for i in range(31):
    for j in range(31):
        tmp = 100*i*A + 100*j*B
        if tmp <= F:
            water.append(tmp)
water = list(set(water))
water.remove(0)

sugar = []
for i in range(101):
    for j in range(101):
        tmp = i*C + j*D
        if tmp <= F:
            sugar.append(tmp)
sugar = list(set(sugar))
sugar.remove(0)

            
for miz in water:
    for sato in sugar:
        if miz + sato <= F and sato / (miz + sato) <= E / (100 + E):
            ans.append([miz, sato, sato / (miz + sato)])
            
if ans:
    ans.sort(key=lambda x:x[2], reverse = True)
    print(ans[0][0]+ans[0][1], ans[0][1])
else:
    print(water[0], 0)
from collections import Counter

N = int(input())

edges = {i:[] for i in range(1, N+1)}
for _ in range(N-1):
    a, b = map(int, input().split())
    edges[a].append(b)
    edges[b].append(a)

vertice = [0 for _ in range(N+1)]

def dfs(v, color_i):
    vertice[v] = color_i
    for i in edges[v]:
        if vertice[i] == 0:
            dfs(i, color_i*(-1))

dfs(1, 1)

c = Counter(vertice)
ans = []
if c[1] > N/3 and c[2] > N/3:
    nums1 = [i for i in range(1, N+1) if i % 3 == 1]
    nums2 = [i for i in range(1, N+1) if i % 3 == 2]
    nums3 = [i for i in range(1, N+1) if i % 3 == 0]
    for v in vertice[1:]:
        if v == 1:
            if num1:
                ans.append(str(num1.pop()))
            else:
                ans.append(str(num3.pop()))
        else:
            if num2:
                ans.append(str(num2.pop()))
            else:
                ans.append(str(num3.pop()))
elif c[1] <= N/3:
    num_not_3 = [i for i in range(1, N+1) if i % 3 != 0]
    num3 = [i for i in range(1, N+1) if i % 3 == 0]
    for v in vertice[1:]:
        if v == 1:
            if num3:
                ans.append(str(num3.pop()))
            else:
                ans.append(str(num_not_3.pop()))
        else:
            ans.append(str(num_not_3.pop()))
else:
    num_not_3 = [i for i in range(1, N+1) if i % 3 != 0]
    num3 = [i for i in range(1, N+1) if i % 3 == 0]
    for v in vertice[1:]:
        if v == -1:
            if num3:
                ans.append(str(num3.pop()))
            else:
                ans.append(str(num_not_3.pop()))
        else:
            ans.append(str(num_not_3.pop()))

print("".join(ans))


### FIXED CODE ###

n = int(input())
edge = [[] for _ in range(n)]
for _ in range(n-1):
  a, b = map(int, input().split())
  edge[a-1].append(b-1)
  edge[b-1].append(a-1)
 
group = [False] * n
parent = list(range(n))
stack = [0]
while stack:
  v = stack.pop()
  while edge[v]:
    u = edge[v].pop()
    if parent[v] != u:
      group[u] = not group[v]
      parent[u] = v
      stack.append(u)
 
three = 3
p = [0] * n
if group.count(False) <= n // 3:
  other = 1
  for i in range(n):
    if group[i] and other <= n:
      p[i] = other
      other += other % 3
    else:
      p[i] = three
      three += 3
elif group.count(True) <= n // 3:
  other = 1
  for i in range(n):
    if not group[i] and other <= n:
      p[i] = other
      other += other % 3
    else:
      p[i] = three
      three += 3
else:
  one, two = 1, 2
  for i in range(n):
    if group[i] and one <= n:
      p[i] = one
      one += 3
    elif not group[i] and two <= n:
      p[i] = two
      two += 3
    else:
      p[i] = three
      three += 3
print(' '.join(map(str, p)))
n,m,q = map(int,input().split())
a = [[int(i) for i in input().split()] for _ in range(q)]
b = []
for i in range(m):
    b.append(i+1)
import itertools
l = list(itertools.combinations_with_replacement(b,n))
max=0
from math import factorial
c = factorial(m) / factorial(n) / factorial(m - n)
#print(l)                                                                      

#for _ in range(int(c)):                                                       
for ll in l:
    m=0
#    print(ll)                                                                 
    for aa in a:
#        print(ll[aa[1]-1],ll[aa[0]-1],aa[2])                                  
        if ll[aa[1]-1]-ll[aa[0]-1]==aa[2]:
 #           print(aa[3])                                                      
            m+=aa[3]
    if max < m:
        max=m
  #  print(m,max)                                                              
print(max)

### FIXED CODE ###

n,m,q = map(int,input().split())
a = [[int(i) for i in input().split()] for _ in range(q)]
b = []
for i in range(m):
    b.append(i+1)
import itertools
l = list(itertools.combinations_with_replacement(b,n))
max=0
#print(l)                                                                      
for ll in l:
    m=0
    for aa in a:
        if ll[aa[1]-1]-ll[aa[0]-1]==aa[2]:
            m+=aa[3]
    if max < m:
        max=m
print(max)
n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
temp = []
for i in range(n):
  temp.append(a-(t-H[i]*0.006))
print(min(abs(temp)))

### FIXED CODE ###

n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
temp = []
for i in range(n):
  temp.append(a-(t-H[i]*0.006))
temp_abs = [abs(j) for j in temp]
mini_temp_abs = min(temp_abs)
for k in range(n):
  if temp_abs[k] == mini_temp_abs:
    print(k+1)
n,q = map(int,input().split())
s = input()
m = list(map(int,input().split for i in range(q)))
count = [0]*(N+1)

for i in range(n):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]

for l,r in list:
    print(count[r-1]-count[l-1])
~


### FIXED CODE ###

n,q = map(int,input().split())
s = input()
m = [list(map(int,input().split())) for i in range(q)]
count = [0]*(n+1)
 
for i in range(n):
    if s[i:i+2] == 'AC':
        count[i+1] = count[i] + 1
    else:
        count[i+1] = count[i]
 
for l,r in m:
    print(count[r-1]-count[l-1])
a, b = map(int, input().split())
print("Yes" if input()[a] == "-" and input().count("-") == 1 else "No")

### FIXED CODE ###

a, b = map(int, input().split())
s = input()
print("Yes" if s.count("-") == 1 and s[a] == "-" else "No")
import collections


def main():
    _ = int(input())
    A = list(map(int, input().split()))

    A.sort()

    sames = 0
    C = collections.Counter(A)
    for v in C.values():
        if v > 1:
            sames += 1

    a_max = A[-1]
    dp = [True] * a_max
    A = set(A)

    if dp[a - 1]:
         tmp_a = a * 2
         while tmp_a < a_max + 1:
             dp[tmp_a - 1] = False
             tmp_a += a

    r = 0
    for a in A:
        if dp[a - 1]:
            r += 1

    print(r - sames)


if __name__ == '__main__':
    main()

### FIXED CODE ###

# import collections


def main():
    _ = int(input())
    A = list(map(int, input().split()))

    A.sort()

    # sames = 0
    # C = collections.Counter(A)
    # for v in C.values():
    #     if v > 1:
    #         sames += 1

    a_max = A[-1]
    dp = [0] * (a_max + 1)
    # dp = [True] * a_max
    # A = set(A)

    for a in A:
        if dp[a] != 0:
            dp[a] = 2
            continue

        i = a
        while i < a_max + 1:
            dp[i] += 1
            i += a

    r = 0
    for a in A:
        if dp[a] == 1:
            r += 1

    print(r)

    #     if dp[a - 1]:
    #         tmp_a = a * 2
    #         while tmp_a < a_max + 1:
    #             dp[tmp_a - 1] = False
    #             tmp_a += a

    # r = 0
    # for a in A:
    #     if dp[a - 1]:
    #         r += 1

    # print(r - sames)


if __name__ == '__main__':
    main()
h, a = map(int, input().split)

if h%a == 0:
  print(h/a)
else:
  print((int)(h/a)+1)

### FIXED CODE ###

h, a = map(int, input().split())

if h%a == 0:
  print((int)(h/a))
else:
  print((int)(h/a)+1)
import heapq as hq


n = int(input())
nodes = []
done = [0 for _ in range(n)]
par = {}
for _ in range(n):
    x, y = map(int,input().split())
    nodes.append((x,y))
    par[(x,y)]=(x,y)
nodesx = sorted(nodes)
nodesy = sorted(nodes,key=lambda z:z[1])
s = []

for i in range(n-1):
    xcost =nodesx[i+1][0]-nodesx[i][0]
    ycost =nodesy[i+1][1]-nodesy[i][1]
    hq.heappush(s,(xcost,(nodesx[i+1],nodesx[i])))
    hq.heappush(s,(ycost,(nodesy[i+1],nodesy[i])))
def root(node,par):
    if node == par[node]:
        return node
    else:
        par[node] =root(par[node],par)
        return par[node]
def unite(node1,node2,par):
    par[root(node1,par)] = root(node2,par)
ans = 0
count =0
while count < n-1 :
    cost,(node1,node2) = hq.heappop(s)
    if root(node1,par) != root(node2,par):
        unite(node1,node2,par)
        ans +=cost
        count += 1
print(ans)

### FIXED CODE ###

from collections import deque
import sys
 
sys.setrecursionlimit(2000000000)
 
n = int(input())
nodes = []
done = [0 for _ in range(n)]
par = {}
for _ in range(n):
    x, y = map(int,input().split())
    nodes.append((x,y))
    par[(x,y)]=(x,y)
nodesx = sorted(nodes)
nodesy = sorted(nodes,key=lambda z:z[1])
s = []
m = len(set(nodes))
for i in range(n-1):
    xcost =nodesx[i+1][0]-nodesx[i][0]
    ycost =nodesy[i+1][1]-nodesy[i][1]
    s.append((xcost,(nodesx[i+1],nodesx[i])))
    s.append((ycost,(nodesy[i+1],nodesy[i])))
s.sort()
s = deque(s)
def root(node,par):
    if node == par[node]:
        return node
    else:
        par[node] =root(par[node],par)
        return par[node]
def unite(node1,node2,par):
    par[root(node1,par)] = root(node2,par)
ans = 0
count =0
while count < m-1 :
    cost,(node1,node2) = s.popleft()
    root1 =root(node1,par)
    root2 =root(node2,par)
    if root1 != root2:
        unite(node1,node2,par)
        ans +=cost
        count += 1
print(ans)
import sys
for i in sys.stdin:
    a, b, c, d, e, f = map(int, i.split())
    x = (c * e - b * f) / (a * e - b * d)
    y = (c * d - a * f) / (b * d - a * e)
    x = abs(x) if x < 10e-4 else x
    y = abs(y) if y < 10e-4 else y
    print("{:.3f} {:.3f}".format(round(x,3), rount(y,3)))


### FIXED CODE ###

import sys
for i in sys.stdin:
    a, b, c, d, e, f = map(int, i.split())
    x = (c * e - b * f) / (a * e - b * d)
    y = (c * d - a * f) / (b * d - a * e)
    x = abs(x) if abs(x) < 10e-4 else x
    y = abs(y) if abs(y) < 10e-4 else y
    print("{:.3f} {:.3f}".format(x, y))
import math
num = int(input().replace(' ', ''))

if math.sqrt(num).is_interger() == False:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import math
num = int(input().replace(' ', ''))

if math.sqrt(num).is_integer() == False:
  print("No")
else:
  print("Yes")
K = int(input())

if K == 1:
  print("ACL"):
elif K == 2:
  print("ACLACL"):
elif K == 3:
  print("ACLACLACL"):
elif K == 4:
  print("ACLACLACLACL"):
else:
  print("ACLACLACLACLACL"):

### FIXED CODE ###

K = int(input())

if K == 1:
    print("ACL")
elif K == 2:
    print("ACLACL")
elif K == 3:
    print("ACLACLACL")
elif K == 4:
    print("ACLACLACLACL")
else:
    print("ACLACLACLACLACL")
n = int(input())
num = [list(map(int, input())) for _ in range(n)]
Sort_num = sorted(num)
for i in range(n):
  if num[i] == Sort_num[i-1]:
    print(Sort_num[i-2]
  else:
    print(Sort_num[i-1])

### FIXED CODE ###

n = int(input())
num = [int(input()) for _ in range(n)]
Sort_num = sorted(num)
for i in range(n):
  if num[i] == Sort_num[n-1]:
    print(Sort_num[n-2])
  else:
    print(Sort_num[n-1])
p_100 = n // 100
tmp = n % 100
p_10 = tmp // 10
p_1 = tmp % 10
if p_100 == p_10:
    if p_10 == p_1:
        print(str(p_1) * 3)
    elif p_10 <= p_1:
        print(str(p_10+1) * 3)
    elif p_10 >= p_1:
        print(str(p_10) * 3)
elif p_100 <= p_10:
    print(str(p_100+1) * 3)
elif p_100 >= p_10:
    print(str(p_100) * 3)

### FIXED CODE ###

n = int(input()) # 入力を受け付ける
match = 0

if 100 <= n and n <= 111:
    match = 111
elif 112 <= n and n <= 222:
    match = 222
elif 223 <= n and n <= 333:
    match = 333
elif 334 <= n and n <= 444:
    match = 444
elif 445 <= n and n <= 555:
    match = 555
elif 556 <= n and n <= 666:
    match = 666
elif 667 <= n and n <= 777:
    match = 777
elif 778 <= n and n <= 888:
    match = 888
elif 889 <= n and n <= 999:
    match = 999

print(match)
n = int(input())

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

ans = float('inf')

for i in range(1,101):
  ans_temp = 0
  for j in x:
    ans_temp += (x-i)**2
  ans = min(ans,ans_temp)
print(ans)

### FIXED CODE ###

n = int(input())

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

ans = float('inf')

for i in range(1,101):
  ans_temp = 0
  for j in x:
    ans_temp += (j-i)**2
  ans = min(ans,ans_temp)
print(ans)
import math

N = int(input())
i = 0
a,b = divmod(N, 26)
c = math.log(N, 26)
A = list(range(int(c)+1))

while(N!=0):
  c,d = divmod(N-1, 26)
  A[i] = chr(d+97)
  N = c
  i+=1

A.reverse()
#print(A)
print("".join(A))
 

### FIXED CODE ###

import math

N = int(input())
i = 0

#c = math.log(N-1, 26)
#A = list(range(int(c)+1))
A = []

while(N!=0):
  c,d = divmod(N-1, 26)
  A.append(chr(d+97))
  #A[i] = chr(d+97)
  N = c
  i+=1

A.reverse()
print("".join(A))
X, Y = map(int, input().split())
if X * Y >= 0:
    if X <= Y: print(Y-X)
    else: print(X-Y+2)
else: print(max(abs(Y)+abs(X))+1)

### FIXED CODE ###

X, Y = map(int, input().split())
if X * Y > 0:
    if X <= Y: print(Y-X)
    else: print(X-Y+2)
elif X == 0:
    print(Y if Y >= 0 else -Y+1)
elif Y == 0:
    print(-X if X <= 0 else X+1)
else:
    mi = abs(abs(Y)-abs(X))+1
    if X <= Y:
        mi = min(mi, Y-X)
    print(mi)
bimport math
n=int(input())
miti= list([map(int,input()) for i in range(5)])
print(4+math.ceil(n/min(miti)))


### FIXED CODE ###

import math
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
miti=[a,b,c,d,e]
mini=min(miti)
retu=math.ceil(n/mini)
print(4+retu)
print("Yes")
N, M = map(int, input().split())
path = [[] for _ in range(N)]
ind = [0 for _ in range(N)]
lis = set()
for o in range(N):
    lis.add(o)
for i in range(M):
    A, B = map(int, input().split())
    path[A-1].append(B-1)
    path[B-1].append(A-1)
que = path[0]
for p in que:
    lis.discard(p)
for l in que:
    U = lis & set(path[l])
    for m in U:
        ind[m] = l
        lis.discard(m)
    que = U
    if lis == {}:
        break
for z in range(1,N):
    ind[z] += 1
    print(ind[z])

### FIXED CODE ###

N = int(input())
H = [2,4,5,7,9]
P = [0,1,6,8]
B = [3]
if N%10 in H:
    print("hon")
if N%10 in P:
    print("pon")
if N%10 in B:
    print("bon")
N, Q=map(int, input().split())
tree=[[] for _ in range(N)]
for i in range(N-1):
  a,b=map(int, input().split())
  tree[a-1].append(b-1)
  tree[b-1].append(a-1)

add=[0]*N
for i in range(Q):
  p,x=map(int, input().split())
  add[p-1]+=x

ans=[0]*N
def dfs(start, pre, preval):
  addval=preval+add[start]
  ans[start]+=addval
  for next_node in tree[start]:
    if next_node==pre:
      continue
    dfs(next_node, start,addval)
dfs(0,-1,0)  
for a in ans:
  print(a, end=" ")

### FIXED CODE ###

from collections import deque 
N,Q=map(int, input().split())
G=[[] for _ in range(N)]
for i in range(N-1):
    a,b=map(int, input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)
X=[0]*N
for i in range(Q):
    p,x=map(int, input().split())
    X[p-1]+=x
que=deque([(0,-1)])
#print(que)
while que:
    now, pre=que.pop()
    for nex in G[now]:
        if nex==pre:
            continue
        else:
            X[nex]+=X[now]
            que.append((nex,now))

print(" ".join(map(str, X)))
n,a,b=int(input().strip().split())

if n*a>=b:
  print(b)
else:
  print(n*a)

### FIXED CODE ###

n,a,b=input().strip().split()
n,a,b=[int(n),int(a),int(b)]

if n*a>b:
  print(b)
else:
  print(n*a)
i=input()
print(count('1'))


### FIXED CODE ###

i=input()
print(i.count('1'))
n=int(input())
swi = "No"
for a in range(100)：
  if (n - 4＊a) % 7 == 0 and n - 4＊a >= 0:
    swi="Yes"
    break
print(swi)
    
    

### FIXED CODE ###

n = int(input())
swi = "No"
for a in range(100):
    if (n - 4*a) % 7 == 0 and n - 4*a >= 0:
        swi = "Yes"
        break
print(swi)
a,b,t=input().split()
print(math.factorial(t//a)*b)

### FIXED CODE ###

a,b,t=(int(x) for x in input().split())
print((t//a)*b)
H,W = map(int,input().split())

# make iremono
matrix = []

for i in range(H):
    matrix.append(list(input()))

#rows = sample_input.split("\n")
#matrix = [list(r) for r in rows]

ans = matrix.copy()

for h in range(H):
    for w in range(W):
        if matrix[h][w] != '#':
            ans[h][w] = str(check_nmine(h,w,matrix))
            
for i in ans:
    print("".join(i))
    
def check_nmine(h,w,matrix):
    count=0
    #h+1 -1 （いっぱい書く）
    if h-1 >= 0 and w-1 >= 0:
        if(matrix[h-1][w-1] == '#'):
            count += 1
    if h-1 >= 0 and w >= 0:
        if(matrix[h-1][w] == '#'):
            count += 1
    if h-1 >= 0 and w+1 < W:
        if(matrix[h-1][w+1] == '#'):
            count += 1
            
    if h >= 0 and w-1 >= 0:
        if(matrix[h][w-1] == '#'):
            count += 1
    if h >= 0 and w+1 < W:
        if(matrix[h][w+1] == '#'):
            count += 1
            
    if h+1 < H and w-1 >= 0:
        if(matrix[h+1][w-1] == '#'):
            count += 1
    if h+1 < H and w >= 0:
        if(matrix[h+1][w] == '#'):
            count += 1
    if h+1 < H and w+1 < W:
        if(matrix[h+1][w+1] == '#'):
            count += 1
            
    return count

### FIXED CODE ###

def check_nmine(h,w,matrix):
    count=0
    #h+1 -1 （いっぱい書く）
    if h-1 >= 0 and w-1 >= 0:
        if(matrix[h-1][w-1] == '#'):
            count += 1
    if h-1 >= 0 and w >= 0:
        if(matrix[h-1][w] == '#'):
            count += 1
    if h-1 >= 0 and w+1 < W:
        if(matrix[h-1][w+1] == '#'):
            count += 1
            
    if h >= 0 and w-1 >= 0:
        if(matrix[h][w-1] == '#'):
            count += 1
    if h >= 0 and w+1 < W:
        if(matrix[h][w+1] == '#'):
            count += 1
            
    if h+1 < H and w-1 >= 0:
        if(matrix[h+1][w-1] == '#'):
            count += 1
    if h+1 < H and w >= 0:
        if(matrix[h+1][w] == '#'):
            count += 1
    if h+1 < H and w+1 < W:
        if(matrix[h+1][w+1] == '#'):
            count += 1
            
    return count


H,W = map(int,input().split())



matrix = []
for i in range(H):
    matrix.append(list(input()))

for h in range(H):
    for w in range(W):
        if matrix[h][w] != '#':
            matrix[h][w] = str(check_nmine(h,w,matrix))
            
for i in matrix:
    print("".join(i))
A,B,K = map(int,input().split())

split_num = 1
split_num_list = []

for i in range(1,min(A,B)+1):
    if A % i == 0 and B % i == 0:
        split_num_list.append(i)
print(split_num_list[K])

### FIXED CODE ###

A,B,K = map(int,input().split())


split_num_list = []

for i in range(1,min(A,B)+1):
    if A % i == 0 and B % i == 0:
        split_num_list.append(i)
split_num_list.sort(reverse=True)
print(split_num_list[K-1])
N=int(input())
p=list(map(int,input().split()))

cnt=0
for i in range(N-1):
  if p[i]==i+1:
    p[i],p[i+1] = p[i+1],p[i]
    cnt+=1
if p[N-1]==N:
  p[N-1],p[N] = p[N],p[N-1]
  cnt+=1
  
print(cnt)


### FIXED CODE ###

N=int(input())
p=list(map(int,input().split()))

cnt=0
for i in range(N-1):
  if p[i]==i+1:
    p[i],p[i+1] = p[i+1],p[i]
    cnt+=1
if p[N-1]==N:
  p[N-2],p[N-1] = p[N-1],p[N-2]
  cnt+=1
  
print(cnt)