Harryxun/stf_run huggingface dataset:
import math
H,W=map(int,input().split())
if H%3==0 or W%3==0:
  print(0)
  exit(0)
S=[0]*3
s=H*import math
H,W=map(int,input().split())
if H%3==0 or W%3==0:
  print(0)
  exit(0)
S=[0]*3
s=H*W/3
w0=math.ceil(s/H)
h0=math.ceil(s/W)

S[0]=w0*H
w1=W-W/3
w0=math.ceil(s/H)
h0=math.ceil(s/W)

S[0]=w0*H
w1=W-w0
if w1%2==0 or H%2==0:
  S[1]=(H*w1)//2
  S[2]=(H*w1)//2
else:
  s1=H*w1/2
  w10=math.ceil(s1/H)
  h10=math.ceil(s1/w1)
  S[2]=max((w1-w10)*H,(H-h10)*w1)
ans=abs(S[0]-S[2])

S[0]=W*h0
h1=H-h0
if h1%2==0 or W%2==0:
  S[1]=(W*h1)//2
  S[2]=(W*h1)//2
else:
  s1=h1*W/2
  w11=math.ceil(s1/h1)
  h11=math.ceil(s1/W)
  S[2]=max((W-w11)*h1,(h1-h11)*W)
ans=min(ans,abs(S[0]-S[2]))


S=[0]*3
s=H*W/3
w0=math.floor(s/H)
h0=math.floor(s/W)

S[0]=w0*H
w1=W-w0
if w1%2==0 or H%2==0:
  S[1]=(H*w1)//2
  S[2]=(H*w1)//2
else:
  s1=H*w1/2
  w10=math.floor(s1/H)
  h10=math.floor(s1/w1)
  S[2]=max((w1-w10)*H,(H-h10)*w1)
ans=min(ans,abs(S[0]-S[2]))

S[0]=W*h0
h1=H-h0
if h1%2==0 or W%2==0:
  S[1]=(W*h1)//2
  S[2]=(W*h1)//2
else:
  s1=h1*W/2
  w11=math.floor(s1/h1)
  h11=math.floor(s1/W)
  S[2]=max((W-w11)*h1,(h1-h11)*W)
ans=min(ans,abs(S[0]-S[2]))

print(ans)

### FIXED CODE ###

import math
H,W=map(int,input().split())
if H%3==0 or W%3==0:
  print(0)
  exit(0)
S=[0]*3
s=H*W/3
w0=math.ceil(s/H)
h0=math.ceil(s/W)

S[0]=w0*H
w1=W-W/3
w0=math.ceil(s/H)
h0=math.ceil(s/W)

S[0]=w0*H
w1=W-w0
if w1%2==0 or H%2==0:
  S[1]=(H*w1)//2
  S[2]=(H*w1)//2
else:
  s1=H*w1/2
  w10=math.ceil(s1/H)
  h10=math.ceil(s1/w1)
  S[2]=max((w1-w10)*H,(H-h10)*w1)
ans=abs(S[0]-S[2])

S[0]=W*h0
h1=H-h0
if h1%2==0 or W%2==0:
  S[1]=(W*h1)//2
  S[2]=(W*h1)//2
else:
  s1=h1*W/2
  w11=math.ceil(s1/h1)
  h11=math.ceil(s1/W)
  S[2]=max((W-w11)*h1,(h1-h11)*W)
ans=min(ans,abs(S[0]-S[2]))


S=[0]*3
s=H*W/3
w0=math.floor(s/H)
h0=math.floor(s/W)

S[0]=w0*H
w1=W-w0
if w1%2==0 or H%2==0:
  S[1]=(H*w1)//2
  S[2]=(H*w1)//2
else:
  s1=H*w1/2
  w10=math.floor(s1/H)
  h10=math.floor(s1/w1)
  S[2]=max((w1-w10)*H,(H-h10)*w1)
ans=min(ans,abs(S[0]-S[2]))

S[0]=W*h0
h1=H-h0
if h1%2==0 or W%2==0:
  S[1]=(W*h1)//2
  S[2]=(W*h1)//2
else:
  s1=h1*W/2
  w11=math.floor(s1/h1)
  h11=math.floor(s1/W)
  S[2]=max((W-w11)*h1,(h1-h11)*W)
