Harryxun/stf_run huggingface dataset:
N = int(input())
h = list(map(int, input().split()))

#大きな値
INF = 10**10

# DPtable
dp = [INF]*10000

#初期条件
dp[0] = 0
dp[1] = abs(h[1]-h[0])

#ループ
for i in range(N):
    if i == 0 or i == 1:
        continue
    else:
        dp[i] = min(dp[i-1] + abs(h[i] - h[i-1]), dp[i-2] + abs(h[i]-h[i-2]))

print(dp[N-1])



### FIXED CODE ###

# N = int(input())
# h = list(map(int, input().split()))
# 
# #大きな値
# INF = 9999
# 
# # DPtable
# dp = [INF]*9999
# 
# #初期条件
# dp[0] = 0
# dp[1] = abs(h[1]-h[0])
# 
# #ループ
# for i in range(N):
#     if i == 0 or i == 1:
#         continue
#     else:
#         dp[i] = min(dp[i-1] + abs(h[i] - h[i-1]), dp[i-2] + abs(h[i]-h[i-2]))
# 
# print(dp[N-1])

N = int(input())
h = list(map(int, input().split()))
dp = [10 ** 10 for _ in range(N)]
dp[0] = 0
dp[1] = abs(h[1] - h[0])

for i in range(2, N):
    dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))

