Harryxun/stf_run huggingface dataset:
def main():
    from sys import setrecursionlimit, stdin
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor, gcd
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**9+10

    N,K = LMIIS()
    X = LMIIS()



    D = [0]*(N-1)
    pre = X[0]
    for i in range(1,N):
        D[i-1] = X[i] - pre
        pre = X[i]

    #left:X[0] right:X[K-1]
    left = 0
    right = K-1
    syaku = X[right] - X[left]
    if abs(X[left]) > abs(X[right]):
        min_time = syaku + abs(X[right])
    else:
        min_time = syaku + abs(X[left])


    for i in range(N-K):
        if abs(X[left]) > abs(X[right]):
            min_time = min(min_time, syaku + abs(X[right]))
        else:
            min_time = min(min_time, syaku + abs(X[left]))
        syaku = syaku + (X[right+1] - X[right]) - (X[left+1] - X[left])
        left += 1
        right += 1
    
    print(min_time)



    
main()

### FIXED CODE ###

def main():
    from sys import setrecursionlimit, stdin
    from os import environ
    from collections import defaultdict, deque, Counter
    # from math import ceil, floor, gcd
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7

    N,K = LMIIS()
    X = LMIIS()


    #left:X[0] right:X[K-1]
    left = 0
    right = K-1
    syaku = X[right] - X[left]
    if abs(X[left]) > abs(X[right]):
        min_time = syaku + abs(X[right])
    else:
        min_time = syaku + abs(X[left])


    for i in range(N-K+1):
        syaku = X[right] - X[left]
        if abs(X[left]) > abs(X[right]):
            min_time = min(min_time, syaku + abs(X[right]))
        else:
            min_time = min(min_time, syaku + abs(X[left]))
        
        left += 1
        right += 1
    
    print(min_time)



    
main()
x=input()
a=[1]
for i in range(1,len(x)):
    if x[i]==x[i-1]:
        a[-1]+=1
    else:a+=[1]
ans=0    
if x[0]=="T":
    ans+=a.pop(0)
if x[-1]=="S":
    ans+=a.pop(-1)
    
while len(a)>1:
    a=[a[i]-a[i+1] for i in range(0,len(a),2)]
    if a:
        if a[0]<0:
            ans-=a.pop(0)
    if a:
        if a[-1]>0:
            ans+=a.pop(-1)
    a=[abs(i) for i in a]
print(ans+abs(a[0]) if a else ans)

### FIXED CODE ###

a=[]
for i in input():
    if i=="S":
        a+=i
    
    if a:
        if i=="T" and a[-1]=="T":
            a+=i
        if i=="T" and a[-1]=="S":
            a.pop(-1)
    elif i=="T" and len(a)==0:
        a+=i    
print(len(a))
n=int(input())
edge={i:[] for i in range(n+1)}
colored={j:{} for j in range(n+1)}
before_colored=[0 for i in range(n+1)]
querie=[]
start=[]
for i in range(n-1):
    a,b=map(int,input().split())
    edge[a].append(b)
    edge[b].append(a)
    querie.append((a,b))
    if i==0:
        start=[a,b]
    
    
#どの点とどの点がつながっているかを隣接リスト型にして保管する
from collections import deque
d=deque()
e=deque()
#訪れたリスト
visited=[False for i in range(n+1)]

visited[start[0]]=True
#頂点を一つ登録
color=1
for node in edge[start[0]]:
    visited[node]=True
    d.append(node)
    colored[start[0]][node]=color
    colored[node][start[0]]=color
    before_colored[node]=color
    color+=1
while d:
    for some in d:
        if before_colored[some]!=1:
        	color=1
        else:
            color=2
        for node in edge[some]:
            if visited[node]==False:
                e.append(node)
                visited[node]=True        
                if before_colored[some]!=color:
                    colored[some][node]=color
                    colored[node][some]=color
                    before_colored[node]=color
                    color+=1
                elif before_colored[some]==color:
                    colored[some][node]=color+1
                    colored[node][some]=color+1
                    before_colored[node]=color+1
                    color+=2
        if e:
            d=e
            e=deque()
        else:
            d=deque()
