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

par = [i for i in range(N)]
size = [1] * N


def find(x, P):
    if P[x] == x:
        return x
    else:
        return find(P[x], P)

def unite(x, y):
    root_x = find(x, par)
    root_y = find(y, par)

    if root_x != root_y:
        # xとyの属している集合が異なる時
        pass
        par[root_x] = root_y

par2 = [i for i in range(N)]
def unite2(x, y):

    x = find(x, par2)
    y = find(y, par2)

    if x != y:
        # xとyの属している集合が異なる時
        par2[x] = y
        s = size[x] + size[y]
        size[y] = s

for _ in range(K):
    p, q = map(int, input().split())
    find(q-1, par)

    unite(p-1, q-1)

### FIXED CODE ###

from collections import Counter

n,k,l=map(int,input().split())
city1=[i for i in range(n)]
city2=[i for i in range(n)]

def root(c,x):
  if x==c[x]:
    return x
  else:
    c[x]=root(c,c[x])
    return c[x]

def union(c,x,y):
  rx=root(c,x)
  ry=root(c,y)
  if rx>ry:
    c[rx]=ry
  else:
    c[ry]=rx

for i in range(k):
  a,b=map(int,input().split())
  union(city1,a-1,b-1)
for i in range(l):
  a,b=map(int,input().split())
  union(city2,a-1,b-1)
r=[]
for i in range(n):
  r.append((root(city1,i),root(city2,i)))
c=Counter(r)
for i in range(n):
  ans=c[r[i]]
  if i==n-1:
    print(ans)
  else:
    print(ans,end=' ')
A, B, C, X, Y = map(int, input().split())

min_sum = int(float('inf'))
for c in range(0, 200000+2, 2):
    print(c)
    sum = C*c
    if X - c/2 > 0:
        sum += A * (X - c/2)
    if Y - c/2 > 0:
        sum += B * (Y - c/2)
    if sum < min_sum:
        min_sum = sum
print(min_sum)

### FIXED CODE ###

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

res = a*x + b*y # 条件を満たす買い方のうちABピザの枚数(*2)を全探索する。ABピザを一切買わない場合を一旦答えにする（これを大きい値にして、for ループを0からにしてもよい）
for i in range(1, max(x, y)+1): # 全部ABピザでまかなう時は x,yの内多い方分買うことになる
    ab = i*2 # ABピザを買う枚数奇数枚買うことはないので2倍
    cand = ab*c + a*max(0, x-i) + b*max(0, y-i) # i枚分はABピザになるので-i 負の値にはならない（あまりになる）ので0とのmaxをとる

    res = min(res, cand) # 候補との最小値を保持

print(res)
import numpy as np
def calc_ones(n):
    ones = np.array(list(map(int, list(bin(n)[2:])))).sum()
    return ones

def calc_i(n, i):
    i += 1
    div = n % calc_ones(n)
    if div == 0:
        return i
    else:
        return calc_i(div, i)

n = int(input())
x = str(input())
x_int = np.array(list(map(int, x)))[::-1].dot(np.power(np.ones(n)*2, np.arange(n)))
for i in range(n):
    z_int = int(x_int + 2**(n-1-i)) if x[i] == "0" else int(x_int - 2**(n-1-i))
    print(calc_i(z_int, 0))

### FIXED CODE ###

N = int(input())
B = input()

B_1 = B.count("1")
mod_p1 = int(B,2) % (B_1+1)
if B_1 != 1:
    mod_m1 = int(B,2) % (B_1-1)

def calc_small(n, iter):
    iter += 1
    mod = n % bin(n).count("1")

    if mod == 0:
        return iter
    else:
        return calc_small(mod, iter)

for i in range(N):
    if B_1 == 1 and int(B[i]) == 1:
        print(0)
        continue
    mod = (mod_m1 - pow(2,N-i-1,B_1-1)) % (B_1-1) if int(B[i]) == 1 else (mod_p1 + pow(2,N-i-1,B_1+1)) % (B_1+1)
    iter = 1
    if mod == 0:
        print(iter)
    else:
        print(calc_small(mod, iter))
a,b,c,x = map(int,input().split())
count = 0

