Harryxun/stf_run huggingface dataset:
import numpy as np
def main():
    n = int(input())
    ans = 0
    for i in range(1,n+1):
        #print(np.arange(i,n+1,i),np.arange(i,n,i).sum())
        ans += np.arange(i,n+1,i).sum()

    print(ans)
main()

### FIXED CODE ###

def main():
    n = int(input())
    ans = 0
    for i in range(1,n+1):
        #print(range(i,n+1,i),sum(range(i,n+1,i)))
        ans += sum(range(i,n+1,i))

    print(ans)
main()
import math

N = int(input())
D={}
T=list(map(int,input().split()))
for i in range(N):
    if D.get(T[i],None)==None:
        D[T[i]]=1
    else:
        D[T[i]]+=1

Max=max(D)
Min=min(D)
Len=len(D)
Item=sorted((D.items()))
if(Item[i][0]!=i):
    print("0")
    exit()
ans=1
for i in range(1,Len):
    ans = (ans * (Item[i-1][1]**Item[i][1])) % 998244353
    
print(ans)

### FIXED CODE ###

import math

N = int(input())
D={}
T=list(map(int,input().split()))
if(T[0]!=0):
        print("0")
        exit()

for i in range(N):
    if D.get(T[i],None)==None:
        D[T[i]]=1
    else:
        D[T[i]]+=1

Max=max(D)
Min=min(D)
Len=len(D)
Item=sorted((D.items()))
if(Item[0][1]!=1):
        print("0")
        exit()
for i in range(Len):
    if(Item[i][0]!=i):
        print("0")
        exit()
ans=1
for i in range(1,Len):
    ans = (ans * (Item[i-1][1]**Item[i][1])) % 998244353
    
print(ans)
import sys
import numpy as np
def main():
    input = sys.stdin.readline
    N = int(input())
    ans = (1 + (N - 1)) / 2 * (N - 1)

    a = np.arange(start=1, step=1, stop=N+1)
    bol = (N % a > a)
    #print(bol)
    #print(np.any(bol))
    if np.any(bol):
        ans += np.sum((N % a)[bol] - a)

    print(int(ans))

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import numpy as np
def main():
    input = sys.stdin.readline
    N = np.int64(input())
    #print(N)
    #ans = np.int64((1 + (N - 1)) / 2 * (N - 1))
    ans = (1 + (N - 1)) * (N - 1) // 2
    print(int(ans))
if __name__ == '__main__':
    main()
x1, y1, x2, y2 = map(int, input().split(' '))


xdif = abs(x1 - x2)
ydif = abs(y1 - y2)

if x1<=x2 and y1<=y2:
     x3 = x2 - ydif
     y3 = y2 + xdif
     x4 = x3 + xdif
     y4 = y3 - ydif
elif x1<=x2 and y1>=y2:
     x3 = x2 + ydif
     y3 = y2 + xdif
     x4 = x1 + xdif
     y4 = y1 + ydif
elif x1>=x2 and y1<=y2:
     x3 = x2 - ydif
     y3 = y2 - xdif
     x4 = x1 - ydif
     y4 = y1 - xdif
else:
     x3 = x2 + ydif
     y3 = y2 - xdif
     x4 = x1 + ydif
     y4 = y1 - xdif
     
print(x3, y3, x4, y4)


### FIXED CODE ###

asdf = int(input())
if asdf % 2 == 0:
  k1 = asdf / 2
  Ans = k1 * k1
else:
  k2 = (asdf + 1) / 2
  k3 = k2 - 1
  Ans = k2 * k3
print(int(Ans))
L=list(map(int,input().split()))
	print(sum(L)-max(L))

### FIXED CODE ###

