Harryxun/stf_run huggingface dataset:
x=[i for i in input()]
count=0

if len(x)%2!=0:
  x.pop(len(x)//2+1)

P =[p for p in range(0,len(x)//2)]
Q =[q for q in range(len(x)//2,len(x))]
Q.sort(reverse=True)
for a,b in zip(P,Q):
  if x[a]!=x[b]:
    count+=1
print(count)

### FIXED CODE ###

x=[i for i in input()]
count=0

if len(x)%2!=0:
  x.pop(len(x)//2)

P =[p for p in range(0,len(x)//2)]
Q =[q for q in range(len(x)//2,len(x))]
Q.sort(reverse=True)
for a,b in zip(P,Q):
  if x[a]!=x[b]:
    count+=1
print(count)
def cal(A, B):
    if A >= 13:
        return B
    elif 6 <= A and A <= 12:
        return B/2
    elif 5 >= A:
        return 0

if __name__ == "__main__":
    print(cal(int(input()), int(input())))

### FIXED CODE ###

def main():
    i = list(map(int, input().split()))
    a = i[0]
    b = i[1]

    #if isinstance(a, int) == False or isinstance(b, int) == False or a < 0 or 100 < a or b < 2 or 1000 < b or b % 2 != 0:
    #    return

    if 13 <= a and a <= 100:
        print(b)
    elif 6 <= a and a <= 12:
        print(b//2)
    elif 0 <= a and a <= 5:
        print(0)

if __name__ == "__main__":
    main()
N =int(input())
A_n =list(map(int,input().split()))
ans =1
i = 0

while ans <= 10**18 and i < N:
  ans *= A_n[i]
  i +=1
if ans > 10**18:
  elif "0" in A_n is False:
    print(-1)
  else:
    print(0)
else:
  print(ans)

### FIXED CODE ###

N =int(input())
A_n =list(map(int,input().split()))
ans =1
i = 0

while ans <= 10**18 and i < N:
  ans *= A_n[i]
  i +=1
if ans > 10**18:
  if 0 in A_n:
    print(0)
  else:
    print(-1)
else:
  print(ans)
print(n**3)

### FIXED CODE ###

n=int(input())
print(n*n*n)
a = int(input())
s = input()
x=[]
y=[]
count=[]
for i in range (a):
    for j in range (i):
        x[j]=s[j]
    for k in range (a-i):
        y[k]=s[i+k]
    for l in range (i):
        for m in range (a-i):
            if x[l] == y[m]:
                count[i]+=1
                break
print(max(count))

### FIXED CODE ###

n = int(input())
s = input()
s = list(s)
x = 0
for i in range(1,n):
  a = set(s[:i])
  b = set(s[i:])
  c = len(list(a&b))
  if x<c:
    x = c
print(x)
from collections import deque

S = list(input())
Q = int(input())
d = deque(S)
flag = -1
for _ in range(Q):
    q = list(input().split())
    if q[0] == '1':
        flag *= -1
    else:
        f = int(q[1])
        c = q[2]
        if flag == 1 and f == 1 or flag == -1 and f == 2:
            d.appendleft(c)
        else:
            d.append(c)

if flag == -1:
    d = d[::-1]

print(''.join(d))


### FIXED CODE ###

from collections import deque

S = list(input())
Q = int(input())
d = deque(S)
flag = -1
for _ in range(Q):
    q = list(input().split())
    if q[0] == '1':
        flag *= -1
    else:
        f = int(q[1])
        c = q[2]
        if flag == -1 and f == 1 or flag == 1 and f == 2:
            d.appendleft(c)
        else:
            d.append(c)
d = list(d)
if flag == 1:
    d = d[::-1]

print(''.join(d))
a=input()
s = str(a)
	if(s[-1] in ('2','4','5','7','9')):
		print('hon')
	elif(s[-1] in ('0','1','6','8')):
		print('pon')
	elif(s[-1] == '3'):
		print('bon')

### FIXED CODE ###

a=input()
s = str(a)
if(s[-1] in ('2','4','5','7','9')):
	print('hon')
elif(s[-1] in ('0','1','6','8')):
	print('pon')
elif(s[-1] == '3'):
	print('bon')
def insertionSort( nums, n, g ):
	global cnt
	for i in range( g, n):
		v = nums[i]
		j = i - g
		while ( 0 <= j ) and ( v < nums[j] ):
			nums[ j+g ] = nums[j]
			j -= g
			cnt += 1
		nums[ j+g ] = v
		
def shellSort( nums, n ):
	g = []
	v = 1
	while v <= n:
		g.append( v )
		v = 3*v+1     
	g.reverse( )
	m = len( g )
	print( m )
	print( " ".join( map( str, g ) ) )	
	for i in range( m ):
		insertionSort( nums, n, g[i] )

n = int( input( ) )
nums = [ int( input( ) ) for i in range( n ) ]
cnt = 0
shellSort( nums, n )
print( cnt )
for v in nums:
	print( v )

### FIXED CODE ###

import sys
 
def insertionSort( nums, n, g ):
    cnt = 0
    i = g
    while i < n:
        v = nums[i]
        j = i - g
        while 0 <= j and v < nums[j]:
            nums[ j+g ] = nums[j]
            j -= g
            cnt += 1
        nums[ j+g ] = v
        i += 1
    return cnt
         
def shellSort( nums, n ):
    g = []
    val = 1
    while val <= n:
        g.append( val )
        val = 3*val+1
     
    g.reverse( )
    m = len( g )
    print( m )
    print( " ".join( map( str, g ) ) )
    cnt = 0
    for i in range( m ):
        cnt += insertionSort( nums, n, g[i] )
    print( cnt )
     
n = int( sys.stdin.readline( ) )
nums = []
for i in range( n ):
    nums.append( int( sys.stdin.readline( ) ) )
 
shellSort( nums, n )
print( "\n".join( map( str, nums ) ) )
h,w=map(int,input().split())
alh="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in h:
  s=list(input().split())
  if("snuke" in s):
    ind=s.index("snuke")
    print(alh[ind]+str(i+1))
    break

### FIXED CODE ###

h,w=map(int,input().split())
alh="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(h):
  s=list(input().split())
  if("snuke" in s):
    ind=s.index("snuke")
    print(alh[ind]+str(i+1))
    break
N, M = [int(i) for i in input().strip().split(' ')]

a = {}
b = {}
for i in range(M):
  X, Y, Z = [int(i) for i in input().strip().split(' ')]
  if X not in a:
    a[X] = set()
    b[X] = 0
  if Y not in a:
    a[Y] = set()
    b[Y] = 0

  a[X].add(Y)
  b[X] += 1
  a[Y].add(X)
  b[Y] += 1

b = sorted(list(b.items()), key=lambda e: e[1], reverse=True)


def make_keys(keys, key):
  if key in keys:
    return
  keys.add(key)
  for k in a[key]:
    make_keys(keys, k)


counter = 0
#print(b)
for key, v in b:
  if key not in a:
    continue
  keys = set()
  make_keys(keys, key)

  for k in keys:
    del a[k]

  counter += 1

print(counter + N - len(b))

### FIXED CODE ###

N, M = [int(i) for i in input().strip().split(' ')]

a = {}
for i in range(M):
  X, Y, _ = [int(i) for i in input().strip().split(' ')]
  if X not in a: a[X] = set()
  if Y not in a: a[Y] = set()
  a[X].add(Y)
  a[Y].add(X)

len_a = len(a)


def test(key_set):
  tmp = set()
  for key in key_set:
    if key in a:
      tmp = tmp.union(a[key])
      del a[key]

  #print('key_set = {}, tmp = {}'.format(key_set, tmp))
  return tmp


counter = 0
# print(b)

while len(a) > 0:
  #print('---')
  #print('a = {}'.format(a))
  key, key_set = a.popitem()
  #print('key = {}, key_set = {}'.format(key, key_set))
  tmp = test(key_set)
  while len(tmp) > 0:
    tmp = test(tmp)
  #print('a = {}'.format(a))
  counter += 1

print(counter + N - len_a)
X, Y, Z = map(int, input().split())

num_5 = 0
num_7 = 0

if X == 5:
  num_5 += 1
if Y == 5:
  num_5 += 1
if Z == 5:
  num_5 += 1
  
if X == 7:
  num_7 += 1
if Y == 7:
  num_7 += 1
if Z == 7:
  num_7 += 1

if num_5 == 2 && num_7 == 1:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

X, Y, Z = map(int, input().split())
 
num_5 = 0
num_7 = 0
 
if X == 5:
  num_5 += 1
if Y == 5:
  num_5 += 1
if Z == 5:
  num_5 += 1
  
if X == 7:
  num_7 += 1
if Y == 7:
  num_7 += 1
if Z == 7:
  num_7 += 1
  
if num_5 == 2 and num_7 == 1:
    print("YES")
else:
    print("NO")
s=input()
Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')

### FIXED CODE ###

s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')
a = int(input())
b = int(input())
c = int(input())
x = int(input())

cnt = 0

for h in range(0,c):
  for i in range(0,b):
    for j in range(0,a):
      if (x == (500 * j + 100 * i + 50 * h))
      	cnt = cnt +1

  print(cnt)


### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
x = int(input())

cnt = 0

for h in range(0,c+1):
  for i in range(0,b+1):
    for j in range(0,a+1):
      if (x == ((500 * j) + (100 * i) + (50 * h))):
      	cnt = cnt +1

print(cnt)
N,T=input().split()
a=0
b=0
for i in range(int(N)):
    c,t=input().split()
    if int(t)<=int(T):
        if b==0:
            a=c
            b+=1
        if int(c)<int (a):
            a=c
            i+=1
if a==0:

### FIXED CODE ###

n, t = [int(x) for x in input().split()]
result = 1001
for i in range(n):
    a, b = [int(x) for x in input().split()]
    if b <= t and result >= a:
        result = a
if result < 1001:
    print(result)
else:
    print("TLE")
a, b = input().split()

import math

c = a + b
d = math.sqrt(c)

if(c == d**2):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a, b = input().split()

import math

c = int(a + b)
d = math.sqrt(c)
e = int(math.sqrt(c))
diff = d - e

if(diff == 0):
    print('Yes')
else:
    print('No')
N = int(input())
red_point=[]
blue_point=[]
for i in range(N):
    red_point.append(list(map(int,input().split())))
for i in range(N):
    blue_point.append(list(map(int,input().split())))
red_point.sort(reverse=True)
blue_point.sort()
# print(blue_point)
ans = 0
temp = 0 
# print(red_point)
for i in range(N):
    redx,redy=red_point[i][0],red_point[i][1]
    for j in range(len(blue_point)):
        # print("({},{})".format(i,j))
        # print(blue_point)
        bluex,bluey=blue_point[j][0],blue_point[j][1]
        if redx<bluex and redy<bluey:
            if temp<redx:
                temp = redx
                tempj=j   
            ans +=1
            # red_point.pop(i)
            blue_point.pop(tempj)
            # break
print(ans)

### FIXED CODE ###

N = int(input())
red_point=[]
blue_point=[]
for i in range(N):
    red_point.append(list(map(int,input().split())))
for i in range(N):
    blue_point.append(list(map(int,input().split())))
red_point.sort(reverse=True)
blue_point.sort(key=lambda x:x[1])
# print(blue_point)
ans = 0
# temp = 0 
# print(red_point)
for i in range(N):
    redx,redy=red_point[i][0],red_point[i][1]
    for j in range(len(blue_point)):
        # print("({},{})".format(i,j))
        # print(blue_point)
        bluex,bluey=blue_point[j][0],blue_point[j][1]
        if redx<bluex and redy<bluey:
            # if temp<redx:
                # temp = redx
                # tempj=j   
            ans +=1
            # red_point.pop(i)
            blue_point.pop(j)
            break
print(ans)
import math

A, B = input().split(' ')

B = round(B * 100)
print(math.floor(A * B // 100))

### FIXED CODE ###

import math

A, B = input().split(' ')

A = int(A)
B = round(float(B) * 100)
print(math.floor(A * B // 100))
import numpy as np
N=int(input())
list_N=np.array(list(range(1,N)))
print(int(np.sum(list_N)))


### FIXED CODE ###

N=int(input())-1
if N%2==0:
	print(int(N/2)*(N+1))
else:
  	print((N)*int((N+1)/2))
import numpy as np

N ,M= map(int,input().split())
n0 = 2**int(np.ceil(np.log2(2*N - 1)))

A = np.zeros(n0)
B=np.zeros(n0)
l=list(map(int,input().split()))

for i in range(N):
    A[i]=l[i]
    B[i]=l[i]

C = np.fft.ifft( np.fft.fft(A)*np.fft.fft(B) )
ans=0
j=1
q=[]
for ci in np.real(C[:2*N - 1] + 0.5):
    #ans+=int(ci)*j
    q.append([ci,j])
    j+=1
q.reverse()
z=0
j=0
while z<M:
    ans+=q[j][0]*q[j][1]
    j+=1
    z+=q[j][0]
ans-=(z-M)*q[j][1]
print(ans)


### FIXED CODE ###

import numpy as np

N ,M= map(int,input().split())
l=list(map(int,input().split()))
n0 = 2**int(np.ceil(np.log2(2*(max(l))-1)))

A = np.zeros(n0)
#B=np.zeros(n0)
#l=list(map(int,input().split()))

for i in range(N):
    A[l[i]-1]+=1
   # B[i]=l[i]

C = np.fft.ifft( np.fft.fft(A)*np.fft.fft(A) )
ans=0
j=2
q=[]
for ci in np.real(C[:2*(max(l))-1] + 0.5):
    #ans+=int(ci)*j
    q.append([int(ci),j])
    j+=1
q.reverse()
#print(q)
z=0
j=0
while z<M:
    ans+=q[j][0]*q[j][1]
    z+=q[j][0]
    j+=1
ans-=(z-M)*q[j-1][1]
print(ans)
test

### FIXED CODE ###

N, M = map(int, input().split())
print(N*(N-1)//2 + M*(M-1)//2)
A=int(input())
B=int(input())
print(['Yay!',':('][A>8 or B>8])

### FIXED CODE ###

A,B=map(int,input().split())
print(['Yay!',':('][A>8 or B>8])
mod=10**9+7

x,y=map(int,input().split())
if (x+y)%3!=0:
  print(0)
  exit()
  
z=(x+y)//3

x-=z
y-=z

n=x+y
r=x


lst=[0]+[1]
for i in range(2,n+10):
  lst.append((lst[-1]*i)%mod)


xxx=lst[n]
xxx*=pow(lst[n-r],10**9+5,mod)
xxx%=mod
xxx*=pow(lst[r],10**9+5,mod)
xxx%=mod

print(xxx)

### FIXED CODE ###

mod=10**9+7

x,y=map(int,input().split())
if (x+y)%3!=0:
  print(0)
  exit()
  
if x*2<y or y*2<x:
  print(0)
  exit()
  
z=(x+y)//3

x-=z
y-=z

n=x+y
r=x

if x==0 or y==0:
  print(1)
  exit()
  

lst=[0]+[1]
for i in range(2,n+10):
  lst.append((lst[-1]*i)%mod)


xxx=lst[n]
xxx*=pow(lst[n-r],10**9+5,mod)
xxx%=mod
xxx*=pow(lst[r],10**9+5,mod)
xxx%=mod

print(xxx)
s=input()
n=len(s)
a=0
p=''
while i<n:
  if s[i]==p:
    i+=2
  else:
    i+=1
  a+=1
print(a)

### FIXED CODE ###

from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations,groupby
import sys
import bisect
import string
import math
import time
import random
def S_():
    return input()
def LS():
    return [i for i in input().split()]
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)]
        rt+=[s]
    return rt
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
#sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()

def ran_input():
    import random
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

show_flg=False
show_flg=True

ans=1

s=StoI()
n=len(s)
dp=[[0]*n for i in range(2)]

for i in range(n):
    if i==0:
        dp[0][i]=1
    elif i==1:
        if s[1]==s[0]:
            dp[0][i]=0
            dp[1][i]=1
        else:
            dp[0][i]=2
            dp[1][i]=1
    else:
        if s[i]==s[i-1]:
            dp[0][i]=dp[1][i-1]+1
            dp[1][i]=max(dp[0][i-2],dp[1][i-2])+1
        else:
            dp[0][i]=max(dp[0][i-1],dp[1][i-1])+1
            dp[1][i]=max(dp[0][i-2],dp[1][i-2])+1

ans=max(dp[0][n-1],dp[1][n-1])
print(ans)
if A==5 and B==5 and C==7:
  print('Yes')
elif A==5 and B==7 and C==5:
  print('Yes')
elif A==7 and B==5 and C==5:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b,c=map(int,input().split())
s=a+b+c
if s == 17:
  print('YES')
else:
  print('NO')
a=[int(i) for i in input()]
for i in range(len(a)-1):
	b=str(a[i])+str(a[i+1])
	int(b)
c=int(sum(a))
b=int(b)
if b%c==0:
	print("Yes")
else:
	print('No')


### FIXED CODE ###

a=[int(i) for i in input()]
b=""
for i in range(len(a)):
	b=b+str(a[i])
	int(b)
c=int(sum(a))
b=int(b)
#print(c)
#print(b)
if b%c==0:
	print("Yes")
else:
	print('No')
MOD = 10**9+7 #const

def repeat(n,p):
    if p == 0:
        return 1
    if p%2==0:
        t = repeat(n,p//2)
        return t * t % MOD
    return n * repeat(n,p-1) % MOD


def com(n,r):
    if n < r or n < 0:
        return 0
    if n == 0 and r == 0:
        return 1
    fact = [0] * (n+1)
    fact[0] = 1
    for i in range(n):
        fact[i+1] = fact[i] * (i+1) % MOD #階乗計算
    f_inv = repeat(fact[r],MOD-2)
    f = repeat(fact[n-r],MOD-2)

    return fact[n] * f_inv * f % MOD


def main():
    x,y = map(int,input().split())
    if (x+y)%3 != 0:
        print(0)
    n = (2*y - x)//3
    m = (2*x - y)//3
    print(com(n+m,n))


if __name__ == "__main__":
    main()


### FIXED CODE ###

INF = float("inf") #const
MOD = 10**9+7 #const
MAX = 510000 #const

def repeat(n,p):
    if p == 0:
        return 1
    if p%2==0:
        t = repeat(n,p//2)
        return t * t % MOD
    return n * repeat(n,p-1) % MOD


def com(n,r):
    if n < r or n < 0:
        return 0
    if n == 0 and r == 0:
        return 1
    fact = [0] * (10**6+1)
    fact[0] = 1
    for i in range(n):
        fact[i+1] = fact[i] * (i+1) % MOD #階乗計算
    f_inv = repeat(fact[r],MOD-2)
    f = repeat(fact[n-r],MOD-2)
    return fact[n] * f_inv * f % MOD


def main():
    x,y = map(int,input().split())
    if (x+y)%3 != 0:
        print(0)
        return
    n = (2*y - x)//3
    m = (2*x - y)//3
    print(com(n+m,n))


if __name__ == "__main__":
    main()
while H!=0 and W!=0:
  H,W = map(int, input().split())

  for i in range(H):
    for j in range(W):
      print('#', end="")
    print()
  print()
  if W==0 and H==0:
    break


### FIXED CODE ###

while True:
  H,W = map(int, input().split())
  if W==0 and H==0:
   break
  for i in range(H):
    for j in range(W):
      print('#', end="")
    print()
  print()
N = int(input())
As = [int(x) for x in input().split()]
p = []
n = 0
k = 0
while n < len(As) - 1:
 if As[n]<As[n + 1]:
  #print(As[n] ,"<",As[n + 1],k)
  k = 0
 if As[n]>As[n + 1]:
  #print(As[n] ,">",As[n + 1],k)
  k = k + 1
 if As[n]==As[n + 1]:
  #print(As[n] ,"=",As[n + 1],k)
  k = k + 1
 p.append(k)
 n = n + 1

print(max(p)%1000000007)
    


### FIXED CODE ###

N = int(input())
As = [int(x) for x in input().split()]
n = 0
k = 0
mac = 0
while n < len(As) - 1:
 if As[n]<As[n + 1]:
  #print(As[n] ,"<",As[n + 1],k)
  k = 0
 if As[n]>As[n + 1]:
  #print(As[n] ,">",As[n + 1],k)
  k = k + 1
 if As[n]==As[n + 1]:
  #print(As[n] ,"=",As[n + 1],k)
  k = k + 1
 mac = max(k,mac)
 n = n + 1

print(mac%1000000007)
from collections import deque
H, W = map(int, input().split())
C = list(map(int, input().split()))
D = list(map(int, input().split()))
S = [list(map(str, input())) for _ in range(H)]
T = [[-1 for _ in range(W)] for __ in range(H)] #その点にスタート地点から到達するためのワープの回数
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
ddx = [1,1,-1,-1,2,2,2,2,2,1,1,0,0,-1,-1,-2,-2,-2,-2,-2]
ddy = [1,-1,1,-1,-2,-1,0,1,2,2,-2,-2,2,-2,2,-2,-1,0,1,2]
def dfs(y,x,warp):
  # 移動Aで行けるところを埋める
  T[y][x] = warp
  for i in range(4):
    nx = x + dx[i]
    ny = y + dy[i]
    if 0 <= nx < H and 0 <= ny < W:
      if S[ny][nx] != "#" and T[ny][nx] == -1:
        dfs(ny,nx,warp)
  for i in range(len(ddx)):
    nx = x + ddx[i]
    ny = y + ddy[i]
    if 0 <= nx < H and 0 <= ny < W:
      if S[ny][nx] != "#" and T[ny][nx] == -1:
        dfs(ny,nx,warp+1)
  

dfs(C[0]-1,C[1]-1,0)
print(T[D[0]-1][D[1]-1])

### FIXED CODE ###

from collections import deque
f_inf = float('inf')
H, W = map(int, input().split())
sh, sw = map(int, input().split())
sh, sw = sh-1, sw-1
eh, ew = map(int, input().split())
eh, ew = eh-1, ew-1
S = [list(input()) for _ in range(H)]
m = [[f_inf]*W for _ in range(H)]
m[sh][sw] = 0
que = deque([])
que.appendleft([sh,sw])
while que:
  h, w = que.popleft()
  for dh, dw in ((1,0), (-1,0), (0, 1), (0, -1)):
    next_h, next_w = h + dh, w + dw
    if 0 <= next_h < H and 0 <= next_w < W and S[next_h][next_w] == ".":
        if m[next_h][next_w] > m[h][w]:
          m[next_h][next_w] = m[h][w] # 移動Aで行けるところにmの値を合わせる
          que.appendleft([next_h,next_w])
  for dh in range(-2, 3):
    for dw in range(-2, 3): # 移動Bで行ける範囲
      next_h, next_w = h + dh, w + dw
      if 0 <= next_h < H and 0 <= next_w < W and S[next_h][next_w] == ".":
        if m[next_h][next_w] > m[h][w] + 1: # h,wから移動Aですでに行けているところは更新されない
          m[next_h][next_w] = m[h][w] + 1 
          que.append([next_h, next_w]) # appendleftではなくappend 優先順位が後
print(m[eh][ew] if m[eh][ew] != f_inf else -1)
import sys
input = sys.stdin.readline
import numpy as np

h, w = map(int, input().split())
A = np.array([input().split() for _ in range(h)], dtype=np.int64)
B = np.array([input().split() for _ in range(h)], dtype=np.int64)
D = abs(A-B)
M = D.max()*(h+w-1) + 1
dp = [[0]*w for _ in range(h)]
dp[0][0] = np.zeros(2*M, dtype=bool)
dp[0][0][M-D[0, 0]] = True
dp[0][0][M+D[0, 0]] = True
for i in range(h):
  for j in range(w):
    x = np.zeros(2*M, dtype=bool)
    if not i and not j:
      continue
    if i:
      x[D[i, j]:] |= dp[i-1][j][:-D[i, j]]
      x[:-D[i, j]] |= dp[i-1][j][D[i, j]:]
    if j:
      x[D[i, j]:] |= dp[i][j-1][:-D[i, j]] 
      x[:-D[i, j]] |= dp[i][j-1][D[i, j]:]
    dp[i][j] = x
idx = np.where(dp[-1][-1][M:])
ans = idx[0][0]
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
  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)]
  M = 80*(h+w)
  dp = [[0]*w for i in range(h)]
  d = abs(A[0][0] - B[0][0])
  mask = (1 << (2*M)) - 1
  dp[0][0] |= 1 << (M-d)
  dp[0][0] |= 1 << (M+d)
  for i in range(h):
    for j in range(w):
      d = abs(A[i][j] - B[i][j])
      if i:
        dp[i][j] |= (dp[i-1][j] << d) & mask
        dp[i][j] |= dp[i-1][j] >> d
      if j:
        dp[i][j] |= (dp[i][j-1] << d) & mask
        dp[i][j] |= dp[i][j-1] >> d
  t = dp[-1][-1] >> M
  ans = (t & (-t)).bit_length() - 1
  print(ans)
  
if __name__ == "__main__":
  main()
N,K=map(int,input().split())
wa=0
for i in range(N+1-K):
    n=i+K
    min=(n)*(0+n-1)/2
    max=(n)*(N-n+1+N)/2

    wa=max-min+wa+1


wa=wa+1
wa=wa%(10**9+7)
print(int(wa)


### FIXED CODE ###

import math
a=int(input())
print(2*a*math.pi)
import math
n, m = map(int, input().split())
false_count = [1]*n
ans_false_count = [0]*n
ans_success_count = [0]*n

for i in range(m):
    p, s = input().split()
    p = int(p)
    s = str(s)

    if s=='WA':
        false_count[p-1] = false_count[p-1]*2 
    else:
        ans_false_count[p-1] += false_count[p-1]
        ans_success_count[p-1] = 1
        false_count[p-1] = 0

for j in range(n):
    if false_count[j] != 0:
        false_count = math.log(false_count[j],2)
    if ans_false_count [j] != 0:
        ans_false_count[j] = math.log(ans_false_count[j],2)

new_ans_false_count = false_count + ans_false_count
print(sum(ans_success_count), int(sum(new_ans_false_count)))    

### FIXED CODE ###

import math
n, m = map(int, input().split())
false_count = [1]*n
ans_false_count = [0]*n
ans_success_count = [0]*n

for i in range(m):
    p, s = input().split()
    p = int(p)
    s = str(s)

    if s=='WA':
        false_count[p-1] = int(false_count[p-1]*2)
    else:
        ans_false_count[p-1] += int(false_count[p-1])
        ans_success_count[p-1] = 1
        false_count[p-1] = 0

for j in range(n):
    if ans_false_count [j] != 0:
        ans_false_count[j] = math.log(ans_false_count[j],2)

new_ans_false_count = ans_false_count
print(sum(ans_success_count), int(sum(new_ans_false_count)))
n = int(input())
v = map(int, input().split())
v.sort(reverse = True)
s = 0
for i in range(0, n):
  s += v[1+2*i]
print(s)

### FIXED CODE ###

n = int(input())
v = list(map(int, input().split()))
v.sort(reverse = True)
s = 0
for i in range(0, n):
  s += v[1+2*i]
print(s)