for a in range(a+1):
    for b in range(b+1):
        for c in range(c+1):
            count += 1

print(count)



### FIXED CODE ###

a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i * 500 + j * 100 + k * 50 == x:
                ans += 1
print(ans)
n,a,b,c,d=map(int,input().split())
s=input()
f=0;F=0
for i in range(a,max(c,d)-1):
  if s[i]=='#' and s[i+1]=='#':f=1
for i in range(b-2,d-1):
  if s[i]=='.' and s[i+1]=='.' and s[i+2]=='.':F=1
if F==0 and c>d:f=1
print('YNeos'[f::2])

### FIXED CODE ###

n,a,b,c,d=map(int,input().split())
s=list(input())
if c<d:
  f=0
  for i in range(b,d-1):
    if s[i]=='#' and s[i+1]=='#':
      f=1
      break
  if f==0:
    for i in range(a,c-1):
      if s[i]=='#' and s[i+1]=='#':
        f=1
        break
  if f==1:print('No')
  else:print('Yes')
else:
  f=0
  for i in range(b,d-1):
    if s[i]=='#' and s[i+1]=='#':
      f=1
      break
  if f==0:
    for i in range(a,c-1):
      if s[i]=='#' and s[i+1]=='#':
        f=1
        break
  if f==0:
    if (s[d-2]=='#' or s[d]=='#') and (s[b-2]=='#' or s[b]=='#'):
      ct=0
      for i in range(b-1,d-2):
        if s[i]=='.' and s[i+1]=='.' and s[i+2]=='.':
          ct+=1
          break
      if ct==0:
        f=1
  if f==1:print('No')
  else:print('Yes')
n = int(input())
a = [False] * int(1e9)

cnt = 0
for i in range(n):
    ai = int(input()) - 1
    a[ai] = not a[ai]

    if a[ai]:
        cnt += 1
    else:
        cnt -= 1

print(cnt)

### FIXED CODE ###

n = int(input())
a = {}

cnt = 0
for i in range(n):
    ai = int(input()) - 1

    if ai in a:
        cnt -= 1
        del a[ai]
    else:
        cnt += 1
        a[ai] = 1

print(cnt)
a, b = map(int, input().split())
s = a * b
if s % 2 == 0:
  return "Even"
else:
  return "Odd"

### FIXED CODE ###

a, b = map(int, input().split())
s = a * b
if s % 2 == 0:
  print("Even")
else:
  print("Odd")
l = list(map(int, input().split))
l.sort()
l.reverse()
sl = list(map(str, l))
print(" ".join(sl))

### FIXED CODE ###

l = list(map(int, input().split()))
l.sort()
l.reverse()
sl = list(map(str, l))
print(" ".join(sl))
import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce
import statistics
import heapq

input = sys.stdin.readline
sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

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

data_list = [[0] for _ in range(m)]

for i in range(n):
    if data[i][0]-1 < n:
        data_list[data[i][0]-1].append(-data[i][1])

heap_list = []
heapq.heapify(heap_list)

ans = 0
for i in range(0, m):
    heap_list.extend(data_list[i])
    heapq.heapify(heap_list)
    a = heapq.heappop(heap_list)
    ans += a

print(-ans)

### FIXED CODE ###

import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce
import statistics
import heapq

input = sys.stdin.readline
sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

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

data_list = [[0] for _ in range(m)]

for i in range(n):
    if data[i][0]-1 < m:
        data_list[data[i][0]-1].append(-data[i][1])

heap_list = []
heapq.heapify(heap_list)
# heapq.heapify(data_list)

ans = 0
for j in range(m):
    for i in range(len(data_list[j])):
        heapq.heappush(heap_list, data_list[j][i])
    a = heapq.heappop(heap_list)
    ans += a

print(-ans)
from collections import defaultdict
mem = defaultdict(lambda : None)
mem[(0,0,0)] = 0
def dp(a,b,s):
  if mem[(a,b,s)] is not None:
    return mem[(a,b,s)]
  x = a&1
  y = b&1
  xor = s&1
  res = float("inf")
  if x^y != xor:
    mem[(a,b,s)] = res
    return res
  else:
    res = 2*dp(a>>1,b>>1,s>>1)
  	if a > 1:
      pants = 2*dp((a-1)>>1,(b+1)>>1,s>>1)+1
      if pants > res:
        res = pants
  mem[(a,b,s)] = res
  return res