K=0
for i in range(n):
    K=max(K,len(edge[i+1]))
print(K)
for  i in range(n-1):
    a,b=querie[i][0],querie[i][1]
    print(colored[a][b])

### FIXED CODE ###

#幅優先探索
from collections import deque
d=deque()
e=deque()
import sys
sys.setrecursionlimit(1000000000)
n=int(input())
start_node=0
querie=[]
edge={i:[]for i in range(1,n+1)}
for j in range(n-1):
    a,b=map(int,input().split())
    querie.append((a,b))
    edge[a].append(b)
    edge[b].append(a)
    if j==0:
        start_node=a  

d.append((start_node,0))

#はじめにdequeに入れておいて幅優先探索を行うものを決める。そして、塗り分けの結果はans_dictに保存する
#print(edge) 
ans_dict={i:{}for i in range(1,n+1)}
K=0
for some in edge.values():
    K=max(K,len(some))
    
#幅優先探索に使用する すでに訪れたか確認するためのリスト

visited=[False for i in range(n+1)]
visited[start_node]=True

#使う頂点の数を記録した
#nodeをリスト型にしたリストを返す
#start_nodeを記録しておく
def determine_edge_color(node,color):
    new_color=0
    for some in edge[node]:
        if visited[some]==False:
            visited[some]=True
            new_color+=1
            if new_color==color:
                new_color+=1
                ans_dict[node][some]=new_color
                ans_dict[some][node]=new_color
                e.append((some,new_color))
            else:
                ans_dict[node][some]=new_color
                ans_dict[some][node]=new_color
                e.append((some,new_color))
        else:
            pass
            
while d:
    for some in d:
        if visited[some[0]]==True:
            determine_edge_color(some[0],some[1])
        else:
            determine_edge_color(some[1],some[0])
    d=e
    e=deque()
    
#ans_dictの完成
print(K)
#答えの出力
for item in querie:
    a,b=item[0],item[1]
    print(ans_dict[a][b])
x, a = map(int, input().sprit().split())
if x < a:
  print(10)
else:
  print(0)

### FIXED CODE ###

x, a = map(int, input().rstrip().split())
if x < a:
  print(0)
else:
  print(10)
A = int(input())
B = int(input())

total = 1
count = 0

while B > total:
    count = count + 1
    total = total -1 + A

print(count)

### FIXED CODE ###

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

ans = 0
outlet = 1

while b > outlet:
    ans = ans + 1
    outlet = outlet + (a-1)
print(ans)
n = int(input())
h = list(map(int,input().split()))
count = h[0]
for i in range(N-1):
    if h[i+1]>h[i]:
        count += h[i+1]-h[i]
print(cnt)

### FIXED CODE ###

N = int(input())
h = list(map(int,input().split()))
cnt = h[0]
for i in range(N-1):
  if h[i+1]>h[i]:
    cnt += h[i+1]-h[i]
print(cnt)
=int(raw_input())

def comb(tr):
    l=len(tr)
    res=[]
    for i in range(l):
        head,tail=tr[i:],tr[:i]
        headrev=head[::-1]
        tailrev=tail[::-1]
        res.append(head+tail)
        res.append(headrev+tail)
        res.append(head+tailrev)
        res.append(headrev+tailrev)
        res.append(tail+head)
        res.append(tailrev+head)
        res.append(tail+headrev)
        res.append(tailrev+headrev)
    return len(set(res))
    #return res
for i in range(n):
    tr = raw_input()
    print comb(tr)

### FIXED CODE ###

n=int(raw_input())