ans=min(ans,abs(S[0]-S[2]))

print(ans)
from collections import Counter
N, M = map(int, input().split())
groups = [0] * (N + 1)
group_num_list = [[0]]
group_num = 1
for _ in range(M):
    A, B = map(int, input().split())
    if groups[A] != 0 and groups[B] != 0:
        if groups[A] != groups[B]:
            lower = min(groups[A], groups[B])
            higher = max(groups[A], groups[B])
            for i in group_num_list[higher]:
                groups[i] = lower
            tmp = group_num_list[higher]
            group_num_list[lower].extend(tmp)
            # del group_num_list[higher]
    elif groups[A] != 0:
        groups[B] = groups[A]
        group_num_list[groups[A]].append(int(B))
    elif groups[B] != 0:
        groups[A] = groups[B]
        group_num_list[groups[B]].append(int(A))
    else:
        groups[A] = group_num
        groups[B] = group_num
        group_num_list.append([int(A), int(B)])
        group_num += 1
counter = Counter(groups)
# print(collection)
# print(group_num_list)
if counter.most_common()[0][0] != 0:
    print(counter.most_common()[0][1])
else:
    print(counter.most_common()[1][1])


### FIXED CODE ###

from collections import Counter
N, M = map(int, input().split())
groups = [0] * (N + 1)
group_num_list = [[0]]
group_num = 1
for _ in range(M):
    A, B = map(int, input().split())
    if groups[A] != 0 and groups[B] != 0:
        if groups[A] != groups[B]:
            lower = min(groups[A], groups[B])
            higher = max(groups[A], groups[B])
            for i in group_num_list[higher]:
                groups[i] = lower
            tmp = group_num_list[higher]
            group_num_list[lower].extend(tmp)
            # del group_num_list[higher]
    elif groups[A] != 0:
        groups[B] = groups[A]
        group_num_list[groups[A]].append(int(B))
    elif groups[B] != 0:
        groups[A] = groups[B]
        group_num_list[groups[B]].append(int(A))
    else:
        groups[A] = group_num
        groups[B] = group_num
        group_num_list.append([int(A), int(B)])
        group_num += 1
counter = Counter(groups)
# print(collection)
# print(group_num_list)
if len(group_num_list) == 1:
    print(1)
elif int(counter.most_common()[0][0]) != 0:
    print(counter.most_common()[0][1])
else:
    print(counter.most_common()[1][1])
SD = input()
T = input()

ans = ''

for i in range(0, len(SD) - len(T)+1):
    flg = True
    for j in range(len(T)):
        if SD[i+j] == '?' or SD[i+j] == T[j]:
            continue
        else:
            flg = False
    if flg == True:
        ans = SD[:i] + T + S[i+len(T):]
            
if ans:
    ans = ans.replace('?', 'a')
else:
    ans = 'UNRESTORABLE'
    
print(ans)

### FIXED CODE ###

SD = input()
T = input()

ans = ''

for i in range(0, len(SD) - len(T)+1):
    flg = True
    for j in range(len(T)):
        if SD[i+j] == '?' or SD[i+j] == T[j]:
            continue
        else:
            flg = False
    if flg == True:
        ans = SD[0:i] + T + SD[i+len(T):]
            
if ans:
    ans = ans.replace('?', 'a')
else:
    ans = 'UNRESTORABLE'
    
print(ans)
x = input("1??\???100??\????????´??°?????\?????????????????????: ")
while (x < 1) and (x > 100):
    if (x < 1) or (x > 100):
        x = input("??????????????\?????????????????????: ")
num = x * x * x
print(num, end="\n")

### FIXED CODE ###

x = int(input(""))
if (x >= 1) or (x <= 100):
    num = x ** 3 
    print(num, end="\n")
else:
    pass