n = int(input())
a = list(map(int, input().split()))
s = 0
for i in a[2:]:
  s ^= i
b = a[1]
a = a[0]
ans = dp(a,b,s)
if ans == float("inf"):
  ans = -1
print(ans)

### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    def dp(a,b,s):
        if mem[(a,b,s)] is not None:
            return mem[(a,b,s)]
        x = a&1
        y = b&1
        z = s&1
        if x^y != z:
            return float("inf")
        res = 2*dp(a>>1,b>>1,s>>1)
        if a > 1:
            nr = 2*dp((a-1)>>1,(b+1)>>1,s>>1)+1
            if nr < res:
                res = nr
        mem[(a,b,s)] = res
        return res
    n = I()
    a = LI()
    s = 0
    for i in a[2:]:
        s ^= i
    b = a[1]
    a = a[0]
    mem = defaultdict(lambda : None)
    mem[(0,0,0)] = 0
    ans = dp(a,b,s)
    if ans == float("inf"):
        ans = -1
    print(ans)
    return

#Solve
if __name__ == "__main__":
    solve()
n, m = map(int, input().split())
x = [input().split() for i in range(m)]

y = ['WA' if (x[i][1]=='WA' and i<x.index([x[i][0], 'AC'])) else 'AC' if (x[i][1]=='AC' and i==x.index(x[i])) else 'None' for i in range(m)]
print(y.count('AC'), y.count('WA'))


### FIXED CODE ###

N, M = map(int, input().split())

ac = [False] * N
wa = [0] * N
for _ in range(M):
   p, S = input().split()
   p = int(p) - 1
   if (S == 'AC'):
      ac[p] = True
   else:
      if not ac[p]:
         wa[p] += 1

a = 0
b = 0
for i in range(N):
   if ac[i]:
      a += 1
      b += wa[i]