L=list(map(int,input().split()))
print(sum(L)-max(L))
def ans_dp(H,W,M):
    dp = [[0 for i in range(W)] for j in range(H)]
    flag = [[0 for i in range(W)] for j in range(H)]
    if M[0][0] == "#":
        dp[0][0] = 1
        flag[0][0] = 1
    else:
        dp[0][0] == 0
    for i in range(1,W):
        if M[i][0] == "#":
            flag[i][0] = 1
            if flag[i-1][0] == 1:
                dp[i][0] = dp[i-1][0]
            else:
                dp[i][0] = dp[i-1][0] + 1 
        else:##M[0][i] = "."
            dp[i][0] = dp[i-1][0]
    for j in range(1,H):
        if M[0][j] == "#":
            flag[0][j] = 1
            if flag[0][j-1] == 1:
                dp[0][j] = dp[0][j-1]
            else:
                dp[0][j] = dp[0][j-1] + 1 
        else:##M[0][i] = "."
            dp[0][j] = dp[0][j-1]
    
    for i in range(1,W):
        for j in range(1,H):
            if M[i][j] == "#":
                flag[i][j] = 1
                if flag[i-1][j] == 1 or flag[i][j-1] == 1:
                    dp[i][j] = min(dp[i-1][j],dp[i][j-1])
                else:
                    dp[i][j] = min(dp[i-1][j],dp[i][j-1]) + 1
            else:#M[i][j] == "."
                dp[i][j] = min(dp[i-1][j],dp[i][j-1])
    """
    for i in range(H):
        print(dp[i])
    for i in range(H):
        print(flag[i])
    """
    return dp[-1][-1]

def main():
    H,W = map(int,input().split())
    M = []
    for i in range(H):
        M.append(list(input()))
    print(ans_dp(H,W,M))
 
if __name__ == "__main__":
    main()

### FIXED CODE ###

def ans_dp(H,W,M):
    dp = [[0 for i in range(W)] for j in range(H)]
    flag = [[0 for i in range(W)] for j in range(H)]
    if M[0][0] == "#":
        dp[0][0] = 1
        flag[0][0] = 1
    else:
        dp[0][0] == 0
    for i in range(1,W):
        if M[0][i] == "#":
            flag[0][i] = 1
            if flag[0][i-1] == 1:
                dp[0][i] = dp[0][i-1]
            else:
                dp[0][i] = dp[0][i-1] + 1 
        else:##M[0][i] = "."
            dp[0][i] = dp[0][i-1]
    for j in range(1,H):
        if M[j][0] == "#":
            flag[j][0] = 1
            if flag[j-1][0] == 1:
                dp[j][0] = dp[j-1][0]
            else:
                dp[j][0] = dp[j-1][0] + 1 
        else:##M[0][i] = "."
            dp[j][0] = dp[j-1][0]
    
    for i in range(1,H):
        for j in range(1,W):
            if M[i][j] == "#":
                flag[i][j] = 1
                dp[i][j] = min(dp[i-1][j]+int(not flag[i-1][j]),dp[i][j-1]+int(not flag[i][j-1]))
            else:#M[i][j] == "."
                dp[i][j] = min(dp[i-1][j],dp[i][j-1])
    """
    for i in range(H):
        print(dp[i])
    for i in range(H):
        print(flag[i])
    """
    return dp[H-1][W-1]

def main():
    H,W = map(int,input().split())
    M = []
    for i in range(H):
        M.append(list(input()))
    print(ans_dp(H,W,M))
 
if __name__ == "__main__":
    main()
import numpy as np
import math

X, Y = list(map(int, input().strip().split()))

mod = 10**9+7
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

if X>0 and Y>0 and (2*X - Y)%3 == 0 and (2*Y - X)% 3==0: 
    m = int((2*X - Y)/ 3)
    n = int((2*Y - X)/ 3)
    
    for i in range( 2, m+n + 1 ):
        g1.append( ( g1[-1] * i ) % mod )
        inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
        g2.append( (g2[-1] * inverse[-1]) % mod )
    
    
    ret = cmb(m+n, m, mod)
print(ret)

### FIXED CODE ###

X, Y = list(map(int, input().strip().split()))

mod = 10**9+7

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

if X>0 and Y>0 and (2*X - Y)%3 == 0 and (2*Y - X)% 3==0 and 2*Y >= X and Y <= 2*X: 
    m = int((2*X - Y)/ 3)
    n = int((2*Y - X)/ 3)
    
    g1 = [1, 1] # 元テーブル
    g2 = [1, 1] #逆元テーブル
    inverse = [0, 1] #逆元テーブル計算用テーブル
    for i in range( 2, m+n + 1 ):
        g1.append( ( g1[-1] * i ) % mod )
        inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
        g2.append( (g2[-1] * inverse[-1]) % mod )
    ret = cmb(m+n, m, mod)