o=998244353
f=[1]
for i in range(1,2500100):f.append(f[-1]*i%o)
def c(n,k):return f[n]*pow(f[n-k],o-2,o)*pow(f[k],o-2,o)%o
n,m=map(int,input().split())
w=3*m
u=n-1
a=c(w+u,u)-n*c(n+m-2,u)
if u&gt;m:
 for i in range(m+1,min(w,n)+1):
  if w-i+1&amp;1:a=(a-c(n,i)*c((w-i)//2+u,u))%o
print(a%o)

### FIXED CODE ###

mod = 998244353
rng = 2500100
fctr = [1]
finv = [1]
for i in range(1,rng):
  fctr.append(fctr[-1]*i%mod)
def inv(x):
  return pow(x,mod-2,mod)
def cmb(n,k):
  if n<0 or k<0:
    return 0
  else:
    return fctr[n]*inv(fctr[n-k])*inv(fctr[k])%mod

n,m = map(int,input().split())
ans = cmb(n+3*m-1,n-1)
ans = (ans-n*cmb(n+m-2,n-1))%mod
if n>m+1:
  for i in range(m+1,min(3*m,n)+1):
    if (3*m-i)%2 == 1:
      continue
    x = (3*m-i)//2
    ans = (ans-cmb(n,i)*cmb(x+n-1,n-1))%mod
print(ans)
X = list(map(int, input().split()))
if X[0] == 0:
  print(1)
elif X[1] == 0:
  print(2)
elif X[2] == 0:
  print(3)
elif X[3] == 0:
  print(4)
 else:
  print(5)

### FIXED CODE ###

X = list(map(int, input().split()))
if X[0] == 0:
    print(1)
elif X[1] == 0:
    print(2)
elif X[2] == 0:
    print(3)
elif X[3] == 0:
    print(4)
else:
    print(5)
print('YNEOS'[input()%18!=17::2])

### FIXED CODE ###

L = list(map(int, input().split()))
print("YES" if 5 in L and 7 in L and sum(L) == 17 else "NO")
a,op,b=input()

if op=='+':
  print(int(a)+int(b))

if op=='-':
  print(a-b)
  
elif op=='*':
  print(a*b)

elif op=='/':
  print(a/b)




### FIXED CODE ###

while True:
    a,op,b=input().split()
    if op == '+':
        r = int(a)+int(b)
    elif op == '-':
        r = int(a)-int(b)
    elif op == '*':
        r = int(a)*int(b)
    elif op == '/':
        r = int(a)//int(b)
    elif op == '?':
        break;
    print(r)
n = int(input())
aaa = list(map(int, input().split()))
aaa.sort()
mod = 10 ** 9 + 7
ans = int(2 ** (n / 2) % mod) if n % 2 == 0 else int(2 ** ((n - 1) / 2) % mod)
if n % 2 == 0:
    for i in range(0, n, 2):
        if aaa[i] != aaa[i + 1]:
            ans = 0
            break
else:
    for i in range(1, n - 1, 2):
        if aaa[i] != aaa[i + 1]:
            ans = 0
            break
print(ans)


### FIXED CODE ###

def pow_mod(n, k, m):
    if k == 0:
        return 1
    if k & 1:
        return (pow_mod(n, k - 1, m) * n % m) % m
    else:
        return (pow_mod(n, k // 2, m) ** 2) % m

n = int(input())
aaa = list(map(int, input().split()))
mod = 10 ** 9 + 7
aaa.sort()
if n % 2 == 0:
    for i in range(0, n, 2):
        if aaa[i] != aaa[i + 1]:
            print(0)
            exit()
    print(pow_mod(2, (n // 2), mod))
else:
    for i in range(1, n, 2):
        if aaa[i] != aaa[i + 1]:
            print(0)
            exit()
    print(pow_mod(2, ((n - 1) // 2), mod))
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input().split())
# 出力
print("{}".format(x = "bust" if n >= 22 else "win"))

### FIXED CODE ###

array = map(int, input().split())
if sum(array) >= 22:
  print("bust")
else:
  print("win")
a = []
while True:
    if n == 0:
        break
    else:
        a.append(input())

for i in range(0,len(a)):
    print "Case"+ i + ":" + a[i]

### FIXED CODE ###

a = []
num = 1

while True:
    n = input()
    if n == 0:
        break
    print ("Case {}: {}".format(num,n))
    num +=1
import itertools
S=input()
N=len(S)
flag=0
s="AKIHABARA"
s2=""
l2=[]
count=0
for i in range(9):
    l=list((itertools.combinations(s,i+1)))
    #print(l)
    for j in range(len(l)):
        s2="".join(l[j])
        l2.append(s2)
for i in range(len(l2)):
    if l2[i]==S:
        for j in range(len(l2[i])):
            if l2[i][j]=="A":
                count=connt+1
        if (4-count)+len(l2[i])==9:
            flag=1
        break
if flag==1:
    print("YES")
else:
    print("NO")



### FIXED CODE ###

import itertools
S=input()
N=len(S)
flag=0
s="AKIHABARA"
s2=""
l2=[]
count=0
for i in range(9):
    l=list((itertools.combinations(s,i+1)))
    #print(l)
    for j in range(len(l)):
        s2="".join(l[j])
        l2.append(s2)
for i in range(len(l2)):
    if l2[i]==S:
        for j in range(len(l2[i])):
            if l2[i][j]=="A":
                count=count+1
        if (4-count)+len(l2[i])==9:
            flag=1
        break
if flag==1:
    print("YES")
else:
    print("NO")
a,b=[int(x) for x in input().split()]
 
c=1
ans=0:
while True:
  if c>=b:
    break
  else:
    c+=a-1
    ans+=1
print(ans)

### FIXED CODE ###

a,b=[int(x) for x in input().split()]
 
c=1
ans=0
while True:
  if c>=b:
    break
  else:
    c+=a-1
    ans+=1
print(ans)
import sys

values = [int(input()) for i in range(int(input()))]
maxv = - sys.maxsize - 1
minv = values[0]

for val in enumerate(values):
    if maxv < (val - minv):
        maxv = val - minv
    if minv > val:
        minv = val
print(maxv)


### FIXED CODE ###

values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)
from sympy import divisors as d

n = int(input())
p = max([i for i in d(n) if i <= n**.5])
q = n//p

print(p+q-2)

### FIXED CODE ###

n = int(input())

for i in range(1, int(n**.5)+1):
  if n%i == 0:
    p = i

q = n//p

print(p+q-2)
data = list(map(int,input().split()))

A = data[0]
B = data[1]
K = data[2]

ans = []
for i in range(K):
    a = A+i
    b = B-i
    
    if a <= b:
        ans.append(a)
    if a >= b:
        break
    
    ans.append(b)
    
ans.sort()

for i in ans:
    print(i)

### FIXED CODE ###

s = input()
 
if s.count("a") and s.count("b"):
  if s.count("c") and len(s) == 3:
    print("Yes")
  else:
    print("No")
else:
  print("No")
n,k=map(int,input().split())
h=list(map(int,input().split()))
ans=0
for i in h;
  if i>=k:
    ans+=1
pront(ans)

### FIXED CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
cnt=0
for i in h:
    if i>=k:
        cnt+=1
print(cnt)
S = input()
def func():
    from collections import Counter as c
    ev,od = [],[]
    for i in range(len(S)):
        ev.append(S[i]) if i%2 == 0 else 0
        od.append(S[i]) if i%2 == 1 else 0
    ev = c(ev).most_common()
    od = c(od).most_common()
    if len(od) == 0:
        return 0
    if ev[0][0] != od[0][0]:
        return len(S)-ev[0][1]-od[0][1]
    else:
        if len(ev) == 1 or len(od) == 1:
            return len(S)//2
        else:
            return max(ans,len(S)-ev[0][1]-od[1][1],len(S)-ev[1][1]-od[0][1])
print(func())

### FIXED CODE ###

S = input()
from collections import Counter as c

od,ev = [],[]#od=奇数 ev=偶数
for s,i in zip(S,range(1,len(S)+1)):
    if i%2 == 0:
        ev.append(s)
    else:
        od.append(s)
odd = c(od).most_common(2)
eve = c(ev).most_common(2)
N = len(S)
N,odd,eve
if len(odd) != 2:
    odd.append(('9',0))
if len(eve) != 2:
    eve.append(('9',0))
if N == 1:
    ans = 0
elif odd[0][0] != eve[0][0]:
    ans = N-odd[0][1]-eve[0][1]
else:
    if len(odd) == len(eve) == 1:
        ans = N//2
    else:
        ans = N-max(odd[0][1]+eve[1][1],odd[1][1]+eve[0][1])
print(ans)
n=int(input())
s=list(input())
cnt=len(s)
s1=s[1]
for i in range(1,n):
    if s[i]==s1:
        cnt-=1
    s1=s[i]
print(cnt)

### FIXED CODE ###

n=int(input())
s=list(input())
cnt=1
s1=s[0]
for i in range(n-1):
    if s[i]!=s[i+1]:
        cnt+=1
print(cnt)
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(s[0], s[1]))



### FIXED CODE ###

import fractions

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

print((s[0] * s[1]) // fractions.gcd(s[0], s[1]))
from collections import defaultdict
import math

INF = 10 ** 5
is_prime = [1] * INF

def eratorasu():
    is_prime[0] = 0
    is_prime[1] = 0
    for i in range(2, INF):
        if is_prime[i] == 0:
            continue
        for j in range(i * 2, INF, i):
            is_prime[j] = 0
    return

def f(n):
    yakusu = []
    if is_prime[n]:
        yakusu.append(n)
    else:
        for i in range(2, int(n ** 0.5) + 1):
            if n % i == 0:
                yakusu.append(i)
                break

    for i in yakusu:
        if i != 1:
            d[i] += 1

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

tmp = A[0]
for i in range(1, N):
    tmp = math.gcd(tmp, A[i])
    f(A[i])

if tmp != 1:
    print('not coprime')
    exit()
eratorasu()
f(A[0])

#for i, v in d.items():
#    if v != 1:
#        print('setwise coprime')
#        exit()

print('pairwise coprime')


### FIXED CODE ###

from collections import defaultdict
import math

INF = 10 ** 6 + 1
is_prime = [1] * INF

def eratorasu():
    is_prime[0] = 0
    is_prime[1] = 0
    for i in range(2, INF):
        if is_prime[i] == 0:
            continue
        for j in range(i * 2, INF, i):
            is_prime[j] = 0
    return

def f(n):
    yakusu = []
    if is_prime[n]:
        yakusu.append(n)
    else:
        for i in range(2, int(n ** 0.5) + 1):
            if n % i == 0:
                yakusu.append(i)
                if i != n //i:
                    yakusu.append(n // i)
                break

    for i in yakusu:
        if i != 1:
            d[i] += 1

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

tmp = A[0]
for i in range(1, N):
    tmp = math.gcd(tmp, A[i])
    f(A[i])

if tmp != 1:
    print('not coprime')
    exit()
eratorasu()
f(A[0])

for i, v in d.items():
    if v != 1:
        print('setwise coprime')
        exit()

print('pairwise coprime')
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

from collections import Counter

def rec(n, memo):
    if memo[n] != -1:
        return memo[n]
    
    if len(graph[n]) == 0:
        memo[n] = 0
        return 0
    
    else:
        cnt = Counter()
        for child in graph[n]:
            cnt[rec(child, memo)] += 1
            
        memo[n] = max(cnt.keys())+1 + (sum(cnt.values()) - len(cnt))
        return memo[n]

n = ni()
memo = [-1]*n
graph = [[] for _ in range(n)]
i = 1
for _ in range(n-1):
    ai = ni() - 1
    graph[ai].append(i)
    i += 1
    
print(rec(0, memo))


### FIXED CODE ###

import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

def dfs(v: int, graph: list) -> int:
    if graph[v] == []:
        return 0
    
    else:
        ret = -1
        cands = []
        for ch in graph[v]:
            cands.append(dfs(ch, graph))
            
        cands.sort(reverse=True)
        
        for idx, cand in enumerate(cands):
            ret = max(ret, idx+1 + cand)
            
        return ret
    

n = ni()
graph = [[] for _ in range(n)]

person = 1
for _ in range(n-1):
    ai = ni()-1
    graph[ai].append(person)
    
    person += 1
    
ans = dfs(0, graph)
print(ans)
N = int(input())
dict_c = {}
for char in input():
  if char in dict_c:
    dict_c[char] += 1
  else:
    dict_c[char] = 1

for _ in range(N-1):
  word = input()
  dict_t = dict_c
  for char in word:
    if char in dict_t:
      dict_t[char] += 1
    else:
      dict_t[char] = 1
  for char, cnt in dict_c.items():
    if cnt != 0 and cnt != dict_c[char]:
      dict_c[char] = 0
ans = ''
for char, cnt in dict_c.items().sort(key=lambda x: x[0]):
  ans += char*(cnt)
print(ans)

### FIXED CODE ###

N = int(input())
dict_c = {}
for char in input():
  if char in dict_c:
    dict_c[char] += 1
  else:
    dict_c[char] = 1

for _ in range(N-1):
  word = input()
  dict_t = {}
  for char in word:
    if char in dict_t:
      dict_t[char] += 1
    else:
      dict_t[char] = 1
  for char, cnt in dict_c.items():
    if cnt != 0:
      if not char in dict_t:
        dict_c[char] = 0
      else:
        dict_c[char] = min(cnt, dict_t[char])
ans = ''
for char, cnt in sorted(dict_c.items(), key=lambda x: x[0]):
  ans += char*(cnt)
print(ans)
n,a=map(int,input().split())
x=list(map(lambda x:int(x)-a,input().split()))
m=min(x)*n;M=max(x)*n+1
dp=[[0]*(M-m) for _ in range(n)]
dp[0][x[0]]+=1
dp[0][0]+=1
for i in range(n-1):
    for j in range(m,M):
        if dp[i][j]!=0:
            if j+x[i+1] in range(m,M):dp[i+1][j+x[i+1]]+=dp[i][j]
            dp[i+1][j]+=dp[i][j]
print(dp[n-1][0]-1)

### FIXED CODE ###

n,a=map(int,input().split())
x=list(map(lambda x:int(x)-a,input().split()))
m=0 if min(x)>0 else min(x)*n
M=1 if max(x)<0 else max(x)*n+1
dp=[[0]*(M-m) for _ in range(n)]
dp[0][x[0]]+=1
dp[0][0]+=1
for i in range(n-1):
    for j in range(m,M):
        if j+x[i+1] in range(m,M):dp[i+1][j+x[i+1]]+=dp[i][j]
        dp[i+1][j]+=dp[i][j]
print(dp[n-1][0]-1)
import math 

N = int(input())
A = list(map(int, input().split()))
MODE = 10**9+7

def lcm(a, b):
    return a*b//math.gcd(a,b)

_lcm = 1
for a in A:
    _lcm = lcm(a, _lcm)

ret = 0
for a in A:
    ret += (_lcm // a)
    ret %= MODE

print(ret)


### FIXED CODE ###

import fractions 

N = int(input())
A = list(map(int, input().split()))
MODE = 10**9+7

def lcm(a, b):
    return a*b//fractions.gcd(a,b)

_lcm = 1
for a in A:
    _lcm = lcm(a, _lcm)

ret = 0
for a in A:
    ret += (_lcm // a)

print(ret%MODE)
a,b,c,k = map(int,input().split())

if k <= a:
  print(a)
elif a < k and k <= a+b:
  print(a)
else:
  print(a-k+a+b))

### FIXED CODE ###

a,b,c,k = map(int,input().split())
 
if k <= a:
  print(k)
elif a < k and k <= a+b:
  print(a)
else:
  print(a-k+a+b)
n,m=map(int,input().split())

if n==1 and m==1:
    print(1)
elif n==1 and m!=1:
    print(m-2)
elif n!=1 and m==1:
    print(n-2)
else:
    print((n-2)*(m-2)

### FIXED CODE ###

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

if n==1 and m==1:
    print(1)
elif n==1 and m!=1:
    print(m-2)
elif n!=1 and m==1:
    print(n-2)
else:
    print((n-2)*(m-2))
from sys import stdin
import itertools
def main():
    number = int(input())
    num_list = list(map(int, stdin.readline().split()))
    comb = list(itertools.combinations(num_list, 2))
    total = sum([c1*c2 for c1, c2 in comb])
    print(total % (1000000000 + 7))
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    l_input = list(map(int, input().split()))
    time = l_input[0] / l_input[2]
    if(time <= l_input[1]):
        print("Yes")
    else:
        print("No")
if __name__ == '__main__':
    main()
n,m=map(int,input().split())
ans=set()
b=set(range(1,m+1))
ans.union(b)
for n in range(n):
  s=list(map(int,input().split()))
  s=s[1:]
  ans=ans-s
print(len(ans))


### FIXED CODE ###

n,m=map(int,input().split())
ans=set()
b=set(range(1,m+1))
#print(b)
ans=ans.union(b)
for n in range(n):
  #print(ans)
  s=list(map(int,input().split()))
  ex=b - set(s[1:])
  ans=ans-ex
print(len(ans))
a, b = map(int, input().split())
n = min(a, b) // 2
*t, = [True] * (n + 1)
#for i in range(len(t)):
#    if not t[i]:
#        continue
#    if a % t[i] == 0 and b % t[i] == 0:
#        for j in range(i+1, len(t)):
#            if t[j] == -1:
#                continue
#            if t[j] % t[i] == 0:
#                print(t[j], t[i])
#                t[j] = -1
#    else:
#        t[i] = -1
print(1)

### FIXED CODE ###

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

def getPrimeFactors(x):
    ans = []
    for d in range(2, int(x**0.5)+1):
        while x%d == 0:
            ans.append(d)
            x //= d
    if x != 1:
        ans.append(x)
    return ans

res_a = getPrimeFactors(a)
res_b = getPrimeFactors(b)

res = len(set(res_a) & set(res_b))
print(res + 1)
n = int(input())
T=[int(input()) for i in range(n)]
T = sorted(T,reverse=True)

for i in range(2,100):
  if T[0] % T[1] !=0:
    if sum(map(lambda x:x/2, T)) !=0:
      T[0] = T[0]*i
  else:
    print(T[0])
    exit()


### FIXED CODE ###

n = int(input())
T=[int(input()) for i in range(n)]


def euclid(a,b):
  r = a % b
  return euclid(b,r) if r else b

def lcm(a,b):
  return a * b //euclid(a,b)

num = T[0]
for i in range(1,n):
  num = lcm(num, T[i])
print(num)
maximum = float("-inf")
for i in range(K): # gets the sum of first i numbers + last K-i numbers
    frontSum = 0
    frontList = []
    backSum = 0
    backList = []
    for o in range(i):
        frontSum += V[o]
        frontList.append(V[o])
    for o in range(len(V)-(K-i-1), len(V)):
        backSum += V[o]
        backList.append(V[o])
    total = frontSum + backSum
    if total > maximum:
        maximum = total
    frontList.sort()
    backList.sort()
    for p in range(2, i, 2):
        for j in range(p):
            frontList = frontList[p:]
            newFrontSum = 0
            for k in frontList:
                newFrontSum += k
            if newFrontSum > frontSum:
                frontSum = newFrontSum
    for p in range(2, K-i, 2):
        for j in range(p):
            backList = backList[p:]
            newBackSum = 0
            for k in backList:
                newBackSum += k
            if newBackSum > backSum:
                backSum = newBackSum
    newTotal = backSum + frontSum
    if newTotal > maximum:
        maximum = newTotal
print(maximum)

### FIXED CODE ###

N, K = map(int, input().strip().split())
V = list(map(int, input().strip().split()))
H = []
maxi = 0
for i in range(min(N, K)):
    for o in range(i+2):  # error1
        ts = 0
        hand = []
        for p in range(o):
            hand.append(V[p])
        for p in range(N-(i-o)-1, N):  # error2
            hand.append(V[p])
        for values in hand:
            ts += values
        if ts > maxi:
            maxi = ts
        if len(hand) > 0:
            hand.sort()
            for j in range(K-i-1):  # error3
                if len(hand) > 0:
                    if hand[0] < 0:
                        del hand[0]
                    else:
                        break
        ts = 0
        for k in hand:
            ts += k
        if ts > maxi:
            maxi = ts
print(maxi)
a,b,k = map(int,input().split())

nums = list(range(a,b+1))
rev = list(reversed(list(range(a,b+1))))

n = len(nums)
if k>n: k=n

ans = nums[0:k]+list(reversed(rev[0:k]))
for ele in list(set(ans)): print(ele)

### FIXED CODE ###

a,b,k = map(int,input().split())

n=b-a+1

if (k-1>=n-k):
    for i in range(a,b+1): print(i)

else:
    for i in range(a,a+k): print(i)
    for i in range(b-k+1,b+1): print(i)