print(*[a, b])
def inv(a,p):
    if a==1:
        return 1
    else:
        return p-(inv(p%a,p)*(p//a))%p
x,y=map(int,input().split())
if (x+y)%3!=0:
    print("0")
    exit()
n=(x+y)//3
r=(2*x-y)//3
p=10**9+7
def fact(n,p):
    a=[[] for _ in range(n+1)]
    a[0]=1
    for i in range(n):
        a[i+1]=(a[i]*(i+1))%p
    return(a)
f=fact(n,p)
c=f[-1]
d=f[r]
e=f[n-r]
dd=inv(d,p)
ee=inv(e,p)
ans=(c*dd*ee)%p
print(ans)

### FIXED CODE ###

def inv(a,p):
    if a==1:
        return 1
    elif a==0:
        return 0
    return p-(inv(p%a,p)*(p//a))%p
x,y=map(int,input().split())
if (x+y)%3!=0:
    print("0")
    exit()
if x==0 and y>0:
    print("0")
    exit()
if y/x>2 or y/x<0.5:
    print("0")
    exit()
n=(x+y)//3
r=(2*x-y)//3
p=10**9+7
def fact(n,p):
    a=[[] for _ in range(n+1)]
    a[0]=1
    for i in range(n):
        a[i+1]=(a[i]*(i+1))%p
    return a
f=fact(n,p)
c=f[-1]
d=f[r]
e=f[n-r]
dd=inv(d,p)
ee=inv(e,p)
ans=(c*dd*ee)%p
print(ans)
N,R = int(input())
ans = 0
if N < 10:
  ans = R
else:
  ans = R + 100 * (10-N)
print(ans)
"""
  内部-X = 表示R
  内部 = 表示R + X
"""

### FIXED CODE ###

N,R = map(int,input().split())
ans = 0
if N >= 10:
  ans = R
else:
  ans = R + 100 * (10-N)
print(ans)
N = int(input())
W = [input() for i in range(N)]

for word in word_list:
    #同じワード確認
    if word in word_stock:
        print('No')
    #最後の文字確認
    try:
        if word_stock[-1][-1] != word[0]:
            print('No')
    except:
        pass
    word_stock.append(word)

print('Yes')

### FIXED CODE ###

N = int(input())
W = [input() for i in range(N)]

stock = []
last = W[0][0]

for i in range(0,len(W)):
    #過去の発言に含まれない
    if W[i] in stock:
        print('No')
        break
    #前の単語の最後と次の単語の最初が一致する
    if W[i][0] != last:
        print('No')
        break
    stock.append(W[i])
    last = W[i][-1]
    #最後まで回り切ったらyesを表示
    if i+1 == len(W):
        print('Yes')
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for i in range(m)]
graph = [[] for i in range(n+1)]
for a,b in ab:
  graph[a].append(b)
  graph[b].append(a)
jdg = 0
for g in graph:
  if len(g)%2:
    print("No")
    exit()
  if len(g) == 4:
    jdg += 1
  elif len(g) >= 6:
    jdg += 3
if jdg >= 3:
  print("Yes")
elif jdg == 2:
  print(2/0)
else:
  print("No")

### FIXED CODE ###

import sys
input = sys.stdin.readline
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for i in range(m)]
graph = [[] for i in range(n+1)]
for a,b in ab:
  graph[a].append(b)
  graph[b].append(a)
jdg = 0
ls = []
for i,g in enumerate(graph):
  if len(g)%2:
    print("No")
    exit()
  if len(g) == 4:
    jdg += 1
    ls.append(i)
  elif len(g) >= 6:
    jdg += 3
if jdg >= 3:
  print("Yes")
elif jdg == 2:
  start,goal = ls
  stack = [start]
  vis = [0]*(n+1)
  vis[start] = 1
  vis[goal] = 2
  jdg2 = 0
  while stack:
    x = stack.pop()
    for y in graph[x]:
      if vis[y] == 0:
        vis[y] = 1
        stack.append(y)
      elif vis[y] == 2:
        jdg2 += 1
  if jdg2 == 4:
    print("No")
  else:
    print("Yes")
else:
  print("No")
import sys


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


a = get()
b = a[0]
c = a[1]
if b < c:
    if abs(b - c) < b:
        print(abs(b - a))
        sys.exit(0)
    else:
        print(b)
        sys.exit(0)
else:
    if a[0] % a[1] == a[1] or a[0] % a[1] == 0:
        print(0)
        sys.exit(0)
    else:
        if abs((a[0] % a[1]) - a[1]) < abs(((a[0] % a[1]) - a[1]) % a[1]):
            if abs(a[0] % a[1]) < abs((a[0] % a[1]) - a[1]):
                print(abs(a[0] % a[1]))
                sys.exit(0)
            else:
                print(abs((a[0] % a[1]) - a[1]))
                sys.exit(0)
        else:
            if abs(a[0] % a[1]) < abs(((a[0] % a[1]) - a[1]) % a[1]):
                print(abs(a[0] % a[1]))
                sys.exit(0)
            else:
                print(abs(((a[0] % a[1]) - a[1]) % a[1]))
                sys.exit(0)


### FIXED CODE ###

import sys
# 未解決(最後だけREになる)


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


a = get()
b = a[0]
c = a[1]
if b < c:
    if abs(b - c) < b:
        print(abs(b - c))
        sys.exit(0)
    else:
        print(b)
        sys.exit(0)
else:
    if a[0] % a[1] == a[1] or a[0] % a[1] == 0:
        print(0)
        sys.exit(0)
    else:
        if abs((a[0] % a[1]) - a[1]) < abs(((a[0] % a[1]) - a[1]) % a[1]):
            if abs(a[0] % a[1]) < abs((a[0] % a[1]) - a[1]):
                print(abs(a[0] % a[1]))
                sys.exit(0)
            else:
                print(abs((a[0] % a[1]) - a[1]))
                sys.exit(0)
        else:
            if abs(a[0] % a[1]) < abs(((a[0] % a[1]) - a[1]) % a[1]):
                print(abs(a[0] % a[1]))
                sys.exit(0)
            else:
                print(abs(((a[0] % a[1]) - a[1]) % a[1]))
                sys.exit(0)
# https://atcoder.jp/contests/abc111/tasks/arc103_a
from collections import Counter
n = int(input())
nums = [int(i) for i in input().split()]

for i in range(n - 1):
    if nums[i + 1] != nums[i]:
        break
else:
    print(n // 2)
    sys.exit()


odd = Counter(nums[1::2]).most_common()
even = Counter(nums[::2]).most_common()
odd.append((0, 0))
even.append((0, 0))
if odd[0][0] != even[0][0]:
    ans = n - (odd[0][1] + even[0][1])
else:
    s = n - (odd[0][1] + even[1][1])
    t = n - (odd[1][1] + even[0][1])
    ans = min(s, t)
print(ans)

### FIXED CODE ###

# https://atcoder.jp/contests/abc111/tasks/arc103_a
from collections import Counter
n = int(input())
nums = [int(i) for i in input().split()]

odd = Counter(nums[1::2]).most_common()
even = Counter(nums[::2]).most_common()
odd.append((0, 0))
even.append((0, 0))
if odd[0][0] != even[0][0]:
    ans = n - (odd[0][1] + even[0][1])
else:
    s = n - (odd[0][1] + even[1][1])
    t = n - (odd[1][1] + even[0][1])
    ans = min(s, t)
print(ans)
'''
6
1 1 1 1 2 1
'''
from fractions import gcd

n=int(input())

a=[]
for i in map(int,input().split()):
    a.append(i)
#print(a)
if n==2:
    print(max(a))
else:
    for i in range(n):
        acpy=list(a)
        del acpy[i]
        gcdx=gcd(acpy)
        if gcdx>gcd:
            gcd=gcdx
    print(gcd)

### FIXED CODE ###

def gcdf(a):
    a.sort()
#    print("a2:",a)
    a0=a[0]
    a=[int(x%a0) for x in a if x%a0 != 0]
#    print("a2:",a)
    if len(a)==0:
        return a0
    else:
        a.append(a0)
        a0=min(a)
        return gcdf(a) 

#n=8
#a=[746130, 1385670, 4849845, 881790, 3233230, 1939938, 570570, 510510]
#ans=[19]
#n=2
#a=[1000000000, 1000000000]
#n=5
#a=[15, 18, 24, 36, 81]
#n=3
#a=[7, 6, 8]
n=int(input())
a=[]
for i in map(int,input().split()):
    a.append(i)
if n==2:
    print(max(a))
elif n<2**10:
    gcdv=0
    for i in range(n):
        acpy=list(a)
        del acpy[i]
        gcdx=gcdf(acpy)
        if gcdx>gcdv:
            gcdv=gcdx
    print(gcdv)
else:
    m=int(n**(1/2))
    ns=int(n/m)
    rgcd=[]
    for mi in range(m):
        ms=ns*mi
        if mi==m-1:
            am=a[ms:n]
        else:
            am=a[ms:ms+ns]
        gcdm=gcdf(am)
        rgcd.append(gcdm)
    gcdv=0

    for mi in range(m):
        rgcd1=list(rgcd)
        del rgcd1[mi]
        gcdrg1=gcdf(rgcd1)
        ms=ns*mi
        if mi==m-1:
            am=a[ms:n]
        else:
            am=a[ms:ms+ns]
#        print(mi,gcdf(am),len(am),gcdf(rgcd1))
        for i in range(len(am)):
            acpy=list(am)
#            del acpy[i]
#            acpy.append(gcdrg1)
            acpy[i]=gcdrg1
            gcdx=gcdf(acpy)
            if gcdx>gcdv:
                gcdv=gcdx
    print(gcdv)
# https://atcoder.jp/contests/abc155/submissions/10175015

n = input()[::-1]
s = 0
res = 0
for i, ni in enumerate(n):
    k = int(ni) + s
    if k < 5 or k == 5 and int(n[i + 1]) < 5:
        res += k
        s = 0
    else:
        res += 10 - k
        s = 1
res += s
print(res)


### FIXED CODE ###

n = list(map(int, input()[::-1])) + [0]
s = 0
res = 0
for i, ni in enumerate(n[:-1]):
    k = ni + s
    if k < 5 or (k == 5 and int(n[i + 1]) < 5):
        res += k
        s = 0
    else:
        res += 10 - k
        s = 1
res += s
print(res)
N = int(input())
l = [int(input()) for i in range(N)]
print('Yes' if max(l) < sum(l) - max(l) else 'No')

### FIXED CODE ###

N = int(input())
l = list(map(int, input().split()))
print('Yes' if max(l) < sum(l) - max(l) else 'No')
money = for(int(i) for i in input().sprit())
mod = money[0] % 500
if money[1] >= mod:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

money = int(input())
coins = int(input())
mod = money % 500
if coins >= mod:
  print("Yes")
else:
  print("No")
n,x=map(int,input().split())
l=list(map(int,input().split()))
now=0
k=0
while now<=x and k<=n:
  now+=l[k]
  k+=1
print(k)

### FIXED CODE ###

n,x=map(int,input().split())
l=list(map(int,input().split()))
p=[0]*(n+1)
c=1
for i in range(n):
  p[i+1]=p[i]+l[i]
  if p[i+1]<=x:
    c+=1
print(c)
s, t = input().split()
a, b = map(int, input().split())
u = input()

if s == u:
    print(s - 1 , t)
else:
    print(s, t - 1)

### FIXED CODE ###

s, t = input().split()
a, b = map(int, input().split())
u = input()

if s == u:
    print(a - 1 , b)
else:
    print(a, b - 1)
#c.py
from math import gcd
def lcm(a, b):
    return a * b // gcd(a,b)
a,b,c,d = map(int,input().split())
canC = b//c -(a-1)//c
canD = b//d - (a-1)//d
dbCD = b//lcm(c,d) -(a-1)//lcm(c,d)
print((b-a+1) -canC - canD + dbCD)

### FIXED CODE ###

#c.py
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
def lcm(a, b):
    return a * b // gcd(a,b)
a,b,c,d = map(int,input().split())
canC = int(b//c) -int((a-1)//c)
canD = int(b//d) - int((a-1)//d)
dbCD = int(b//lcm(c,d)) -int((a-1)//lcm(c,d))
print((b-a+1) -canC - canD + dbCD)
input()
S=input()
k=int(input())
for s in S:print(s if s == s[k+1] else '*',end='')


### FIXED CODE ###

a,b,c=map(int,input().split())
print('Yes' if a<c<b or a>c>b else 'No')
import collections
list = [0] * 100000
N = int(input())
for i in range(N):
    t = input().split(" ")
    L = int(t[0])
    R = int(t[1])
    for j in range(L-1,R):
        list[j] = 1
CC = collections.Counter(list)
print(CC.most_common()[1][1])

### FIXED CODE ###

N = int(input())
ans = 0
for i in range(N):
    t = input().split(" ")
    L = int(t[0])
    R = int(t[1])
    ans += R - L + 1
print(ans)
N, K = [int(x) for x in input().split()]
Array = list()
A = list()
count = 0
ans = 0
for i in range(N):
	A.append[int(x) for x in input().split()]

A.sort(key=itemgetter(0), reverse=True)
for i in range(N):
	count += A[1, i]
	if count >= K:
		ans = A[0, i]
		break
		
print(ans)

### FIXED CODE ###

from operator import itemgetter

N, K = [int(x) for x in input().split()]
Array = list()
A = list()
count = 0
ans = 0
for i in range(N):
	A.append([int(x) for x in input().split()])

A.sort(key=itemgetter(0))
for i in range(N):
	count += A[i][1]
	if count >= K:
		ans = A[i][0]
		break
		
print(ans)
n=int(input())
d = list(map(int, input().split()))
a=0
for i in range(0,n,1):
  if d[i]==d[-1]:
     break
  if n==i+1:
     a+=d[i]*d[i+1]
     break
  for j in d[i+1:]:
    a+=d[i]*j
print(a)

### FIXED CODE ###

a, b=map(int, input().split())
if a-b*2<=0:
  print(0)
else: 
  print(a-b*2)