Harryxun/stf_run huggingface dataset:
import sys
s = [s for s in sys.stdin.readline().rstrip()]

ans = 0
if s[0] == '>':
    count = 1
    i = 1
    while s[i] == '>':
        count += 1
        i += 1
    del s[:i]
    ans += (1 + count) * count // 2

if s[-1] == '<':
    count = 1
    i = -2
    while s[i] == '>':
        count += 1
        i -= 1
    del s[i+1:]
    ans += count
    (1 + count) * count // 2

s.append(None)

while s != [None]:
    l_c, r_c = 0, 0
    i = 0
    # if s[i] == '<':
    while s[i] == '<':
        l_c += 1
        i += 1
    del s[:i]

    j = 0
    # if s[j] == '>':
    while s[j] == '>':
        r_c += 1
        j += 1
    del s[:j]

    if l_c >= r_c:
        ans += (1 + l_c) * l_c // 2 + r_c * (r_c - 1) // 2
    else:
        ans += l_c * (l_c - 1) // 2 + (1 + r_c) * r_c // 2

print(ans)

### FIXED CODE ###

import sys
from collections import deque
s = deque(s for s in sys.stdin.readline().rstrip())

s.append(None)
ans = 0
while s[0] != None:
    l_c = 0
    while s[0] == '<':
        l_c += 1
        s.popleft()
    
    r_c = 0
    while s[0] == '>':
        r_c += 1
        s.popleft()

    if l_c >= r_c:
        ans += (1 + l_c) * l_c // 2 + r_c * (r_c - 1) // 2
    else:
        ans += l_c * (l_c - 1) // 2 + (1 + r_c) * r_c // 2

print(ans)
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h)
        print("#" * w)
    print()

### FIXED CODE ###

while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        print("#"*w)
    print("")
import math

K = int(input()) + 1
d = 0

for i in range(1, K):
    for j in range(1, K):
        for k in range(1, K):
            d = gcd(i, j, k) + d
print(d)

### FIXED CODE ###

from math import gcd

K = int(input()) + 1
d = 0

for i in range(1, K):
    for j in range(1, K):
        for k in range(1, K):
            d = gcd(gcd(i, j), k) + d
print(d)
n,m = map(int,input().split())
l = [int(input()) for _ in range(m)]
q = 10**9+7
memo = [-1]*(n+1)
memo[0]=1
def a(x):
  if x in l :
    memo[x]=0
    return 0
  elif x==1:
    memo[1]=1
    return 1
  else:
    if memo[x]!=-1:
      return memo[x]
    else:
      memo[x] = a(x-1)+a(x-2)
      return (a(x-1)+a(x-2))%q
print(a(n)%q)

### FIXED CODE ###

n,m = map(int,input().split())
l = [int(input()) for _ in range(m)]
q = 10**9+7
memo = [-1]*(n+1)
memo[0]=1
su = 0
if 1 in l:
  memo[1]=0
else:
  memo[1]=1
for j in l:
  memo[j]=0
  
for i in range(2,n+1):
  if memo[i]==0:
    continue
  else:
    memo[i]=((memo[i-1]%q)+(memo[i-2]%q))%q
print(memo[-1]%q)
# -*- coding: utf-8 -*-
"""
Created on Mon May 13 09:24:23 2019

@author: avina
"""

s = input().strip()

k = s[0]
cnt_1 = 0;cnt_2 = 1
for i in range(1,len(s)):
    if k == s[i] and i%2 !=0:
        cnt_1+=1
    
    if i%2 ==0 and k != s[i]:
        cnt_1+=1
        e =s[i]

for i in range(1,len(s)):
    
    if e != s[i] and i%2 ==0:
        cnt_2 +=1
    
    if e == s[i] and i%2 != 0:
        cnt_2+=1

print(min(cnt_1, cnt_2))

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Mon May 13 09:24:23 2019