else:
    ret = 0
print(ret)
from collections import defaultdict
N = int(input())
C = defaultdict(int)
for i in range(N):
  D = int(input())
  C[D] = i + 1
E = []
H = [1] * (N + 1)
DD = sorted([[k, v] for k, v in C.items()], reverse=True)
Adj = [[] for i in range(N)]
for D, n in DD[:-1]:
  try:
    p = C[D - N + 2 * H[n]]
    if n == p:
      raise Error
    E.append([n, p])
    Adj[n - 1].append(p - 1)
    Adj[p - 1].append(n - 1)
    H[p] += H[n]
  except:
    print(-1)
    break
else:
  dist = [N] * N
  dist[DD[-1][1] - 1] = 0
  Q = [N] * N
  Q[0] = [DD[-1][1] - 1]
  for i in range(N):
    s = Q[i]
    if s == N:
      break
    for adj in Adj[s]:
      if dist[adj] == N:
        dist[adj] = dist[s] + 1
        Q.append(adj)
  if sum(dist) == DD[-1][0]:
    for e in E:
      print(e[0], e[1])
  else:
    print(-1)

### FIXED CODE ###

from collections import defaultdict
N = int(input())
C = defaultdict(int)
for i in range(N):
  D = int(input())
  C[D] = i + 1
E = []
H = [1] * (N + 1)
DD = sorted([[k, v] for k, v in C.items()], reverse=True)
Adj = [[] for i in range(N)]
for D, n in DD[:-1]:
  try:
    p = C[D - N + 2 * H[n]]
    if n == p:
      raise Error
    E.append([n, p])
    Adj[n - 1].append(p - 1)
    Adj[p - 1].append(n - 1)
    H[p] += H[n]
  except:
    print(-1)
    break
else:
  dist = [N] * N
  dist[DD[-1][1] - 1] = 0
  Q = [DD[-1][1] - 1] + [N] * N
  tail = 1
  for i in range(N):
    s = Q[i]
    if s == N:
      print(-1)
      break
    for adj in Adj[s]:
      if dist[adj] == N:
        dist[adj] = dist[s] + 1
        Q[tail] = adj
        tail += 1
  else:
    if sum(dist) == DD[-1][0]:
      for e in E:
        print(e[0], e[1])
    else:
      print(-1)
a=input()
s={"A":"T","T":"A","C":"G","G":"C"}
print(a[s])


### FIXED CODE ###

a=input()
s={"A":"T","T":"A","C":"G","G":"C"}
print(s[a])
from math import ceil
n=int(input())
s=input()
r=0
g=0
b=0
for i in range (len(s)):
  if s[i]=='R':
    r+=1
  elif s[i]=='B':
    b+=1
  else:
    g+=1
