Harryxun/stf_run huggingface dataset:
import math
import collections
import itertools
import copy

def YesNo(Bool):
    if(Bool):
        print("YES")
    else:
        print("NO")
    return

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

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

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

def resolve():

    N,M=map(int,input().split())
    A=[0]*M
    B=[0]*M

    uf = UnionFind(N)
    for i in range(M):
        A[i],B[i]=map(int,input().split())
        uf.union(A[i], B[i])
        
    cnt=uf.group_count()

    print(cnt-1)

resolve()


### FIXED CODE ###

import math
import collections
import itertools
import copy

def YesNo(Bool):
    if(Bool):
        print("YES")
    else:
        print("NO")
    return

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

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

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

def resolve():

    N,M=map(int,input().split())
    A=[0]*M
    B=[0]*M

    uf = UnionFind(N)
    for i in range(M):
        A[i],B[i]=map(int,input().split())
        uf.union(A[i]-1, B[i]-1)
        
    # for i in range(N):
    #     uf.find(i)

    cnt=uf.group_count()

    print(cnt-1)

resolve()
N = int(input())
F = []
for i in range(N):
  a,b = map(int,input().split())
  F.append([a+b],a,b)
F.sort(key=lambda x:x[0],reverse=True)
ans = 0
for i in range(N):
  if i%2==0:
    ans += F[i][1]
  else:
    ans -= F[i][2]
print(ans)

### FIXED CODE ###

N = int(input())
F = []
for i in range(N):
  a,b = map(int,input().split())
  F.append([a+b,a,b])
F.sort(key=lambda x:x[0],reverse=True)
ans = 0
for i in range(N):
  if i%2==0:
    ans += F[i][1]
  else:
    ans -= F[i][2]
print(ans)
#! env/bin/local python3
# -*- coding: utf-8 -*-

conditions = []

n, m = map(int, input().split())
while True:
    try:
        conditions.append(list(map(int, input().split())))
    except EOFError:
        break

number: list = [0] * n

is_ok = True
for c in conditions:
    if number[c[0]-1] == 0 or number[c[0]-1] == c[1]:
        number[c[0]-1] = c[1]
    else:
        is_ok = False

if number[0] == 0:
    is_ok = False

if is_ok:
    number = [str(i) for i in number]
    number = ''.join(number)
    number = int(number)
    print(number)
else:
    print(-1)






### FIXED CODE ###

#! env/bin/local python3
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
conditions = []
while True:
    try:
        conditions.append(list(map(int, input().split())))
    except EOFError:
        break

for i in range(0, 10**n):
    if len(str(i)) != n:
        continue
    flag = True
    for c in conditions:
        if str(i)[c[0]-1] != str(c[1]):
            flag = False

    if flag:
        print(i)
        break
else:
    print(-1)
import math
inp = input().split()
n,k = int(inp[0]),int(inp[1])
a = [int(x) for x in input().split()]
a.sort()
ans =0
for ini in range(0,n-k+1):
  for end in range(ini+k-1,n):
    m = end-ini-1
    r = k-2
    combi = math.factorial(m) // (math.factorial(m - r) * math.factorial(r))
    ans += (a[end]-a[ini])*combi

ans = ans % (10**9+7)
print(ans)

### FIXED CODE ###

abc='abcdefghijklmnopqrstuvwxyz'
x=input()
print(abc[abc.index(x)+1])
a = str(input())
if '7' in a:
  print('Yes')