@author: avina
"""

s = input().strip()

k = s[0]
cnt_1 = 0;cnt_2 = 1
for i in range(1,len(s)):
    if k == s[i] and i%2 !=0:
        cnt_1+=1
    
    if i%2 ==0 and k != s[i]:
        cnt_1+=1
if k == '1':
    e = '0'
else :
    e = '1'

for i in range(1,len(s)):
    
    if e != s[i] and i%2 ==0:
        cnt_2 +=1
    
    if e == s[i] and i%2 != 0:
        cnt_2+=1

print(min(cnt_1, cnt_2))
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

N, A, B = iInM()

ans = min(A * N, B)

pritn(ans)

### FIXED CODE ###

###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

N, A, B = iInM()

ans = min(A * N, B)

print(ans)
A, B ,M = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
mina, minb = min(a), min(b)
minv = 10000000000
for _ in range(M):
    x, y, c = [int(i) for i in input().split()]
    x -= 1
    y -= 1
    minv = min(minv, a[x]+a[y]-c)


print(min(minv, mina+minb))

### FIXED CODE ###

A, B, M = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
mina, minb = min(a), min(b)
minv = mina+minb
for _ in range(M):
    x, y, c = [int(i) for i in input().split()]
    x -= 1
    y -= 1
    minv = min(minv, a[x]+b[y]-c)


print(minv)
W,H,x,y= map(int,input().split())
max=W*H/2
if x=W or y=H:
  check=0
else:
  check=1

print(max,check)


### FIXED CODE ###

W,H,x,y = map(int,input().split())
max=W*H/2
xx=W/2
yy=H/2
if xx==x and yy==y:
  check=1
else:
  check=0
  
print(max,check)
a=sorted([int(input()) for _ in range(5)])
ls=sorted([a[i+1]-a[i] for i in range(4)])
print("Yay!" if ls[4]<input() else ":(")

### FIXED CODE ###

a=sorted([int(input()) for _ in range(5)])
print("Yay!" if a[4]-a[0]<=int(input()) else ":(")
from itertools import combinations
n,m,q=map(int,input().split())
aa=[]
bb=[]
cc=[]
dd=[]
for i in range(q):
  a,b,c,d=map(int,input().split())
  aa.append(a-1)
  bb.append(b-1)
  cc.append(c)
  dd.append(d)
sumd=[]
#print(list(combinations(range(1,m+1),n)))
for Alis in combinations(range(1,m+1),n):
  
  di=0
  
  for i in range(q):
    if cc[i]==(Alis[bb[i]]-Alis[aa[i]]):
      di+=dd[i]
      
  sumd.append(di)
print(max(sumd))

### FIXED CODE ###

from itertools import combinations_with_replacement
n,m,q=map(int,input().split())
aa=[]
bb=[]
cc=[]
dd=[]
for i in range(q):
  a,b,c,d=map(int,input().split())
  aa.append(a-1)
  bb.append(b-1)
  cc.append(c)
  dd.append(d)
sumd=[]
#print(list(combinations(range(1,m+1),n)))
for Alis in combinations_with_replacement(range(1,m+1),n):
  
  di=0
  
  for i in range(q):
    if cc[i]==(Alis[bb[i]]-Alis[aa[i]]):
      di+=dd[i]
      
  sumd.append(di)
print(max(sumd))
from sys import stdin
N = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()
sum = 0
cnt = 0
for itr in range(N):
    if s[itr] == '#':
        cnt += 1
        continue
    if cnt > 0:
        sum += 1
        cnt = 0
print(sum)

### FIXED CODE ###

from sys import stdin
s_data = stdin.readline().rstrip().split()
data = [int(itr) for itr in s_data]
A = data[0]
B = data[1]
C = data[2]
if (B <= C and C <= A) or (A <= C and C <= B):
    print('Yes')
else:
    print('No')
N = int(input())

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

flag = "Yes"
cnt = 0
if (N > 1):
  for i in range(len(lst) - 1):
    if (lst[i+1] - lst[i] < 0):
      cnt += 1
    else:
      cnt = 0
      
    if (cnt > 1):
      flag = "No"

print(flag)

### FIXED CODE ###

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

if (A - B >= C):
  print(0)
else:
  print(C - (A - B))
N = int(input())
A = list(map(int, input().split))
print(max(A)- min(A))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
print(max(A)- min(A))
import math
n=int(input())
arr=list(map(int,input().split()))
ans=True

if n%2!=0:
    zero=0
    [zero+=1 for c in arr if c==0]
    if zero!=1:
    	ans=False
    elif len(set(arr))!=int(n/2)+1:
        ans=False
else:
    if 0 in arr:
        ans=False
    elif len(set(arr))!=int(n/2):
        ans=False

if ans:
    print(2**math.floor(n/2)%((10**9)+7))
else:
    print(0)

### FIXED CODE ###

N=int(input())
l=list(map(int,input().split()))
a=1
if N%2==0:
    if len(l)!=len(set(l))*2:
        a=0
else:
    if l.count(0) == 1:
        l.remove(0)
        if len(l) != 2*len(set(l)):
            a = 0
    else:
        a=0
if a:
      print((2**(N//2))%(10**9+7))
else:
      print(0)
#B
n,k = list(map(int,input().split()))
h = list(map(int,input().split()))

cost = [1000000]*n
for i in range(n):
    if i == 0:
        cost[i] = 0
        continue    
    for j in range(1:k+1):
        if i-j>=0:
            cost[i] = min(cost[i],cost[i-j]+abs(h[i]-h[i-j]))
print(cost[n-1])

### FIXED CODE ###

#B
n,k = list(map(int,input().split()))
h = list(map(int,input().split()))

dp = [float('inf')]*n
for i in range(n):
    if i == 0:
        dp[i] = 0
        continue    
    for j in range(1,k+1):
        if i-j>=0:
            dp[i] = min(dp[i],dp[i-j]+abs(h[i]-h[i-j]))
print(dp[n-1])
a, b = [int(elem) for elem in input().split]
print(a * b, (a + b) * 2)


### FIXED CODE ###

a, b = [int(elem) for elem in input().split()]
print(a * b, (a + b) * 2)
import sys
k=int(input())
str_n =input().split()
n=list(map(int,str_n))
a=[]
for i in range(k-1,-1,-1):
    a.append(n[i])
for i in a:
    if i != a[k-1]:
        print(str(i), end=" ")
    else:
        print(str(i))
     

### FIXED CODE ###

raw_input()
l = raw_input().split()
l.reverse()
print " ".join(l)
from scipy import special
n=int(input())
s=[''.join(sorted(input())) for _ in range(n)]
s=sorted(s)
ans=0
c=1
t=s[0]
for i in range(1,n):
    if t==s[i]:
        c+=1
    else:
        ans+=special.comb(c,2,True)
        t=s[i]
        c=1
ans+=special.comb(c,2,True)
print(ans)

### FIXED CODE ###

from scipy import misc
n=int(input())
s=[''.join(sorted(input())) for _ in range(n)]
s=sorted(s)
ans=0
c=1
t=s[0]
for i in range(1,n):
    if t==s[i]:
        c+=1
    else:
        ans+=misc.comb(c,2,True)
        t=s[i]
        c=1
ans+=misc.comb(c,2,True)
print(ans)
N, H = map(int, input().split())
# B = []
A = []
B = []
amax = -1
bmax = -1

for _ in range(N):
    a, b = map(int, input().split())
    # B.append((a,b))
    A.append(a)
    B.append(b)

    if amax < a:
        amax = a
    
    if bmax < b:
        bmax = b

if amax >= bmax:
    m = H % amax
    if m != 0:
        ans = H // amax + 1
    else:
        ans = H // amax

else:
    ans = 0
    throw_lst = list(filter(lambda x: x > amax, B)).sort(reverse=True)

    for tb in throw_lst:
        H -= tb
        ans += 1
        if H <= 0:
            break

    m = H % amax
    if m != 0:
        ans += H // amax + 1
    else:
        ans += H // amax

print(ans)

### FIXED CODE ###

N, H = map(int, input().split())
# B = []
A = []
B = []
amax = -1
bmax = -1

for _ in range(N):
    a, b = map(int, input().split())
    # B.append((a,b))
    A.append(a)
    B.append(b)

    if amax < a:
        amax = a
    
    if bmax < b:
        bmax = b

if amax >= bmax:
    m = H % amax
    if m != 0:
        ans = H // amax + 1
    else:
        ans = H // amax

else:
    ans = 0
    throw_lst = list(filter(lambda x: x > amax, B))
    throw_lst.sort(reverse=True)

    for tb in throw_lst:
        H -= tb
        ans += 1
        if H <= 0:
            print(ans)
            exit(0)

    m = H % amax
    if m != 0:
        ans += H // amax + 1
    else:
        ans += H // amax

print(ans)
X = int(input())
A = 1
K = 1
while K < X:
    A += 1
    K = A ** 5
w = 0
while w != 1:
    P = S ** 5
    Q = P - X
    B = 0
    while (Q < B**5):
        B += 1
    if (Q == B**5):
        w += 1
    else:
        S += 1

        
print(S,B)

### FIXED CODE ###

X = int(input())
for i in range (240):
    for j in range (240):
        s = (i -120)**5 - (j -120)**5
        if s == X:
            A = i-120
            B = j -120
print(A,B)
import math
x1,y1,x2,y2 = map(int,input().split())
print("{0:.8f}".format(math.sqrt((x1-x2)**2+(y1-y2)**2)))

### FIXED CODE ###

import math
x1,y1,x2,y2 = map(float,input().split())
print("{0:.8f}".format(math.sqrt((x1-x2)**2+(y1-y2)**2)))
while True:
    H,W= map(int, input().split())
    s = "#"
    for i in range(H):
        if H==0 and W==0:
            break
        else:
            x = s*W
            print(x)
    print("")
              

### FIXED CODE ###

while True:
    H,W= map(int, input().split())
    if H==0 and W==0:
        break
    s = "#"
    for i in range(H):        
        x = s*W
        print(x)
    print("")
x=input()
float(y)= sqrt(x)
z= y//1
print(z)

### FIXED CODE ###

import math
x=int(input())
y= math.sqrt(x)
z= y//1
a=z**2
print(int(a))
n = int(input())
if n % 2 == 1:
  print((n-1)//2)
else:
  print(n-2)//2)

### FIXED CODE ###

n = int(input())
if n % 2 == 1:
  print((n-1)//2)
else:
  print((n-2)//2)
A,B,K = map(int,input().split())

if K>B-A-1:
  K=B-A
  
ans=[]
for i in range(K):
  ans.append(A+i)
for i in range(B-K,B):
  ans.append(i+1)
#print(ans)

n=len(ans)
print(ans[0])
for i in range(1,n):
  if ans[i]!=ans[i-1]:
    print(ans[i])
  

### FIXED CODE ###

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

if A+K-1< B-K+1:
  for i in range(A,A+K):
    print(i)
  for i in range(B-K+1,B+1):
    print(i)
elif A+K-1>= B-K+1:
  for i in range(A,B+1):
    print(i)
t=list(map(int,input().split()))
a=list(map(int,input().split()))
b=list(map(int,input().split()))
p,q=[0],[0]
x,y=[(a[0]-b[0])*t[0],(a[1]-b[1])*t[1]]
if x+y==0:
    print("infinity")
elif (x<0 and y<0) or (x>0 and y>0):
    print(0)
elif (x<0 and x+y>0) or (x>0 and x+y<0):
    print(1)
else:
    print(hhh)

### FIXED CODE ###

T1, T2 = map(int, input().split())
A1, A2 = map(int, input().split())
B1, B2 = map(int, input().split())
 
P = (A1 - B1) * T1
Q = (A2 - B2) * T2
if P > 0:
	P *= -1
	Q *= -1
 
if P + Q < 0:
	print(0)
elif P + Q == 0:
	print("infinity")
else:
	S = (-P) // (P + Q)
	T = (-P) % (P + Q)
	if T != 0:
		print(S * 2 + 1)
	else:
		print(S * 2)
import math

n,k = map(int,input().split())
li = [int(i) for i in input().split()]
a = li.index(4)
k -= 1
n -= 1
left = math.ceil(a/k)
right = math.ceil((n-a)/k)
print(left+right)

### FIXED CODE ###

import math

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

print(math.ceil((n-1)/(k-1)))
ant
obe
rec

### FIXED CODE ###

a = input()
b = input()
c = input()

print( a[0] + b[1] + c[2] )
n = int(input())
d = list(int, input().split())
res = 0

d.sort()
first = d[0]

for i in range(1, n):
  if first > d[i]:
    res += 1
  first = d[i]
  
print(res)

### FIXED CODE ###

n = int(input())
d = [int(input()) for i in range(n)]
res = 1

d.sort()
first = d[0]

for i in range(1, n):
  if first < d[i]:
    res += 1
  first = d[i]
  
print(res)
S = list( input() )
dif = [ int( S[1]-S[0] ), int( S[2]-S[1] ), int( S[3]-S[2] ) ]
if 0 in dif: 
   print( "Good" )
else : 
   print( "Bad" )

### FIXED CODE ###

S = list( input() )
for i in range( len(S) - 1 ) : 
    if S[i] == S[i+1] : 
       print( "Bad" )
       break
else : 
    print( "Good" )
import bisect
n,m=map(int,input().split())
l=list(map(int,input().split()))
l.sort()
r=[0]*(10**5+2)
for i in range(n):
    r[l[i]]+=1
for i in range(10**5+1):
    r[i+1]+=r[i]
ok=10**11
ng=0
while ok-ng>1:
    x=(ok+ng)//2
    k=0
    for i in range(n):
        if x-l[i]<0:
            k+=n
        elif x-l[i]>10**5+1:
            continue
        else:
            k+=r[x-l[i]]
    if k>=m:
        ng=x
    else:
        ok=x
p=[0]*(n+1)
for i in range(n):
    p[i+1]=p[i]+l[i]
ans=0
for i in range(n):
    li=bisect.bisectleft(l,ok-l[i])
    ans+=l[i]*(n-li)+p[n]-p[li]
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)
x,n = (int(x) for x in input().split())
p = [int(x) for x in input().split()]

result = 100

l = list(range(0,6))



if len(p) == 0:
    kotae = x
else:
    for i in range(len(p)):

        l[p[i]] = 200


    for i in reversed(range(len(l))):
     
  

        if l[i] != 200:

            if result >= abs(l[i] - x):
                result = abs(l[i] - x)
               
                kotae = l[i]
          
            



print(kotae)

### FIXED CODE ###

x,n = (int(x) for x in input().split())
p = [int(x) for x in input().split()]

result = 100

l = list(range(0,102))



if len(p) == 0:
    kotae = x
else:
    for i in range(len(p)):

        l[p[i]] = ""



    for i in reversed(range(len(l))):
     
        if l[i] != "":

            if result >= abs(l[i] - x):
                result = abs(l[i] - x)
               
                kotae = l[i]          
            
print(kotae)
def main():
    s = list(input())
    t = list(input())

    common = 0
    max_common = 0
    for t_ind in range(len(t)):
        for char in s:
            if not common and char == t[t_ind]:
                common += 1
            elif char == t[common]:
                common += 1
            else:
                if common and common > max_common:
                    max_common = common
                common = 0
    print(len(t) - max_common)

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    s = input()
    t = input()
    ans = 100000
    for i in range(len(s) - len(t) + 1):
        sub = s[i:i+len(t)]
        tmp = 0
        for j in range(len(sub)):
            if sub[j] != t[j]:
                tmp += 1
        ans = min([ans, tmp])
    print(ans)


if __name__ == '__main__':
    main()
from math import factorial

def comb(n, r):
    if n < r:
        return 0
    return (factorial(n) // (factorial(n-r) * factorial(r)))

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

for i in range(1, k+1):
    print(comb(n-k+1, i) * comb(k-1, i-1) % (10**9+7))

### FIXED CODE ###

from collections import Counter

s = input()

c = Counter(s)

if len(c) == 2:
    print('Yes')
else:
    print('No')
x = input()
print(x**3)


### FIXED CODE ###

x = input()
print(x**3)
import collections
n = int(input())
a = list(map(int,input().split()))
mae = []
usi = []
for i in range(0,n,2):
  mae.append(a[i])
for i in range(1,n,2):
  usi.append(a[i])
mae = collections.Counter(mae)
usi = collections.Counter(usi)
mae = mae.most_common()
usi = usi.most_common()
if mae[0][0] != usi[0][0]:
  print(n-mae[0][1]-usi[0][1])
else:
  try:
    t = mae[0][1] + usi[1][1]
  except:
    t = 0
  try:
    s = mae[1][1] + usi[0][1]
  except:
    s = 0
  u = mae[0][1]
  print(n-max(t,s,u))

### FIXED CODE ###

import sys
n,k = map(int, sys.stdin.readline().split())
ans = 0
a = n//k
ans += a*(a-1)*(a-2)+a*(a-1)*3+a
if k %2 == 0:
    a = n//k
    if n %k >= k/2:
        a+=1
    ans += a*(a-1)*(a-2)+a*(a-1)*3+a
print(ans)
while True:
    try:
        s=input().split(" ")
        s.sort
        if s[0]**2+s[1]**2=s[2]**:
            print("YES")
        else:
            print("NO")

### FIXED CODE ###

n=int(input())
for i in range(n):
        s=input().split(" ")
        s=[int(j) for j in s]
        s.sort()
        
        if(s[0]**2+s[1]**2==s[2]**2):
            print("YES")

        else:
            print("NO")
a = int(input())
print(a+pow(a,2)+pow(a,3)

### FIXED CODE ###

a = int(input())
print(a+a*a+a*a*a)
# https://juppy.hatenablog.com/entry/2019/04/10/ARC061_-_E_%E3%81%99%E3%81%AC%E3%81%91%E5%90%9B%E3%81%AE%E5%9C%B0%E4%B8%8B%E9%89%84%E6%97%85%E8%A1%8C_-_Python_%E7%AB%B6%E6%8A%80%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0_Atcoder
# 参考にさせていただきました。

from collections import deque, defaultdict

chg = 10**6
n, m = map(int, input().split())
edges = defaultdict(set)
visited = dict()
for i in range(m):
    p, q, c = map(int, input().split())
    edges[p+c*chg].add(q+c*chg)
    edges[q+c*chg].add(p+c*chg)
    edges[p].add(p+c*chg)
    edges[q].add(q+c*chg)
    edges[p+c*chg].add(p)
    edges[q+c*chg].add(q)
    visited[p] = False
    visited[q] = False
    visited[p+c*chg] = False
    visited[q+c*chg] = False

ans = float("inf")
que = deque()
# now, dist
que.append((1, 0))
# 今求めるのはendの距離だけなので、dist配列はいらない
# さらに、距離は0/1なのでheapで辺を管理する必要もなく、0なら最短確定なので先に、1ならその時点での最長なので後ろにすれば良い
while que:
    now, dist = que.popleft()
    if visited[now]:
        continue
    visited[now] = True
    if now == n:
        ans = dist
        break
    for to in edges[now]:
        # 駅→ホーム
        if now < chg and to > chg:
            que.append((to, dist+1))
        else:
            que.appendleft((to, dist))
if ans == float("inf"):
    print(-1)
else:
    print(ans)

### FIXED CODE ###

# https://juppy.hatenablog.com/entry/2019/04/10/ARC061_-_E_%E3%81%99%E3%81%AC%E3%81%91%E5%90%9B%E3%81%AE%E5%9C%B0%E4%B8%8B%E9%89%84%E6%97%85%E8%A1%8C_-_Python_%E7%AB%B6%E6%8A%80%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0_Atcoder
# 参考にさせていただきました。

from collections import deque, defaultdict

chg = 10**6
n, m = map(int, input().split())
edges = defaultdict(set)
# m=0のためにdefaultdictにしておくべき
visited = defaultdict(set)
for i in range(m):
    p, q, c = map(int, input().split())
    edges[p+c*chg].add(q+c*chg)
    edges[q+c*chg].add(p+c*chg)
    edges[p].add(p+c*chg)
    edges[q].add(q+c*chg)
    edges[p+c*chg].add(p)
    edges[q+c*chg].add(q)
    visited[p] = False
    visited[q] = False
    visited[p+c*chg] = False
    visited[q+c*chg] = False

ans = float("inf")
que = deque()
# now, dist
que.append((1, 0))
# 今求めるのはendの距離だけなので、dist配列はいらない
# さらに、距離は0/1なのでheapで辺を管理する必要もなく、0なら最短確定なので先に、1ならその時点での最長なので後ろにすれば良い
while que:
    now, dist = que.popleft()
    if visited[now]:
        continue
    visited[now] = True
    if now == n:
        ans = dist
        break
    for to in edges[now]:
        # 駅→ホーム
        if now < chg and to > chg:
            que.append((to, dist+1))
        else:
            que.appendleft((to, dist))
if ans == float("inf"):
    print(-1)
else:
    print(ans)
n, m = map(int, input().split())
es = [[] for _ in range(n)]
for _ in range(m):
  s, t = map(int, input().split())
  es[s].append(t)
  es[t].append(s)
for i in range(n):
  print(len(list(set(es[i]))))
  


### FIXED CODE ###

n, m = map(int, input().split())
es = [[] for _ in range(n)]
for _ in range(m):
  s, t = map(int, input().split())
  es[s-1].append(t-1)
  es[t-1].append(s-1)
for i in range(n):
  print(len(es[i]))
N =int(raw_input())
V =map(int ,raw_input().split())
C =map(int ,raw_input().split())
V = V-C
v = 0
for i in range(N):
    if V[i]>0:
        v = v+V[i]
print v

### FIXED CODE ###

N =int(raw_input())
V =map(int ,raw_input().split())
C =map(int ,raw_input().split())
v = 0
for i in range(N):
    if V[i]-C[i]>0:
        v = v+V[i]-C[i]
print v