print(dp[-1])
print('ACL'*int(input())

### FIXED CODE ###

k = int(input())
print('ACL'*k)
import math, sys
sys.setrecursionlimit(100000000)
mod = 10**9+7
N, K = map(int, input().split())
edge = [[] for _ in range(N)]
flag = [False]*N
flag[0] = True
for i in range(N-1):
    a, b = map(int, input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
P = [1]*(K+10)
T = [1]*(K+10)
for i in range(1, K+10):
    P[i] = (P[i-1]*(K-i))%mod
    T[i] = T[i-1]*(K-i-1)%mod
def count(x):
    flag[x]=True
    res = 1
    l = len(edge[x])-1
        
    for e in edge[x]:
        if flag[e]:
            continue
        res*=count(e)
    if x==0:
        return res*K*P[l+1]%mod
    return res*T[l]%mod
print(count(0))


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000000)
mod = 10**9+7
N, K = map(int, input().split())
edge = [[] for _ in range(N)]
flag = [False]*N
flag[0] = True
for i in range(N-1):
    a, b = map(int, input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
P = [1]*(K+10)
T = [1]*(K+10)
for i in range(1, K+10):
    P[i] = (P[i-1]*(K-i))%mod
    T[i] = T[i-1]*(K-i-1)%mod
def count(x):
    flag[x]=True
    res = 1
    l = len(edge[x])-1
        
    for e in edge[x]:
        if flag[e]:
            continue
        res*=count(e)
    if x==0:
        if l+1> K-1:
            return 0
        return res*K*P[l+1]%mod
    if l>K-2:
        return 0
    return res*T[l]%mod
print(count(0))
def processValue(array:list):
	global minimumValue
	value = 0
	for i in array:
		value += fruits[i]
	
	if minimumValue == -1 or value < minimumValue:
		minimumValue = value

def combi(n,k,i,array):
	if i == k:
		processValue(array)
		return
	for j in range(array[i-1],n):
		if j in array[0:i]:
			continue
		array[i] = j
		combi(n,k,i+1,array)

fruits = []
minimumValue = -1
n,k = map(int,input().split())
fruits = [int(f) for f in input().split()]
combi(n,k,0,[0 for _ in range(k)])
print(minimumValue)


### FIXED CODE ###

def addAndDeleteMin():
	global ans
	global p
	minv = min(p)
	ans += minv
	p.remove(minv)

n,k = map(int,input().split())
p = [int(x) for x in input().split()]
ans = 0
for i in range(k):
	addAndDeleteMin()
print(ans)
N = int(input())

alphabet = ['a', 'b', 'c','d','e','f','g', 'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
mm = 1
name = ''
while True:
    if N > 26 ** mm:
        N = N - 26 ** mm
        mm += 1
    else:
        break
#mmけた

for i in range(mm):
    
    

    if N< 1:
        name = name + 'a'
    else:
            if N%26 == 0:
                name = name + alphabet[26]
            else:
                name = name + alphabet[N%26-1]
                N = N//26 +1
print(name)


### FIXED CODE ###

N = int(input())

alphabet = ['a', 'b', 'c','d','e','f','g', 'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
mm = 1
name = ''
while True:
    if N > 26 ** mm:
        N = N - 26 ** mm
        mm += 1
    else:
        break
#mmけた

for i in range(mm):
    
    

    if N< 1:
        name =  'a' +name
    else:
            if N%26 == 0:
                name = alphabet[25] + name
                N = N//26
            else:
                name = alphabet[N%26-1] + name
                N = N//26 +1
print(name)
n = input()
count = 0
for i in xrange(n):
    x = input()
    if x == 2: count += 1
    elif x == 3: count += 1
    elif x % 2 != 0:
        for j in xrange(3,x*0.5+1,2):
            if x % j == 0: break
        else: count += 1
print count

### FIXED CODE ###

import math
def prime(x):
    if x == 2: return True
    elif x % 2 == 0: return False
    else:
        for j in xrange(3,int(math.sqrt(x))+1,2):
            if x % j == 0: return False
        else:
            return True 
n = input()
count = 0
for i in xrange(n):
    if prime(input()): count += 1
print count
def read_int():
    return int(input())

def read_int_map():
    return map(int,input().split(' '))

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

def read_s_list_loop(n):
    return [input() for _ in range(n)]

N,K = read_int_map()
An = read_int_list()
memo = [0]*(N+1)
memo_indx = [0]*(N+1)
memo[1] = 1
memo_indx[1] = 0
seq_an = [1]
next_place = An[0]
for i in range(len(An)):
    if memo[next_place] == 0:
        seq_an.append(next_place)
        memo[next_place] = 1
        memo_indx[next_place] = i + 1
        next_place = An[next_place-1]
    else:
        break
loop_idx = memo_indx[next_place]
loop_list = seq_an[loop_idx:]
if K <= len(seq_an):
    print(seq_an[K])
else:
    num = (K - len(seq_an)) % len(loop_list)
    print(loop_list[num])

### FIXED CODE ###

def read_int():
    return int(input())

def read_int_map():
    return map(int,input().split(' '))

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

def read_s_list_loop(n):
    return [input() for _ in range(n)]

N,K = read_int_map()
An = read_int_list()
memo = [0]*(N+1)
memo_indx = [0]*(N+1)
memo[1] = 1
memo_indx[1] = 0
seq_an = [1]
next_place = An[0]
for i in range(len(An)):
    if memo[next_place] == 0:
        seq_an.append(next_place)
        memo[next_place] = 1
        memo_indx[next_place] = i + 1
        next_place = An[next_place-1]
    else:
        break
loop_idx = memo_indx[next_place]
loop_list = seq_an[loop_idx:]
if K <= len(seq_an)-1:
    print(seq_an[K])
else:
    num = (K - len(seq_an)) % len(loop_list)
    print(loop_list[num])
n = int(input())
imin = n // 4
flag = False
for i in range(imin, 3501):
    jmin = i * n // (4 * i - n)
    for j in range(jmin, 3501):
        num = i * j * n
        den = 4 * i * j - i * n - j * n
        if den > 0 and num % den == 0:
            k = num // den
            print("{} {} {}".format(i, j, k))
            flag = True
    if flag:
        break


### FIXED CODE ###

n = int(input())
imin = n // 4
flag = False
for i in range(imin, 3501):
    num = i * n
    den = 4 * i - n
    if den <= 0:
        continue
    jmin = num // den
    for j in range(jmin, 3501):
        num = i * j * n
        den = 4 * i * j - i * n - j * n
        if den > 0 and num % den == 0:
            k = num // den
            print("{} {} {}".format(i, j, k))
            flag = True
            break
    if flag:
        break
N, A, B = map(input().split())
print(N*A if N*A < B else B)

### FIXED CODE ###

N, A, B = map(int, input().split())
print(N*A if N*A < B else B)
n=int(input())
a=[]
for x in range(1,10):
  for y in range(1,10):
    a=a.append(x*y)
if n in a:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

a,b=map(int,input().split())
if a<10 and b<10:
  print(a*b)
  
else:
  print('-1')
# -*- coding: utf-8 -*-
"""
Created on Sat Sep  8 15:51:53 2018

@author: maezawa
"""

n = int(input())
a = list(map(int, input().split()))
sa = 0
cnt = 0
for i in range(0,n-1):
    sa += a[i]
    na = -sa//abs(sa)*(abs(sa)+1)
    if abs(a[i+1]) > abs(na) and a[i+1]*na > 0:
        continue
    cnt += abs(na-a[i+1])
    a[i+1] = na

print(cnt)
    

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Sep  8 15:51:53 2018

@author: maezawa
"""

def sign(x):
    return x//abs(x)

def f(n, a0, s):
    cnt = 0
    cum = 0
    for i, ai in enumerate(a):
        cum += ai
        if cum == 0:
            cnt += 1
            cum = (-1)**i*s
        elif sign(cum) == (-1)**i*s:
            continue
        else:
            cnt += abs(cum)+1
            cum = (-1)**i*s
    return cnt

n = int(input())
a = list(map(int, input().split()))

cnt = 0
cnt0 = f(n, a, -1)
cnt1 = f(n, a, 1)
cnt = min([cnt0,cnt1])
print(cnt)
args = []
a = input()
while a:
  for x in a.split():
    args.append(int(x))
  a = input()

b = [x for x in args[2:] if x >= args[1]]
print(len(b))

### FIXED CODE ###

args = input().split()
heights = input().split()

b = [x for x in heights if int(x) >= int(args[1])]
print(len(b))
H, W = map(int, input().split())

A = [list(map(int, input().split())) for _ in range(H)]
B = [list(map(int, input().split())) for _ in range(H)]
Diff = [[False] * (W + 1) for _ in range(H + 1)]
M = 0
for i in range(H):
    for j in range(W):
        m = abs(A[i][j] - B[i][j])
        Diff[i][j] = m
        M += m

dp = [[[0] * (M + 1) for _ in range(W + 1)] for _ in range(H + 1)]
dp[0][0][Diff[0][0]] = 1

for i in range(0, H):
    for j in range(0, W):
        for k in range(M + 1):
            if dp[i][j][k]:
                dp[i + 1][j][k + Diff[i + 1][j]] |= True
                dp[i + 1][j][abs(k - Diff[i + 1][j])] |= True
                dp[i][j + 1][k + Diff[i][j + 1]] |= True
                dp[i][j + 1][abs(k - Diff[i][j + 1])] |= True

for k in range(M + 1):
    if dp[H - 1][W - 1][k] == 1:
        ans = k
        break

print(ans)


### FIXED CODE ###

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

A = [list(map(int, input().split())) for _ in range(H)]
B = [list(map(int, input().split())) for _ in range(H)]
Diff = [[0] * (W + 1) for _ in range(H + 1)]
M = 0
for i in range(H):
    for j in range(W):
        m = abs(A[i][j] - B[i][j])
        Diff[i][j] = m
        M += m

dp = [[0] * (W + 1) for _ in range(H + 1)]
dp[0][0] |= (1 << Diff[i][j])

for i in range(0, H):
    for j in range(0, W):
        here = dp[i][j]
        s = Diff[i][j]
        ni = 0
        nj = 0
        ni |= (here << s)
        nj |= (here << s)
        ni |= (here >> s)
        nj |= (here >> s)
        ex = 0
        for k in range(1, s + 1):
            if (here >> k) & 1:
                ex |= (1 << (s - k))
        ni |= ex
        nj |= ex
        dp[i + 1][j] |= ni
        dp[i][j + 1] |= nj

a = dp[H - 1][W - 1]
ans = 0
for k in range(M + 1):
    if (a >> k) & 1:
        ans = k
        break

print(k)
def factorial(n):
    res = 1
    for i in range(1, n+1):
        res *= i
    return res

n = int(input())
s = []
for i in range(n):
    s.append(list(str(input())))
    
for i in s:
    i.sort()

s.sort()

tmp = 'a'
total = 0
for i in s:
    if i == tmp:
        cnt += 1
    elif cnt >= 2:
        total += factorial(cnt)*factorial(cnt-2)/2
        cnt = 1
    tmp = i

print(int(total))

### FIXED CODE ###

n = int(input())
ss = ["".join(sorted(list(input()))) for _ in range(n)]
ss.sort()

ans = 0
cnt = 0
tmp = ss.pop(0)
for s in ss:
    if tmp == s:
        cnt+=1
    elif cnt > 0:
        tmp = s
        ans+=((cnt+1) * cnt // 2)
        cnt = 0
    else:
        tmp = s
        cnt = 0
print(ans + ((cnt+1) * cnt // 2))
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
tot = sum(B)
for i in range(n-1):
  if A[i+1] = A[i]+1:
    tot += C[A[i]]
print(tot)

### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
tot = sum(B)
for i in range(n-1):
  if A[i+1] == A[i]+1:
    tot += C[A[i]-1]
print(tot)
a,b = raw_input().split(' ')

a = int(a)
b = float(b)

b0,b1 = b.split('.') if '.' in b else [int(b), 0]
b0 = int(b0)
b1 = int(b1)

print a*b0 + a*b1/100 


### FIXED CODE ###


a,b = raw_input().split(' ')

a = int(a)


b0,b1 = b.split('.') if '.' in b else [int(b), 0]
b0 = int(b0)
b1 = int(b1)

print a*b0 + a*b1/100
def calcMax(i):
  now = numbers[i]

  future_max = max(numbers[i+1:])
  #print(numbers[i+1:])
  t = numbers[i+1:]
  #print((max(t)))
  return future_max - now

n = int(input())

numbers = []
for i in range(n):
  numbers.append(int(input()))

m = -1000000001
ti = 1000000001
for i in range(len(numbers) - 1):
    if numbers[i] < ti:
      if (i == 0 or i == len(numbers) - 1 or (numbers[i-1] >= numbers[i] and numbers[i] =< numbers[i+1])):
        temp = calcMax(i)
        #print("temp: " + str(temp))
        if temp > m:
            m = temp
            ti = numbers[i]

print (m)


### FIXED CODE ###

def calcMax(i):
  now = numbers[i]

  future_max = max(numbers[i+1:])
  #print(numbers[i+1:])
  t = numbers[i+1:]
  #print((max(t)))
  return future_max - now

n = int(input())

numbers = []
for i in range(n):
  numbers.append(int(input()))

m = -1000000001
ti = 1000000001
for i in range(len(numbers) - 1):
    if numbers[i] < ti:
      if (i == 0 or i == len(numbers) - 1 or (numbers[i-1] >= numbers[i] and numbers[i] <= numbers[i+1])):
        temp = calcMax(i)
        #print("temp: " + str(temp))
        if temp > m:
            m = temp
            ti = numbers[i]

print (m)
from collections import deque

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

draw = ((1, 0), (-1, 0), (0, 1), (0, -1))
todo = deque([])
done = [[False for _ in range(w)] for _ in range(h)]
grid = []
for i in range(h):
    s = input()
    for j, k in enumerate(s):
        if k == "#":
            todo.append((i, j))
            done[i][j] = True
    grid.append(list(s))

cnt = -1
while todo:
    for i in range(len(todo)):
        n, m = todo.popleft()
        for dn, dm in draw:
            if not 0 <= n + dn < w or not 0 <= m + dm < h:
                pass
            elif done[n + dn][m + dm]:
                pass
            elif grid[n + dn][m + dm] == "#":
                pass
            elif grid[n + dn][m + dm] == ".":
                todo.append((n + dn, m + dm))
                done[n + dn][m + dm] = True
                grid[n + dn][m + dm] = "#"
    cnt += 1

print(cnt)

### FIXED CODE ###

import numpy as np

h, w = map(int, input().split())
grid = (np.array([list(input())
                  for _ in range(h)]) == "#")
cost = np.full((h, w), 10 ** 9, dtype=np.int64)
cost[grid[:, :]] = 0

for i in range(1, h):
    cost[i] = np.minimum(cost[i], cost[i - 1] + 1)

for i in range(h - 1)[::-1]:
    cost[i] = np.minimum(cost[i], cost[i + 1] + 1)

for i in range(1, w):
    cost[:, i] = np.minimum(cost[:, i], cost[:, i - 1] + 1)

for i in range(w - 1)[::-1]:
    cost[:, i] = np.minimum(cost[:, i], cost[:, i + 1] + 1)

print(np.max(cost))
import math
a,b,c,d = map(int,input().split())
num = b-a+1
ac = int((a-1)/c)
ad = int((a-1)/d)
bc = int(b/c)
bd = int(b/d)
e = c*d//(math.gcd(c,d))
a = int(a/e)
b = int(b/e)
c = bc-ac
d = bd-ad
e = b-a
print(num-(c+d-e))

### FIXED CODE ###

import fractions
a,b,c,d = map(int,input().split())
num = b-a+1
ac = int((a-1)//c)
ad = int((a-1)//d)
bc = int(b//c)
bd = int(b//d)
e = c*d//(fractions.gcd(c,d))
a = int((a-1)//e)
b = int(b//e)
c = bc-ac
d = bd-ad
e = b-a
print(num-(c+d-e))
S = input()
box = ["A", "G", "C", "T"]
 
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox):
        
        ACGTbox = s 
    s = str()
print(len(ACGTbox))

### FIXED CODE ###

# -*- coding: utf-8 -*-
S = str(input())
box = ["A", "G", "C", "T"]
s = str()
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox):
        
        ACGTbox = s 
    s = str()
print(len(ACGTbox))
a⁵-b⁵=(a-b)(a⁴+a³b+a²b²+ab³+b⁴)
def main():
  X = int(input())
  
  a = -1
  b1 = -1
  b2 = +1
  while True:
    a += 1
    while True:
    	b1 += 1
        b2 -= 1
        if (X/(a-b1)).is_integer:
          if int(X/(a-b1)) == a**4 + b1*(a**3) + (a**2)*(b1**2) + a*(b1**2) + b1**4:
            print("{} {}\n".format(a, b1))
            return 0
          
        if (X/(a-b2)).is_integer:
          if int(X/(a-b2)) == a**4 + b2*(a**3) + (a**2)*(b2**2) + a*(b2**2) + b2**4:
            print("{} {}\n".format(a, b2))
            return 0
          
          
if __name__ == "__main__":
  main()
         
          

### FIXED CODE ###

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

    a = -1
    
    while True:
        b1 = 0
        b2 = 0
        while b1 < a:
            
            if (X/(a-b1)).is_integer():
                if int(X/(a-b1)) == a**4 + b1*(a**3) + (a**2)*(b1**2) + a*(b1**3) + b1**4:
                    print("{} {}\n".format(a, b1))
                    return 0

            if (X/(a-b2)).is_integer():
                if int(X/(a-b2)) == a**4 + b2*(a**3) + (a**2)*(b2**2) + a*(b2**3) + b2**4:
                    print("{} {}\n".format(a, b2))
                    return 0

            b1 += 1
            b2 -= 1
            
        a += 1


if __name__ == "__main__":
    main()
k,q = map(int,input().split())
d = list(map(int,input().split()))
n = [0]*q
x = n.copy()
m = n.copy()
for i in range(q):
    n[i],x[i],m[i] = map(int,input().split())
    
for i in range(q):
    a = [x[i]%m[i]]*n[i]
    count = 0
    for j in range(n[i]-1):
        a[j+1] = (a[j] + d[j%k])%m[i]
        if a[j+1] > a[j]:
            count+=1
    print(count)

### FIXED CODE ###

import numpy as np

k,q = map(int,input().split())
d = np.array(list(map(int,input().split())))
n = [0]*q
x = n.copy()
m = n.copy()
for i in range(q):
    n[i],x[i],m[i] = map(int,input().split())
    
for i in range(q):
    d_ = d%m[i]
    j = np.sum(d_ * ((n[i]-1)//k)) + np.sum(d_[:(n[i]-1)%k])
    s = np.sum(np.sum(d_==0) * ((n[i]-1)//k)) + np.sum(d_[:(n[i]-1)%k]==0)
    count = n[i] - 1 - (j+x[i]%m[i])//m[i] - s
    print(count)
import math
from functools import reduce
import sys

def gcd(number_list):
    return reduce(math.gcd, number_list)

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

if N == 2:
    print(max(Numbers))
    sys.exit()

gcd_list = []
for i in range(N):
    tmp_list = Numbers[:i] + Numbers[i + 1:]
    gcd_list.append(gcd(tmp_list))
print(max(gcd_list))



### FIXED CODE ###

from functools import reduce
from itertools import combinations
from fractions import gcd

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


Left = [0] * (N + 1)
Right = [0] * (N + 1)

for i in range(N):
    Left[i + 1] = gcd(Left[i], A[i])
    Right[N - i - 1] = gcd(Right[N - i], A[N - i - 1])
ans = 0
for i in range(N):
    ans = max(ans, gcd(Left[i], Right[i + 1]))
    
print(ans)
import numpy as np

N, K = map(int, input().split())
ub = K * 2
bw = {"B": np.full((ub, ub), 0), "W": np.full((ub, ub), 0)}
for i in range(N):
	x, y, c = input().split()
	bw[c][int(x) % ub][int(y) % ub] += 1

def accum_arr(arr):
	acc_h = np.full((ub, ub), 0)
	acc_v = np.full((ub, ub), 0)
	acc = np.full((ub, ub), 0)
	acc_h[:, 0] = arr[:, 0] + arr[:, - (K - 1):].sum(axis=1)
	acc_v[0, :] = arr[0, :] + arr[- (K - 1):, :].sum(axis=0)

	for i in range(1, ub):
		acc_h[:, i] = arr[:, i] + acc_h[:, i - 1] - arr[:, (i - K) % ub]
		acc_v[i, :] = arr[i, :] + acc_v[i - 1, :] - arr[(i - K) % ub, :]

	acc[0][0] = arr[0][0] + arr[0, - (K - 1):].sum() + arr[- (K - 1):, 0].sum() + arr[-(K - 1):, - (K - 1):].sum()

	for j in range(1, ub):
		acc[0][j] = acc[0][j - 1] + acc_v[0][j] - acc_v[0][(j - K) % ub]

	for j in range(ub):
		for i in range(1, ub):
			acc[i][j] = acc[i - 1][j] + acc_h[i][j] - acc_h[(i - K) % ub][j]

	return acc


b_acc = accum_arr(bw["B"])
w_acc = accum_arr(bw["W"])

ans = 0
for x in range(ub):
	for y in range(ub):
		x_cmp = (x + K) % ub
		y_cmp = (y + K) % ub
		tmp_ans = b_acc[x][y] + b_acc[x_cmp][y_cmp] + w_acc[x][y_cmp] + w_acc[x_cmp][y]
		if tmp_ans > ans:
			ans = tmp_ans

print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
ub = K * 2
b = [[0 for j in range(ub + 1)] for i in range(ub + 1)]

def create_bound(p):
	if p - K + 1 >= 0:
		return [(p - K + 1, p + 1)]
	else:
		return [(0, p + 1), ((p - K + 1) % ub, ub)]

for i in range(N):
	x, y, c = input().split()
	nx = int(x) % ub
	ny = (int(y) + (K if c == "W" else 0)) % ub
	for add in [0, K]:
		for xlb, xub in create_bound((nx + add) % ub):
			for ylb, yub in create_bound((ny + add) % ub):
				b[xlb][ylb] += 1
				b[xlb][yub] -= 1
				b[xub][ylb] -= 1
				b[xub][yub] += 1

for i in range(ub):
	for j in range(ub):
		b[i][j + 1] += b[i][j]
for j in range(ub):
	for i in range(ub):
		b[i + 1][j] += b[i][j]
print(max(max(b[i]) for i in range(ub)))
a = int(input())
ans =a // 11 *2
b = a % 11
if b == 0:
    print(ans)
elif b <= 6:
    print(ans+1)
else:
    print(num+2)


### FIXED CODE ###

a = int(input())
ans =a // 11 *2
b = a % 11
if b == 0:
    print(ans)
elif b <= 6:
    print(ans+1)
else:
    print(ans+2)
from collections import deque
import math
mod = 10**9+7
N,K = map(int,input().split())

#KPxの計算用。一回だけ使う
def Perm(n,r):#aPb
    return math.factorial(n) // math.factorial(n - r)

#K-2Pxの計算のメモ化
K_2perm =[1,K-2]
pres = K-2
for i in range(2,K-1):
    pres = (pres*(K-1-i))%mod
    K_2perm.append(pres)
    
child = [[] for i in range(N)]
for hoge in range(N-1):
    a,b = [int(i)-1 for i in input().split()]
    child[a].append(b)
    child[b].append(a)


ans = Perm(K,len(child[0])+1)%mod
#DFSしながら塗る
went = [False] * N
queue = deque()
queue.append(0)
went[0] = True
while queue:
    cur = queue.pop()
    for togo in child[cur]:
        if not went[togo]:
            went[togo] = True
            queue.append(togo)
            print(len(child[togo]))
            ans *= K_2perm[len(child[togo])-1]
            ans %= mod
print(ans)



### FIXED CODE ###

from collections import deque
import math
import sys
mod = 10**9+7
N,K = map(int,input().split())

#k
Kperm =[1,K]
pre = K
for i in range(2,K+1):
    pre = (pre*(K+1-i))%mod
    Kperm.append(pre)


#K-2Pxの計算のメモ化
K_2perm =[1,K-2]
pres = K-2
for i in range(2,K-1):
    pres = (pres*(K-1-i))%mod
    K_2perm.append(pres)

child = [[] for i in range(N)]
for hoge in range(N-1):
    a,b = [int(i)-1 for i in input().split()]#点を0-indexedになおす
    child[a].append(b)
    child[b].append(a)

if len(child[0])>=K:
    print(0);sys.exit()
ans = Kperm[len(child[0])+1]
#DFSしながら塗る
went = [False] * N
queue = deque()
queue.append(0)
went[0] = True
while queue:
    cur = queue.pop()
    if cur!=0 and len(child[cur])>=K:
        print(0)
        sys.exit()
    if cur!=0:
        ans *= K_2perm[len(child[cur])-1]
        ans %= mod
    for togo in child[cur]:
        if not went[togo]:
            went[togo] = True
            queue.append(togo)
print(ans)
import sympy

N = int(input())
Y = list(map(int,input().split(' ')))


symbols = []
for i in range(N):
    symbols.append(sympy.Symbol('x' + str(i)))

equation = []
for i in range(N):
    i1 = i
    i2 = i + 1 
    if i2 >= N:
        i2 = 0
    equation.append(0.5*symbols[i1] + 0.5*symbols[i2] - Y[i])

for i in range(N):
    print(str(int(sympy.solve(equation)[symbols[i]])) + " " , end="")
print()

### FIXED CODE ###

# -*- coding: utf-8 -*-
 
N = int(input())
A = list(map(int, input().split()))
s = sum(A)
r = [s - 2 * sum(A[1::2])]

for i in range(N-1):
    r.append(2 * A[i] - r[i])
    
r = map(str, r)
print(" ".join(r))

'''
5
3 8 7 5 5
'''