else:
  print('No)

### FIXED CODE ###

a = str(input())
if '7' in a:
  print('Yes')
else:
  print('No')
W,H,x,y = map(int,input().split())

if W/x == 2 and Y/2 == 2:
    print(W*H/2, 1)
else:
    print(W*H/2, 0)

### FIXED CODE ###

W,H,x,y = map(int,input().split())

if x * 2 == W and y * 2 == H:
    print(W*H/2, 1)
else:
    print(W*H/2, 0)
import sys
sys.setrecursionlimit(100000)

n = int(input())
h = list(map(int, input().split()))
cost = [-1] * n

def ans(n):
  if cost[n] != -1:
    return cost[n]
  cost[n] = min(ans(n-1) + abs(h[n-1] - h[n]), ans(n-2) + abs(h[n-2] - h[n]))
  return cost[n]

cost[0] = 0
cost[1] = abs(h[0] - h[1])
print(ans(n-1))

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

n = int(input())
h = list(map(int, input().split()))
cost = [-1] * n

def ans(n):
  if cost[n] != -1:
    return cost[n]
  cost[n] = min(ans(n-1) + abs(h[n-1] - h[n]), ans(n-2) + abs(h[n-2] - h[n]))
  return cost[n]

cost[0] = 0
cost[1] = abs(h[0] - h[1])
print(ans(n-1))
n = int(input())
a = list(map(int,input(),split()))
s = [0]*max(a)+2
for i in a:
    i += 1
    s[i-1] += 1
    s[i] += 1
    s[i+1] += 1

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
s = [0]*(max(a)+4)
for i in a:
    s[i] += 1
    s[i+1] += 1
    s[i+2] += 1

print(max(s))
# 最大公約数(mathは3.5以降) 
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

# 初期入力
import sys
#input = sys.stdin.readline  #文字列では使わない
N,X = map(int, input().split())
x = list(map(int, input().split()))

# ｘの隣同士の距離リスト
x_div =[abs(X-x[0])] #初項
for i in range(N):
    x_div.append(abs(x[i] -x[i+1]))

#x_divの最大公約数
if N ==1:
    ans =abs(x[0] -X)
else:
    ans =gcd_list(x_div)
print(ans)

### FIXED CODE ###

# 最大公約数(mathは3.5以降) 
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

# 初期入力
import sys
#input = sys.stdin.readline  #文字列では使わない
N,X = map(int, input().split())
x = list(map(int, input().split()))

# ｘの隣同士の距離リスト
x_div =[abs(X-x[0])] #初項
for i in range(N-1):
    x_div.append(abs(x[i] -x[i+1]))

#x_divの最大公約数
if N ==1:
    ans =abs(x[0] -X)
else:
    ans =gcd_list(x_div)
print(ans)
n, k = map(int, input().split())
p = list(map(int, input().split()))

maxexp = 0
for i in range(n-k+1):
    kdice = [float((1+p[i+j])/2) for j in range(k)]
    sumkdice = sum(kdice)
    if sumkdice > maxexp:
        maxexp = sumkdice

print(maxexp)

### 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)
passengers, bus_size, time_lim = map(int, input().split())
pass_list = [int(input()) for passenger in range(passengers)]
pass_list.sort()
front = 0
now = 0
cnt = 0
ans = 0
for psngr_lst in pass_list:
    if cnt == 0:
        front = i
        now = i
        cnt += 1
    elif cnt == bus_size:
        front = i
        now = i
        cnt = 1
        ans += 1
    elif now - front <= time_lim:
        if i - front <= time_lim:
            now = i
            cnt += 1
        else:
            front = i
            now = i
            cnt = 1
            ans += 1
if cnt:
    ans += 1
print(ans)
        

### FIXED CODE ###

passengers, bus_size, time_lim = map(int, input().split())
pass_list = [int(input()) for passenger in range(passengers)]
pass_list.sort()
front = 0
now = 0
cnt = 0
ans = 0
for psngr_lst in pass_list:
    if cnt == 0:
        front = psngr_lst
        now = psngr_lst
        cnt += 1
    elif cnt == bus_size:
        front = psngr_lst
        now = psngr_lst
        cnt = 1
        ans += 1
    elif now - front <= time_lim:
        if psngr_lst - front <= time_lim:
            now = psngr_lst
            cnt += 1
        else:
            front = psngr_lst
            now = psngr_lst
            cnt = 1
            ans += 1
if cnt:
    ans += 1
print(ans)
import sys
s=input()
t=input()
def hanten(*S,c1,c2):
  for i range(len(S)):
    if S[i]==c1:
      S[i]=c2
    if S[i]==c2:
      S[i]=c1
for j,k in s:
  if hanten(s,j,k)==t:
    print('Yes')
    sys.exit()
print('No')

### FIXED CODE ###

import collections
s=input()
t=input()
cnt1=1
cnt2=1
lst1=[]
lst2=[]
for i in range(len(s)-1):
  if s[i]==s[i+1]:
    cnt1+=1
  else:
    lst1.append(cnt1)
for j in range(len(t)-1):
  if t[j]==t[j+1]:
    cnt2+=1
  else:
    lst2.append(cnt2)
S=collections.Counter(s)
T=collections.Counter(t)
S_=list(S.values())
T_=list(T.values())
S_.sort()
T_.sort()
if S_==T_ and lst1==lst2:
  print('Yes')
else:
  print('No')
n = int(input("N>"))
a = int(input("A>"))
b = int(input("B>"))

if a>0:
    if n-n//(a+b)*(a+b)>a:
        print(n//(a+b)*a+a)
    else:
        print(n//(a+b)*a+n-n//(a+b)*(a+b))
else:
    print(0)


### FIXED CODE ###

n,a, b = map(int, input().split()) 
if a>0:
    if n-n//(a+b)*(a+b)>a:
        print(n//(a+b)*a+a)
    else:
        print(n//(a+b)*a+n-n//(a+b)*(a+b))
else:
    print(0)
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
	for j in range(1,105):
		for k in range(1,105):
			v = i*i+j*j+k*k+i*j+j*k+k*i;
			if v<10050:
				ans[v]+=1
for i in range(n):
print(ans[i+1])

### FIXED CODE ###

n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
	for j in range(1,105):
		for k in range(1,105):
			v = i*i+j*j+k*k+i*j+j*k+k*i;
			if v<10050:
				ans[v]+=1
for i in range(n):
	print(ans[i+1])
N,K=map(int,input().split())
a=set([])
for i in range(K):
    d=int(input())
    for i in range(d):
        L=list(map(int,input().split()))
        for x in L:
            a.add(x)
print(N-len(a))

### FIXED CODE ###

N,K=map(int,input().split())
a=set([])
for i in range(K):
    d=int(input())
    L=list(map(int,input().split()))
    for x in L:
        a.add(x)
print(N-len(a))
s = int(input())
t = int(input())

s = [_ for _ in s]
t = [_ for _ in t]

count = 0
for i in 3:
  if s[i] == t[i]:
    count += 1
print(count)

### FIXED CODE ###

s = str(input())
t = str(input())

s = [_ for _ in s]
t = [_ for _ in t]

count = 0
for i in range(3):
  if s[i] == t[i]:
    count += 1
print(count)
# C
import collections
n = int(input())
lst = list(map(int, input().split()))
lst1 = lst[::2]
lst2 = lst[1::2]
dct1 = sorted(dict(collections.Counter(lst1)).items(), key=lambda x:x[1])
dct2 = sorted(dict(collections.Counter(lst2)).items(), key=lambda x:x[1])

cnt = len(dict(collections.Counter(lst)))
if (cnt == 1):
	print(int(len(lst) / 2))
elif (len(dct1) == 1 and len(dct2) == 1):
	print(0)
elif (len(dct1) == 1 and len(dct2) > 1):
	if (dct1[0][0] == dct2[0][0]):
		print(len(dct2) - dct2[1][1])
	else:
		print(len(dct2) - dct2[0][1])
elif (len(dct2) == 1 and len(dct1) > 1):
	if (dct1[0][0] == dct2[0][0]):
		print(len(dct1) - dct1[1][1])
	else:
		print(len(dct1) - dct1[0][1])
else:
	if (dct1[0][0] == dct2[0][0]):
		print(len(lst) - max(dct1[0][1] + dct2[1][1], dct1[1][1] + dct2[0][1]))
	else:
		print(len(lst) - dct1[0][1] - dct2[0][1])


### FIXED CODE ###

s = list(input())
for i in range(len(s)):
    if (s[i] == '1'):
        s[i] = '9'
    else:
        s[i] = '1'
print("".join(s))
import math
from scipy.special import comb

n, a, b, k = map(int, input().split())
count = 0
for i in range(math.floor(k/a)):
    if (k - (i * a)) % b == 0:
        count += (comb(n, i) * comb(n, (k-a*i)/b))
print(count%998244353)

### FIXED CODE ###

N,A,B,K = map(int,input().split())
sprime = 998244353 # approx 10**9
A,B = sorted((A,B))
if (A+B) * N < K:
	print(0)
	exit()
 
def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)
 
def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m
 
memo = [0] * (N+1)
memo[0] = memo[N] = 1
for i in range(1,N//2+1):
	v = memo[i-1] * (N-i+1) * modinv(i,sprime)
	v = v % sprime
	memo[i] = memo[N-i] = v
 
# max is A*N + B*N
sum = 0
for b in range(N+1):
  a = (K-b*B)//A
  if 0 <= a <= N and a*A+b*B == K:
    sum += memo[a]*memo[b]
    sum %= sprime
 
print(sum)
import math
n, k = input().split(" ")
n= int(n)
k= int(k)
dig = (math.floor(math.log(n) / math.log(k)) + 1)
print(dig)

### FIXED CODE ###

n, r = input().split(" ")
n=int(n)
r=int(r)
if n<10:
    print((100*(10-n))+r)
else:
    print(r)
N = int(input())
S = input()
CS = [0]*N
for i in range(1,N):
  if S[i] == 'W':
    CS[i] = CS[i-1]+1
  else:
    CS[i] = CS[i-1]-1
min_value = min(CS)
Leader = CS.index(min_value) + 1
counter = 0
for i in range(1,Leader):
  if CS[i]<CS[i+1]:
    counter += 1
for i in range(Leader,N-1):
  if CS[i]>CS[i+1]:
    counter +=1
print(counter)

### FIXED CODE ###

N = int(input())
S = input()
W = S.count('W')
E = S.count('E')
counter = len(S)
cost = E
for i in range(len(S)):
  if S[i] == 'E':
    cost -= 1
    if cost < counter:
      counter = cost
  else:
    if cost < counter:
      counter = cost
    cost +=1
print(counter)
import math
Target = int(input())
original = 100
i=0;
while(1)
 i=i+1;
 original = int(original + original*0.01)
 if(original > target)
   print(i)
   break;

### FIXED CODE ###

Target = int(input())
original = 100
i=1;
while(1):
 original = original + int(original*0.01)
 if(original >= Target):
   print(i)
   break;
 i=i+1;
for i in range(1,int(input())+1):
 a=i
 while(a>0):
  if a%3==0 or a%10==3:
   print(f' {i}',end=' ')
   break
  a/=10

### FIXED CODE ###

print('',*[i for i in range(3,int(input())+1)if i%3==0 or'3'in str(i)])
import collections

N = int(input())
V = list(map(int,input().split()))

L1 = []
L2 = []

for i in range(N):
  if i % 2 == 0:
    L1.append(V[i])
  else:
    L2.append(V[i])
    
con1 = collections.Counter(L1).most_common()
con2 = collections.Counter(L2).most_common()

nums = 0


#全てが同じなら全体の半数を変える
if len(set(V)) == 1:
  print(N // 2)

#分割数列のそれぞれが全て等しい数からできているなら変える必要はない
elif len(set(L1)) == 1 and len(set(L2)) == 1:
  print(0)

else:
  ans = 0
  total = 0
  if con1[0][0] == con2[0][0]:
    for i in range(1,len(con1)):
      total += con1[i][1]
    for i in range(2,len(con2)):
      total += con2[i][1]
    total += con[0][1]
    for i in range(1,len(con2)):
      ans += con2[i][1]
    for i in range(2,len(con1)):
      ans += con1[i][1]
    ans += con1[0][1]
    ans = min(ans,total)
  else:
    for i in range(1,len(con1)):
      ans += con1[i][1]
    for i in range(1,len(con2)):
      ans += con2[i][1]
    
  print(ans)

### FIXED CODE ###

import collections

N = int(input())
V = list(map(int,input().split()))

L1 = []
L2 = []

for i in range(N):
  if i % 2 == 0:
    L1.append(V[i])
  else:
    L2.append(V[i])
    
con1 = collections.Counter(L1).most_common()
con2 = collections.Counter(L2).most_common()

nums = 0

#全てが同じなら全体の半数を変える
if len(set(V)) == 1:
  print(N // 2)

#分割数列のそれぞれが全て等しい数からできているなら変える必要はない
elif len(set(L1)) == 1 and len(set(L2)) == 1:
  print(0)
#
else:
  ans = 0
  total = 0
  if con1[0][0] == con2[0][0]:
  
    for i in range(1,len(con1)):
      total += con1[i][1]
    for i in range(2,len(con2)):
      total += con2[i][1]
    total += con2[0][1]
    
    for i in range(1,len(con2)):
      ans += con2[i][1]
    for i in range(2,len(con1)):
      ans += con1[i][1]
    ans += con1[0][1]
    
    ans = min(ans,total)
    
  else:
    for i in range(1,len(con1)):
      ans += con1[i][1]
    for i in range(1,len(con2)):
      ans += con2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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
for i in range(int(input()),0,-1):
  if l[i]==1:print(i);break

### FIXED CODE ###

from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

x = readInt()
l = [0]*(x+1)
l[1]=1

for i in range(2,len(l)):
  if l[i]==0:
    j = i*i
    while 1:
      if j>len(l)-1:
        break
      else:
        l[j]=1
        j*=i


for i in range(len(l)-1,-1,-1):
  if l[i]==1:
    print(i)
    break
N,X = map(int, input().split())
D=0
L=list(map(int, input().split()))
i=0
while ((D<=X)and(i<(N))):
  D+=L[i]
  i+=1
print(i)
  
  

### FIXED CODE ###

A,X= map(int, input().split())
if A<X:
  print("0")
else:
  print("10")
a,b=map(int, input().split())
print((a*a)-b)


### FIXED CODE ###

a=int(input())
b=int(input())
print((a*a)-b)
a = int(input())
b = int(input())
mean = (a + b) / 2
print(math.ceil(mean))

### FIXED CODE ###

import math
 
a, b = map(float, input().split())

mean = (a + b) / 2
print(math.ceil(mean))
n,x = [int(i) for i in input().split()]
a = [i for i in range(1,2*n)]

def swap(a,i,j):
    b = a[i]
    a[i] = a[j]
    a[j] = b

if x==1 or x==2*n -1:
    print("No")
else:
    print("Yes")
    if x==n:
        pass
    elif x>n:
        swap(a,n-1,x-1)
        swap(a,x,2*n-2)
        swap(a,x+1,0)
    else:
        swap(a,n-1,x-1)
        swap(a,x-2,0)
        swap(a,x-3,2*n-2)
    for i in a:
        print(i)

### FIXED CODE ###

n,x = [int(i) for i in input().split()]
a = [i for i in range(1,2*n)]

def swap(a,i,j):
    b = a[i]
    a[i] = a[j]
    a[j] = b

if x==1 or x==2*n -1:
    print("No")
else:
    print("Yes")
    if x==n:
        pass
    elif x>n:
        swap(a,n-1,x-1)
        swap(a,n,2*n-2)
        swap(a,n+1,0)
    else:
        swap(a,n-1,x-1)
        swap(a,n-2,0)
        swap(a,n-3,2*n-2)
    for i in a:
        print(i)
while True:
    count = 0
    num = [int(i) for i in input().split("")]
    if num[0] == 0:
        break
    for n in num:
        count += n
    print(count, end ="\n")
     

### FIXED CODE ###

while True:
    x = input()
    if x == "0":
        break
    num = [int(i) for i in x]
    print(sum(num))
N= int(input())
S=[ input() for _ in range(N) ]

a=0
w=0
t=0
r=0

for i range(N):
  if S[i]=="AC":
    a+=1
  elif S[i]=="WA":
    w+=1
  elif S[i]=="TLE":
    t+=1
  elif S[i]=="RE":
    r+=1

print("AC × "　+ "str(a)")
print("WA × "　+ "str(w)")
print("TLE × "　+ "str(t)")
print("RE × "　+ "str(r)")

### FIXED CODE ###

N=int(input())
S=[input() for _ in range(N)]

a=0
w=0
t=0
r=0

for i in range(N):
  if S[i] =="AC":
    a+=1
  elif S[i] =="WA":
    w+=1
  elif S[i] =="TLE":
    t+=1
  elif S[i] =="RE":
    r+=1

print("AC x "+ str(a))
print("WA x "+ str(w))
print("TLE x "+ str(t))
print("RE x "+ str(r))
N=int(input())
A=input().split()

B=set(A)
if len(A)=len(B):
    print("YES")
else:
    print("NO")

### FIXED CODE ###

N=int(input())
A=input().split()

B=set(A)
if len(A)==len(B):
    print("YES")
else:
    print("NO")
class struct:
  def __init__(self,a,b):
    self.a=a
    self.b=b

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

l2=[struct(0,0) for _ in 3]
l2[0].a=l[0]
l2[1].a=l[1]
l2[1].b=abs(l[0]-l[1])

for x in l[2:]:
  l[0]=l[1]
  l[1]=l[2]
  l2[2].a=x
  l2[2].b=min(abs(l2[0].a-x)+l2[0].b,
    abs(l2[1].a-x)+l2[1].b)

print(l2[2].b)

### FIXED CODE ###

class struct:
  def __init__(self,a,b):
    self.a=a
    self.b=b

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

l2=[struct(0,0) for _ in range(n)]
l2[0].a=l[0]
l2[1].a=l[1]
l2[1].b=abs(l[0]-l[1])

i=2
for x in l[2:]:
  l2[i].a=x
  l2[i].b=min(abs(l2[i-2].a-x)+l2[i-2].b,
    abs(l2[i-1].a-x)+l2[i-1].b)
  i+=1

print(l2[-1].b)
n = int(input())
a = list(map(int, input().split(" ")))

colors=[]
if list(filter(lambda x:x<3200, a)):
    f=lambda x:x<400
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:400<=x<800
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:800<=x<1200
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:1200<=x<1600
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:1600<=x<2000
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2000<=x<2400
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2400<=x<2800
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2800<=x<3200
    colors.append(1 if list(filter(f, a)) else 0)

    print(sum(colors), sum(colors)+len(list(filter(lambda x:3200<=x, a)))

else:
    print(1, n)



### FIXED CODE ###

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

colors=[]
if list(filter(lambda x:x<3200, a)):
    f=lambda x:x<400
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:400<=x<800
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:800<=x<1200
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:1200<=x<1600
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:1600<=x<2000
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2000<=x<2400
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2400<=x<2800
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2800<=x<3200
    colors.append(1 if list(filter(f, a)) else 0)

    print(sum(colors), sum(colors)+len(list(filter(lambda x:3200<=x, a))))

else:
    print(1, n)
x,ans=int(input()),1
for i in range(int(x**0.5)+1):
  ans = max(ans, max(i**j for j in range(10) if i**j<=x))
print(ans)

### FIXED CODE ###

a,b,c,d=map(int,input().split())
print(["No","Yes"][abs(a-c)<=d or (abs(a-b) <= d and abs(b-c)<=d)])