def comb(tr):
    l=len(tr)
    res=[]
    for i in range(l):
        head,tail=tr[i:],tr[:i]
        headrev=head[::-1]
        tailrev=tail[::-1]
        res.append(head+tail)
        res.append(headrev+tail)
        res.append(head+tailrev)
        res.append(headrev+tailrev)
        res.append(tail+head)
        res.append(tailrev+head)
        res.append(tail+headrev)
        res.append(tailrev+headrev)
    return len(set(res))
    #return res
for i in range(n):
    tr = raw_input()
    print comb(tr)
l=[0]*13
input()
for i in input().split():;l[int(i)//400]+=1
r=sum([1 for a in l[:8] if a > 0])
print(max(1,r),r+sum(l[8:]))

### FIXED CODE ###

al=[0]*13
input()
for i in input().split():
    al[int(i)//400]+=1
tuyoi=sum(al[8:])
iru=sum([1 for a in al[:8] if a > 0])
print(max(1,iru),iru+tuyoi)
inr = lambda: list(map(int, input().split()))
inn = lambda: input()
 
N,Q = inr()
S = inn()


cou  = 0
cou_list = []
for s in S:
    if s == "C":
        if flag == 1:
            cou += 1
            flag = 0
    elif s == "A":
        flag = 1
    else:
        flag = 0
    cou_list.append(cou)

for q in range(Q):
    l,r = inr()
    bubun = cou_list[r-1] - cou_list[l-1]
    print(bubun)

### FIXED CODE ###

n,q = map(int,input().split())
s = input()
pref = [0]
for i in range(1,n):
  if s[i-1:i+1] == "AC": 
      pref.append(pref[-1]+1)
  else: 
      pref.append(pref[-1])
for i in range(q):
    l,r = map(int,input().split())
    print(pref[r-1]-pref[l-1])
r，g，b = map(int,input().split())
x=r*100+g*10+b
if x%4==0
 print("YES")
else
 print("NO")


### FIXED CODE ###

r, g, b = map(int, input().split())
rgb = int(str(r)+str(g)+str(b))
if rgb%4 == 0:
    print("YES")
else:
    print("NO")
A = input()

def f(x):
    if x % 2 == 0:
        return 1
    else:
        return -1

B = []
for i in range(8):
    if int(A[0]) + f(i//4) * int(A[1]) + f(i//2) * int(A[2]) + f(i) * int(A[3]) == 7:
        if f(i//4) == 1:
            B.append('+')
        else:
            B.append('-')
        if f(i//2) == 1:
            B.append('+')
        else:
            B.append('-')
        if f(i) == 1:
            B.append('+')
        else:
            B.sppend('-')
        flag = 1
        break
        
if flag == 1:
    print('{}{}{}{}{}{}{}{}'.format(A[0], B[0], A[1], B[1], A[2], B[2], A[3], '=7'))

### FIXED CODE ###

A = input()

def f(x):
    if x % 2 == 0:
        return 1
    else:
        return -1

B = []
for i in range(8):
    if int(A[0]) + f(i//4) * int(A[1]) + f(i//2) * int(A[2]) + f(i) * int(A[3]) == 7:
        if f(i//4) == 1:
            B.append('+')
        else:
            B.append('-')
        if f(i//2) == 1:
            B.append('+')
        else:
            B.append('-')
        if f(i) == 1:
            B.append('+')
        else:
            B.append('-')
        flag = 1
        break
        
if flag == 1:
    print('{}{}{}{}{}{}{}{}'.format(A[0], B[0], A[1], B[1], A[2], B[2], A[3], '=7'))
n, r = map(int, input().split())
count = 0
if n = 1:
    print(1)
else:
    while n // r >= r:
        count += 1
        n = n // r
    print(count + 2)

### FIXED CODE ###

n, r = map(int, input().split())
count = 0
if n == 1:
    print(1)
else:
    while n // r >= r:
        count += 1
        n = n // r
    print(count + 2)
import sys
from collections import deque
read = sys.stdin.read

def main():
    N, *ab = map(int, read().split())
    E = [[] for _ in range(N + 1)]
    
    for a, b in zip(*[iter(ab)] * 2):
        E[a].append(b)
        edge_order.append(b)
    
    # 頂点1から幅優先探索
    queue = deque([1])
    color = [0] * (N+1) 
    while queue:
        V = queue.popleft()
        c = 1
        for i in E[V]:
            if c == color[V]:
                c += 1
            color[i] = c
            c += 1
            queue.append(i)

    print(max(color))
    for i in edge_order:
        print(color[i])


if __name__ == "__main__":
    main()


### FIXED CODE ###

from collections import deque
def main():
    N = int(input())
    # 辺の集合を隣接リストとして入力
    E = [[] for i in range(N+1)]
    edge_order = []
    for i in range(N-1):
        a,b = map(int, input().split())
        E[a].append(b)
        edge_order.append(b)
    
    # 頂点1から幅優先探索
    queue = deque([1])
    color = [0] * (N+1) 
    while queue:
        V = queue.popleft()
        c = 1
        for i in E[V]:
            if i < V:
                continue
            if c == color[V]:
                c += 1
            color[i] = c
            c += 1
            queue.append(i)

    print(max(color))
    for i in edge_order:
        print(color[i])


if __name__ == "__main__":
    main()
n=int(input())
a=list(map(int,input().split()))
e=[]
o=[]
s=0

for i in range(n):
    if(int(a[i])==1):
        s+=1
    else:
        e.append(s)
        if(s==n):
            break
        for j in range(i,n):
            f=0
            if(int(a[j])==0):
                s+=1
            else:
                e.append(s)
                if(s==n):
                    break
                for k in range(j,n):
                    if(int(a[k])==1):
                        s+=1
                    else:
                        e.append(s)
                        if(s==n):
                            break
                        f=1
                        break
                if(f==1):
                    break
        
        e.append(s)
        if(s==n):
            break
        s=0
e.append(s)
if(len(e)==0):
    print("0")
else:
    print(max(e))
#print(o)

### FIXED CODE ###

num = input()
predicted_value = 0
finished = False
i = 1
while i < len(num):
    if num[i] != num[i-1]:
        num = num[:i-1] + num[i+1:]
        predicted_value += 2
        if i > 1:
            i -= 2
        elif i == 1:
            i = 0
    i += 1
print(predicted_value)
from fractions import Fraction

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


def search():
    for _ in range(b):
        print("0" * a + "1" * (w - a))
    for _ in range(b, H):
        print("1" * a + "0" * (w - a))
    return True


def solve():
    if a == 0 and b == 0:
        for _ in range(h):
            print("0" * w)
        return True
    if b == 0:
        for _ in range(h):
            print("0" * a + "1" * (w - a))
        return True
    if a == 0:
        for _ in range(b):
            print("0" * w)
        for _ in range(h - b):
            print("1" * w)
        return True
    if Fraction(w, h) == Fraction(a, b):
        for r in range(h):
            for c in range(w):
                if c // a == r // b:
                    print("1", end="")
                else:
                    print("0", end="")
            print()
        return True
    return search()


if not search():
    print("No")


### FIXED CODE ###

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

for _ in range(b):
  print("0" * a + "1" * (w - a))
for _ in range(b, h):
  print("1" * a + "0" * (w - a))
N = int(input())
S = input()
if N//2 == 0:
  T = S[0:N/2]
  if T+T == S:
    print("Yes")
  else:
    print("No")
else:
  print("No")

### FIXED CODE ###

N = int(input())
S = input()
if N%2 == 0:
  T = S[0:int(N/2)]
  if T+T == S:
    print("Yes")
  else:
    print("No")
else:
  print("No")
from math import gcd

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

ret = gcd(a[0], a[1])
for e in a[2:]:
    ret = gcd(ret, e)

print(ret)


### FIXED CODE ###

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


def gcd(x, y):
    while y != 0:
        x, y = y, x % y

    return x


ret = gcd(a[0], a[1])

for e in a[2:]:
    ret = gcd(ret, e)

print(ret)
import math
HL,ML,h,m=(int(x) for x in input().split())
HW=int((60*h+m)/2)
MW=int(6*m)

print(HW,MW)

if HW >= MW:
    if HW-MW>180:
        w=360-(HW-MW)
    else:
        w=HW-MW
    print(math.sqrt(HL*HL+ML*ML-2*HL*ML*math.cos(math.radians(w))))
else:
    if HW-MW>180:
        w=360-(HW-MW)
    else:
        w=HW-MW
    print(math.sqrt(HL*HL+ML*ML-2*HL*ML*math.cos(mthradians(-w))))

### FIXED CODE ###

import math
HL,ML,h,m=(int(x) for x in input().split())
HW=float((60*h+m)/2)
MW=float(6*m)

if HW > MW:
    if HW-MW>180:
        w=360-(HW-MW)
    else:
        w=HW-MW
    print(math.sqrt(HL*HL+ML*ML-2*HL*ML*math.cos(math.radians(w))))
else:
    if HW-MW>180:
        w=360-(HW-MW)
    else:
        w=HW-MW
    print(math.sqrt(HL*HL+ML*ML-2*HL*ML*math.cos(math.radians(-w))))
N = int(input())
a = list(map(int,input().split()))
average = sum(a) / N
A = list(map(lambda n:abs(n-average), a))
A.sort()
A1 = int(average - A[0])
A2 = int(average + A[0])
print(min(a.index(A1), a.index(A2)))


### FIXED CODE ###

a=int(input())
f = list(map(int,input().split()))
b=[]
ave=sum(f)/a

for i in f:
    diff=abs(i-ave)
    b.append(diff)
print(b.index(min(b)))
print(6-int(input()-int(input()))

### FIXED CODE ###

print(6-int(input())-int(input()))
import bisect
N = int(input())
L = [int(i) for i in input().split(' ')]
L.sort()

sum = 0
for i,k in enumerate(L):
  for j in range(i+1, N):
    for l in range(j+1, N):
      if L[l] < L[j] + k:
     　 print(bisect.bisect_right(L,L[j] + k))
        
        sum += 1
      else:
        break;
print(sum)

### FIXED CODE ###

import bisect
N = int(input())
L = [int(i) for i in input().split(' ')]
L.sort()

sum = 0
for i,k in enumerate(L):
  for j in range(i+1, N):
    sum += bisect.bisect_left(L,L[j] + k) - j - 1


print(sum)
N = input()
S = input()
print(S.count("ABC"))

### FIXED CODE ###

N = int(input())
S = input()
print(S.count("ABC"))
s = input()
sl = len(s)
dp = {}
ct = [0] * sl
for x in range(sl):
    dp[(0, x)] = x - 1 if s[x] == 'L' else x + 1
for i in range(32):
    for j in range(sl):
        dp[(i + 1, j)] = dp[(i, dp[(i, j)])]
for x in range(sl): ct[dp[(32, x)]] += 1
print(' '.join([str(ct[x]) for x in range(sl)]))

### FIXED CODE ###

a, b, c = map(int, input().split())
print(max(c-a+b, 0))
N, M = map(int, input().split())
P = list(map(lambda x: int(x) - 1, input().split()))
rank = [0] * N
parent = [i for i in range(N)]


def find(i):
    if parent[i] == i:
        return i
    else:
        parent[i] = find(parent[i])
        return parent[i]


def same(x, y):
    return find(x) == find(y)


def unite(x, y):
    x = parent[x]
    y = parent[y]

    if rank[x] > rank[y]:
        parent[y] = x
    else:
        parent[x] = y
        if rank[x] == rank[y]:
            rank[y] += 1


for i in range(M):
    x, y = map(int, input().split())
    unite(x - 1, y - 1)

rec = [[] for i in range(N)]
rec2 = [[] for i in range(N)]
for i in range(N):
    rec[parent[i]].append(P[i])
    rec2[parent[i]].append(i)

num = 0
for i in range(N):
    num += same(i, P[i])

print(num)


### FIXED CODE ###

N, M = map(int, input().split())
P = list(map(lambda x: int(x) - 1, input().split()))
rank = [0] * N
parent = [i for i in range(N)]


def find(i):
    if parent[i] == i:
        return i
    else:
        parent[i] = find(parent[i])
        return parent[i]


def same(x, y):
    return find(x) == find(y)


def unite(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return

    if rank[x] > rank[y]:
        parent[y] = x
    else:
        parent[x] = y
        if rank[x] == rank[y]:
            rank[y] += 1


for i in range(M):
    x, y = map(int, input().split())
    unite(x - 1, y - 1)

num = 0
for i in range(N):
    num += same(i, P[i])

print(num)
n, x = map(int, input().split())
child_list = list(map(int, input().split()))

for x>0:
  if x - min(child_list) > 0:
    please_child +=1
    child_list = child_list.pop(min(child_list))
  if child_list == []:
    break
  if x - min(child_list) =< 0:
    break
print(please_child)

### FIXED CODE ###

N, x = map(int, input().split())
child_list = list(map(int, input().split()))

if len(child_list) == 1:
    if x > min(child_list):
        please_child = 0
    elif x == min(child_list):
        please_child = 1
elif len(child_list) > 1:
    nokori = x - min(child_list)
    please_child = 0 
    while nokori >=0:
        please_child +=1
        mini = min(child_list)
        child_list.remove(mini)
        if child_list == []:
            break
        if len(child_list) == 1:
            if nokori == min(child_list):
                please_child += 1
            if nokori > min(child_list):
                break
            else:
            	break
        else:    
            nokori -= min(child_list)
print(please_child)
n,m=map(int,input().split())
s=input()
t=input()

def gcd(x,y):
  r=x%y
  return gcd(y,r) if r else y
#最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

L=lcm(n,m)
if s[0]==t[0]:
  X=[""]*L
else:
  print(-1)
  exit()
for i in range(1,n):
  X[int(i*L/n)]=s[i]
for i in range(1,m):
  if X[int(i*L/m)] !="":
    if X[int(i*L/m)] !=t[i]:
      print(-1)
      exit()
print(L)

### FIXED CODE ###

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

def gcd(x,y):
  r=x%y
  return gcd(y,r) if r else y
#最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

L=lcm(n,m)
g=gcd(n,m)
for i in range(g):
  if s[int(i*n/g)]!=t[int(i*m/g)]:
    print(-1)
    exit()
print(L)
a, b, c, d = map(int, input().split())


x = ((b+1) // c) - ((a+1) // c)
y = ((b+1) // d) - ((a+1) // d)


import math
e = int(c * d / math.gcd(c,d))


z = ((b+1) // e) - ((a+1) // e)


print((b-a) - (x+y-z) + 1)


### FIXED CODE ###

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


x = b // c
y = b // d


import fractions
e = int(c * d / fractions.gcd(c,d))


z = b // e

x2 = (a-1) // c
y2 = (a-1) // d


e2 = int(c * d / fractions.gcd(c,d))


z2 = (a-1) // e2


print((b - (x + y - z)) - (a - 1 - (x2 + y2 - z2)))
K = int(input())
ans = -1

if K % 7 == 0:
  for i in range(1,K+1):
    if 10 ** i % (9 * K / 7) == 1:
      ans = i
      break
else:
  for i in range(1,K+1):
    if 10 ** i % (9 * K) == 1:
      ans = i
      break
  
print(ans)


### FIXED CODE ###

import sys
K=int(input())
L=9*K
if L%7==0:
  L = L//7
n = 1
for i in range(1,K+1):
  n = n * 10 % L
  if n == 1:
    print(i)
    sys.exit()
print(-1)
import bisect
n,k = map(int, input().split())
x = list(map(int, input().split()))
z = bisect.bisect_left(x,0)

ans=10**12
s=z-k+1
if s < 0:
  s=0
if z == 0:
  z+=1
for i in range(s,z):
  xl=x[i]
  xr=x[i+k-1]
  ans=min(ans,abs(xr)+abs(xr-xl),abs(xl)+abs(xr-xl))
print(ans)

### FIXED CODE ###

import bisect
n,k = map(int, input().split())
x = list(map(int, input().split()))
z = bisect.bisect_left(x,0)

ans=10**12
s=z-k
if s < 0:
  s=0
g=z+1
if g+k >= n:
  g=n-k+1
for i in range(s,g):

  xl=x[i]
  xr=x[i+k-1]
  ans=min(ans,abs(xr)+abs(xr-xl),abs(xl)+abs(xr-xl))
print(ans)
X, Y = map(int, input().split())
A='No'
for a in range(X+1):
  B=X-1
  if 2*a+4*B == Y
   	A='Yes'
print(A)

### FIXED CODE ###

X, Y = map(int, input().split())
if Y>=2*X and Y<=4*X and Y%2==0:
  print("Yes")
else:
  print("No")
def p(x):
 for i in range(7,int(x**.5+1),2):
  if x%i==0:return 0
 else:return 1
def f():
 n,c=map(int,input().split())
 s='9'*n
 if c<0:return(11,s+s)[n>1]
 c=str(c)
 for h in'9731':
  if n-1:
   for m in range(int(10**~-n),0,-1):
    if((int(h)+m-1)*2+c)%3:
     t=h+str(m-1).zfill(n-1)
     a=int(t+c+t[::-1])
     if p(a):return a
  else:
   a=int(h+c+h)
   if p(a):return a
 return s+b+s
print(f())


### FIXED CODE ###

def p(x):
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
def f():
 n,c=map(int,input().split())
 s='9'*n
 if c<0:return(11,s+s)[n>1]
 for h in'9731':
  if n-1:
   for m in range(int(10**~-n),0,-1):
    t=h+str(m-1).zfill(n-1)
    a=int(t+str(c)+t[::-1])
    if p(a):return a
  else:
   a=int(h+str(c)+h)
   if p(a):return a
 return s+str(c)+s
print(f())
n, m=input().split
if n==m:
    print("AC")
else:
    print("WA")
    

### FIXED CODE ###

n, m=input().split()
if n==m:
    print("Yes")
else:
    print("No")
N = int(input())
line = list(input())

# print(line)
bottom_w = N
top = 0
count = 0
while(bottom_w > top):
    for i in reversed(range(bottom_w)):
        if(line[i]=='R'):
            bottom_w = i
            break

    for i in range(top,N):
        if(line[i]=='W' and bottom_w > i):
            # print("line",i,line[i])
            # print("swap",i,bottom_w)
            count += 1
            line[bottom_w] = 'W'
            top = i+1
            break
print(count)


### FIXED CODE ###

N = int(input())
line = list(input())

# print(line)
bottom_w = N
top = 0
count = 0
while(bottom_w > top):
    for i in reversed(range(bottom_w)):
        if(line[i]=='R'):
            bottom_w = i
            break

    if(line[-1]=='W' and bottom_w == N):
        print(0)
        exit()
    if(bottom_w <= top):
        break
    for i in range(top,N):
        if(i == N-1):
            print(count)
            exit()
        if(line[i]=='W' and bottom_w > i):
            # print("line",i,line[i])
            # print("swap",i,bottom_w)
            count += 1
            line[bottom_w] = 'W'
            top = i+1
            break
print(count)