c=0
for i in range(1,n//2,1):
  for j in range(0,n-2*i,1):
    if s[j+0*i]!=s[j+1*i] and s[j+1*i]!=s[j+2*i] and s[j+2*i]!=s[j+0*i]:
      c+=1;
      
      
ans=r*g*b-c;
print(ans)

### FIXED CODE ###

a=int(input())
while(a>0):
  k=a%10
  if k==7:
    print("Yes")
    exit()
  a//=10
print("No")
N=int(input())
lr=[list(map(int,input())) for _ in range(N)]
print(sum([e[1]-e[0]+1 for e in lr])

### FIXED CODE ###

N=int(input())
lr=[list(map(int,input().split())) for _ in range(N)]
print(sum([e[1]-e[0]+1 for e in lr]))
S = str(input())
l = len(S)
a = int(0)
b= int(0)
ans = [0]*l
ansc=int(0)
ansv=int(0)
ansi=int(0)

newS = S.split('LR')

k = len(newS)

for i in range(k):
    if i ==0:
        a = newS[i].count('R')
        b = len(newS[i])-a
        ansc = (a+1)//2 + b//2 +1
        ansv = a//2 + (b+1)//2
        ansi += newS[i].index('RL')
        ans[ansi]=ansc
        ans[ansi+1]=ansv
        ansi = len(newS[i])

    elif i < k-1:
        a = newS[i].count('R')
        b = len(newS[i])-a
        ansc = (a)//2 + (b+1)//2 + 1
        ansv = (a+1)//2 + (b)//2 + 1
        if 'RL' in newS[i]:
            ansi += newS[i].index('RL')+1
        else:
            ansi +=1
        ans[ansi]=ansc
        ans[ansi+1]=ansv
        ansi += (len(newS[i])+1)
    else:
        a = newS[i].count('R')
        b = len(newS[i]) - a
        ansc = (a) // 2 + (b+1) // 2
        ansv = (a+1) // 2 + (b) // 2 + 1
        ansi += newS[i].index('RL')+2
        ans[ansi] = ansc
        ans[ansi + 1] = ansv




print(ans)

### FIXED CODE ###

#from collections import deque
import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7

S = str(input())
N = len(S)
ans = [0]*N
k = int(1)
R = []
L = []
rcount = int(1)
lcount = int(0)
lLocate = []
for i in range(1,N):
    if S[i]==S[i-1]:
        if k == 1:
            rcount +=1
        else:
            lcount +=1
    else:
        if k==1:
            R.append(rcount)
            lLocate.append(i-1)
            lcount = int(1)
        else:
            L.append(lcount)
            rcount = int(1)

        k *= (-1)


L.append(lcount)

#print(R)
#print(L)
#print(lLocate)
j = int(0)
#for i in range(N):
#    if i in lLocate:
for i in lLocate:
    r = R[j]
    l = L[j]
    ans[i] = (r+1)//2 + l//2
    ans[i+1] = r//2 + (l+1)//2
    j +=1

print(' '.join(map(str, ans)))
h, n = map(int, input().split())
Deathblow = list(map(int, input().split()))
for i in n:
  h -= Deathblow[i]
if h < 1:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

h, n = map(int, input().split())
Deathblow = list(map(int, input().split()))
for i in range(n):
  h -= Deathblow[i]
if h < 1:
  print("Yes")
else:
  print("No")
N,M=map(int,input().split())
A=[-1]*N
for i in range(M):
  L=list(map(int,input().split()))
  if A[L[0]-1]==-1:
    A[L[0]-1]=L[1]
  else:
    if A[L[0]-1]==L[1]:
      continue
    else:
      print(-1)
      exit()
if N!=1 and A[0]==0:
  print(-1)
else:
  S=""
  if A[0]==-1:
    A[0]=1
  
  if N!=1:
    for i in range(N):
      if A[i]==-1:
        A[i]=0
      S+=str(A[i])
    print(int(S))
  else:
    print(int(A[0])


### FIXED CODE ###

n,m = map(int,input().split())
s = list(list(map(int,input().split())) for i in range(m))
x = [-1]*n
b = True
for i in range(m):
    if x[s[i][0]-1] == -1 or x[s[i][0]-1] == s[i][1]:
        x[s[i][0]-1] = s[i][1]
    else:
        b = False
for j in range(n):
    if x[j] == -1:
        if len(x) != 1 and j == 0:
            x[j] = 1
        else:
            x[j] = 0
if len(x) != 1 and x[0] == 0:
    b = False

if b:
  S=""
  for o in range(n):
    S+=str(x[o])
  print(int(S))
else:
  print(-1)
import math

str = list(input())  # 一文字ずつ格納
ans = math.inf

for i in range(len(str) - 1):
    sa = abs(int(str[i - 1]) * 100 + int(str[i]) * 10 + int(str[i + 1]) - 753)

    ans = min(ans, sa)

print(ans)


### FIXED CODE ###

str = list(input())  # 一文字ずつ格納
ans = 1000

for i in range(len(str) - 2):
    sa = abs(int(str[i]) * 100 + int(str[i+1]) * 10 + int(str[i + 2]) - 753)
    ans = min(ans, sa)

print(ans)
import math
N, M = map(int, input().split())
S = list(input())
T = list(input())
lcm = (N * M) // math.gcd(N, M)
ans = lcm
ansS = ["0"]*lcm
ansT = ["0"]*lcm
Sp = lcm//N
Tp = lcm//M
i = 1
for i in range(10000000000):
    if Sp*i > lcm:
        break
    if i >= N:
        break
    ansS[Sp*i] = S[i]

for i in range(10000000000):
    if Tp*i > lcm:
        break
    if i >= M:
        break
    ansT[Tp*i] = T[i]

for i in range(lcm):
    if ansS[i] == "0" or ansT[i] == "0":
        continue
    if ansS[i] != ansT[i]:
        ans = -1
        break
print(ans)


### FIXED CODE ###

import math
N, M = map(int, input().split())
S = list(input())
T = list(input())
lcm = (N * M) // math.gcd(N, M)
ans = lcm
Sp = lcm//N
Tp = lcm//M
lcmlcm = (Sp * Tp) // math.gcd(Sp, Tp)
owari = min(Sp*N, M*Tp)
for i in range(0, owari, lcmlcm):
    if S[i//Sp] != T[i//Tp]:
        ans = -1
        break
print(ans)
import numpy as np
N, K = map(int,input().split())
h = list(map(int, input().split()))

dp = np.full(N, np.inf)
dp[0] = 0
for i in range(1,N):
  for j in range(1,K+1):
    if i >= j: dp[i] = np.min(dp[i],dp[i-j]+np.abs(h[i] - h[i-j]))
print(int(dp[-1]))

### FIXED CODE ###

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

dp = [1e+09]*N
dp[0] = 0
for i in range(1,N):
  for j in range(1,K+1):
    if i >= j: dp[i] = min(dp[i],dp[i-j]+abs(h[i] - h[i-j]))
print(int(dp[-1]))
N, K = list(map(int, input().split()))
ab = []
for i in range(N-1):
    ab.append(list(map(int, input().split())))
    ab[-1][0] -= 1
    ab[-1][1] -= 1

ki = []
for i in range(N):
    ki.append(dict())
    ki[-1]["eda"] = []
    ki[-1]["No"] = []
    ki[-1]["iro"] = -1
    ki[-1]["one"] = []
    ki[-1]["two"] = []

for i in range(N-1):
    ki[ab[i][0]]["eda"].append([ab[i][0], ab[i][1]])
    ki[ab[i][1]]["eda"].append([ab[i][1], ab[i][0]])
    ki[ab[i][0]]["one"].append(ab[i][1])
    ki[ab[i][1]]["one"].append(ab[i][0])
for i in range(N-1):
    ki[ab[i][0]]["two"].extend(ki[ab[i][1]]["one"])
    ki[ab[i][1]]["two"].extend(ki[ab[i][0]]["one"])


def tansaku(i, base, ki):
    num = 1
    for node in ki[i]["one"]:
        if ki[node]["iro"] != -1:
            ki[i]["No"].append(ki[node]["iro"])
    for node in ki[i]["two"]:
        if ki[node]["iro"] != -1 and node != i:
            ki[i]["No"].append(ki[node]["iro"])

    num *= K-len(ki[i]["No"])
    num = num % 1000000007
    if num == 0:
        return 0
    for j in range(K):
        if not j in ki[i]["No"]:
            ki[i]["iro"] = j
            break

    for node in ki[i]["one"]:
        if node != base:
            num *= tansaku(node, i, ki)
            num = num % 1000000007

    return num

num = K
ki[0]["iro"] = 0

for node in ki[0]["one"]:
    num *= tansaku(node, 0, ki)
    num = num % 1000000007

print(num)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
INF=10**9+7
def LI(): return list(map(int, sys.stdin.readline().split()))
 
def main():
    n, k = LI()
    graph=[[] for i in range(n)]
    for i in range(n-1):
        a,b=LI()
        graph[a-1].append(b-1)
        graph[b-1].append(a-1)
    ans=1
    check=[False]*n
    stack=[0]
    ans=1
    while len(stack)>0:
        x=stack.pop()
        check[x]=True
        count=0
        for i in graph[x]:
            if not check[i]:
                count+=1
                stack.append(i)
        if x==0:
            temp=1
            for i in range(count):
                temp=temp*(k-1-i)%INF
            ans=ans*temp%INF
        else:
            temp=1
            for i in range(count):
                temp=temp*(k-2-i)%INF
            ans=ans*temp%INF
    print((ans*k)%INF)
 
 
if __name__ == "__main__":
    main()
#include <bits/stdc++.h>
#define INF 1050000000
#define rep(i,n) for (int i = 0; i < (n); i++)
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
    string s, flag="No";
    cin >> s;
    rep(i, ARRAY_LENGTH(s)-1){
        if (s[i]!=s[i+1]) flag = "Yes";
    }
    cout <<flag<< endl;
    return 0;
}

### FIXED CODE ###

S = list(input())
if S[0]==S[1] and S[1]==S[2]:
    print("No")
else:print("Yes")
print("YES" if "A" in input() and "B" in input() else "NO")


### FIXED CODE ###

s=input()
print("Yes" if "A" in s and "B" in s else "No")
N, M = map(int, input().split)
seta = set()
setb = set()
for i in range(M):
    a, b, =map(int, input().split)
    if a == 1: setb.add(b)
    if b == N: seta.add(a)
if len(seta&setb) == 0: print("IMPOSSIBLE")
else:   print("POSSIBLE")


### FIXED CODE ###

N, M = map(int, input().split())
seta = set()
setb = set()
for i in range(M):
    a, b, =map(int, input().split())
    if a == 1: setb.add(b)
    if b == N: seta.add(a)
if len(seta&setb) == 0: print("IMPOSSIBLE")
else:   print("POSSIBLE")
import math
N = int(input())
list=[]
for i in range(N):
    i = int(input())
    list.append(i)

if  math.prod(list) < 1000000000000000000:
    print(math.prod(list))
else:
    print(-1)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
result = 1
if 0 in A:
    print(0)
else:
    for i in range(N):
        result *= A[i]
        if result > 10**18:
            print(-1)
            quit()
    print(result)
#A-B間の運賃の入力
X = int(input())
#B-C間の運賃の入力
Y = int(input())
#制約
if  X < 0 or Y%2 != 0 or Y > 100:
    SystemExit
#A-C合計運賃の計算と出力
print(X+Y/2)

### FIXED CODE ###

#A-B間の運賃の入力 #B-C間の運賃の入力
X, Y= map(int, input().split())
#制約
if  X < 1 or Y%2 != 0 or Y > 100:
    SystemExit
#A-C合計運賃の計算と出力
print(int(X+Y/2))
from collections import deque

def main():
    h,w=map(int,input().split())
    maze=[list(input()) for i in range(h)]
    d=[[float("inf")]*w for i in range(h)]
    que=deque([])
    dx=[1,0,-1,0]
    dy=[0,1,0,-1]
    for i in range(h):
        for j in range(w):
            if maze[i][j]=="#":
                que.append((i,j))           
                d[i][j]=0
    while que:
        p=que.popleft()
        for i in range(4):
            nx=p[0]+dx[i]
            ny=p[1]+dy[i]
            if 0<=nx and nx<h and 0<=ny and ny<w and maze[nx][ny]!="#" and d[nx][ny]==float("inf"):
                d[nx][ny]=d[p[0]][p[1]]+1
                que.append((nx,ny))  
    ans=0
    for i in range(h):
        ans=max(ans,d[i])
if __name__=='__main__':
    print(main())




### FIXED CODE ###

from collections import deque

def main():
    h,w=map(int,input().split())
    maze=[list(input()) for i in range(h)]
    d=[[-1]*w for i in range(h)]
    que=deque([])
    dd=((1,0),(0,1),(-1,0),(0,-1))
    for i in range(h):
        for j in range(w):
            if maze[i][j]=="#":
                que.append((i,j))           
                d[i][j]=0
    ans=0
    while que:
        p=que.popleft()
        ans=d[p[0]][p[1]]
        for dx,dy in dd:
            nx=p[0]+dx
            ny=p[1]+dy
            if 0<=nx and nx<h and 0<=ny and ny<w and maze[nx][ny]!="#" and d[nx][ny]==-1:
                d[nx][ny]=ans+1
                que.append((nx,ny))  
    return ans
if __name__=='__main__':
    print(main())
n = int(input())
p_list = list(map(int, input().split()))
count = 0
for i in range(1,len(p_list)-1):
    if p_list[i-1] < p_list[i] < p_list[i+1]:
        count += 1
    if p_list[i-1] > p_list[i] > p_list[i+1]:
        count += 1
print(count)

### FIXED CODE ###

s = input()
if len(set(s)) == 2 and s.count(s[0]) == 2:
    print("Yes")
else:
    print("No")
def max_minus_min(areas):
    # print("areas", areas)
    # return max(areas) - min(areas)
    return 999
 
def solve2(h, w):
    return 7, 7
    # area1 = h * (w // 2)
    # area2 = h * w - area1
    # return area1, area2
 
def solve(h, w):
    w_div_3 = w // 3;
    ans = 1e9
    for w2 in range(w_div_3, w_div_3 + 2):
        area1 = w2 * h
        ans = min(ans, max_minus_min([area1] + solve2(h, w - w2)))
        ans = min(ans, max_minus_min([area1] + solve2(w - w2, h)))
    return ans
 
H, W = map(int, input().split())
print(min(solve(H,W), solve(W,H)))


### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# import array
# from bisect import *
# from collections import *
# import fractions
# import heapq 
# from itertools import *
# import math
# import re
# import string

def max_minus_min(areas):
    # print("areas", areas)
    return max(areas) - min(areas)

def solve2(h, w):
    area1 = h * (w // 2)
    area2 = h * w - area1
    return [area1, area2]

def solve(h, w):
    w_div_3 = w // 3;
    ans = 1e9
    for w2 in range(w_div_3, w_div_3 + 2):
        area1 = w2 * h
        ans = min(ans, max_minus_min([area1] + solve2(h, w - w2)))
        ans = min(ans, max_minus_min([area1] + solve2(w - w2, h)))
    return ans

H, W = map(int, raw_input().split())
print(min(solve(H,W), solve(W,H)))
N = input(int())
if (N%100)%10 == 3:
    print('bon')
elif (N%100)%10 == 0 or (N%100)%10 ==1 or (N%100)%10 ==6 or (N%100)%10 ==8:
    print('pon')
else:
    print('hon')



### FIXED CODE ###

N = int(input())
if (N%100)%10 == 3:
    print('bon')
elif (N%100)%10 == 0 or (N%100)%10 ==1 or (N%100)%10 ==6 or (N%100)%10 ==8:
    print('pon')
else:
    print('hon')
import sys
import itertools
import numpy
input = sys.stdin.readline
Sa = input()
Ta = input()
S = ['0'] * len(Sa)
T = ['0'] * len(Ta)
for i in range(len(Sa)) :
    S[i] = Sa[i]
for i in range(len(Ta)) :
    T[i] = Ta[i]
ans = {}
for cs,ct in zip(S,T) :
    if cs not in ans.keys() and ct not in ans.values() :
        ans[cs] = ct
    else :
        if ans[cs] == ct :
            continue
        else :
            print("No")
            break
else :
    print("Yes")

### FIXED CODE ###

import sys
import itertools
import numpy
input = sys.stdin.readline
Sa = input()
Ta = input()
S = ['0'] * len(Sa)
T = ['0'] * len(Ta)
for i in range(len(Sa)) :
    S[i] = Sa[i]
for i in range(len(Ta)) :
    T[i] = Ta[i]
ans = {}
for cs,ct in zip(S,T) :
    if cs not in ans.keys() and ct not in ans.values() :
        ans[cs] = ct
    else :
        try :
            if ans[cs] == ct :
                continue
            else :
                print("No")
                break
        except KeyError :
            print("No")
            break
else :
    print("Yes")
s = input()

l=2s*3.14

print(l)

### FIXED CODE ###

import math

s=float(input())

l=float(2*s)*math.pi
print(l)
N = int(input())
a = N[-1]
if a in [0,1,6,8]:
  print("pon")
elif a in [3]:
  print("bon")
else:
  print("hon")


### FIXED CODE ###

s =int( input()[-1])
if s in [2, 4, 5, 7, 9]:
  print('hon')
elif s in [0, 1, 6, 8]:
  print('pon')
else:
  print('bon')
n,x,t = int(input.split())
a = n//x + 1
print(a)

### FIXED CODE ###

n,x,t = map(int,input().split())
if n%x==0:
    print((n//x)*t)
else:
    print(((n//x)+1)*t)