Harryxun/stf_run huggingface dataset:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque, Counter

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

fac = [-1] * (10**2+1)

fac[0] = fac[1] = 1

def initNCM(limit):
    for i in range(2, limit):
        fac[i] = fac[i-1] * i

def NCM(n, r):
    return fac[n] / (fac[r] * fac[n-r])

initNCM(51)

def main():
    N, A, B = LI()
    v = sorted(LI())[::-1]
    cnt = Counter(v)
    selected = v[:A]
    print(sum(selected)/A)
    ans = 1
    used = 0
    for x in selected:
        used += cnt[x]
    used -= cnt[selected[-1]]
    ans = 0
    if len(selected) > 1:
        use_last = A - used
        ans += NCM(cnt[selected[-1]], use_last)
    else:
        for use_last in range(1, N+1):
            if not A <= used + use_last <= B:
                continue
            if use_last > cnt[selected[-1]]:
                continue
            ans += NCM(cnt[selected[-1]], use_last)
    print(ans)

main()



### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque, Counter

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

fac = [-1] * (10**2+1)

fac[0] = fac[1] = 1

def initNCM(limit):
    for i in range(2, limit):
        fac[i] = fac[i-1] * i

def NCM(n, r):
    return fac[n] / (fac[r] * fac[n-r])

initNCM(100)

def main():
    N, A, B = LI()
    v = sorted(LI())[::-1]
    cnt = Counter(v)
    selected = v[:A]
    print(sum(selected)/A)
    ans = 1
    used = 0
    for x in list(set(selected)):
        used += cnt[x]
    used -= cnt[selected[-1]]
    ans = 0
    if len(list(set(selected))) > 1:
        use_last = A - used
        ans += NCM(cnt[selected[-1]], use_last)
    else:
        for use_last in range(1, N+1):
            if not A <= used + use_last <= B:
                continue
            if use_last > cnt[selected[-1]]:
                continue
            ans += NCM(cnt[selected[-1]], use_last)
    print(int(ans))

main()
N=int(input())
Vs=str(input())
Cs=str(input())
ListV=Vs.split()
ListC=Cs.split()
for i in range(0,len(ListV),1):
  a=ListV.pop(0)
  ListV.insert(0,int(a))

for i in range(0,len(ListC),1):
  b=ListC.pop(0)
  ListC.insert(0,int(b))

ListI=[]
for i in range(0,len(ListV),1):
  c=ListV[i]-ListC[i]
  ListI.append(c)

Ans=0
for i in range(0,len(ListI),1):
  if ListI[i]>0:
    Ans+=ListI[i]

print(Ans)


### FIXED CODE ###

N=int(input())
Vs=str(input())
Cs=str(input())
ListV=Vs.split()
ListC=Cs.split()
for i in range(0,len(ListV),1):
  a=ListV.pop(0)
  ListV.append(int(a))

for i in range(0,len(ListC),1):
  b=ListC.pop(0)
  ListC.append(int(b))

ListI=[]
for i in range(0,len(ListV),1):
  c=ListV[i]-ListC[i]
  ListI.append(c)

Ans=0
for i in range(0,len(ListI),1):
  if ListI[i]>0:
    Ans+=ListI[i]

print(Ans)
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
BC = [None] * M
for i in range(M):
    BC[i] = tuple(map(int, input().split()))
BC.sort(key=lambda tpl: tpl[1], reverse=True)  # sort by C descendant

D = [0] * N
i = 0
j = 0
while i < N and j < M:
    b, c = BC[j]
    for k in range(i, i + b):
        D[k] = c
    i += b
    j += 1

for i in range(N):
    A[i] = max(A[i], D[i])

print(sum(A))


### FIXED CODE ###

N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
BC = [None] * M
for i in range(M):
    BC[i] = tuple(map(int, input().split()))
BC.sort(key=lambda tpl: tpl[1], reverse=True)  # sort by C descendant

D = [0] * N
i = 0
j = 0
while i < N and j < M:
    b, c = BC[j]
    for k in range(i, min(i + b, N)):
        D[k] = c
    i += b
    j += 1

for i in range(N):
    A[i] = max(A[i], D[i])

print(sum(A))
import math
r=double(input())
m=r*r*math.pi
s=2*r*math.pi
print(m,s)


### FIXED CODE ###

import math
r=float(input())
m=r*r*math.pi
s=2*r*math.pi
print(m,s)
S = input()
T = input()
count = 0
flg = False
while True:
    flg = False
    for i in range(1,len(T)+1):
        if S[-i-count] != T[-i] and S[-i-count] != '?':
            count += 1
            flg = True
            break
    if count == len(S) - len(T):
        print('UNRESTORABLE')
        exit()
    if not flg:
        if count == 0:
            ans = S[0:len(S)-len(T)] + T
        elif count == len(S)-len(T):
            ans = T + S[:-len(S)+len(T)]
        else:
            ans = S[0:len(S)-len(T)-count] + T + S[-count:]
        print(ans.replace('?','a'))
        exit()

### FIXED CODE ###

S = input()
T = input()
count = 0
flg = False
if len(S) < len(T):
    print('UNRESTORABLE')
    exit()
while True:
    flg = False
    for i in range(1,len(T)+1):
        if S[-i-count] != T[-i] and S[-i-count] != '?':
            count += 1
            flg = True
            break
    if count == len(S) - len(T) + 1:
        print('UNRESTORABLE')
        exit()
    if not flg:
        if count == 0:
            ans = S[0:len(S)-len(T)] + T
        elif count == len(S)-len(T):
            ans = T + S[len(T):]
        else:
            ans = S[0:len(S)-len(T)-count] + T + S[-count:]
        print(ans.replace('?','a'))
        exit()
import sys
input = sys.stdin.readline

def main():
    x = int(input())

    for b in range(10**9):
        y = ((x + (-1 * b)**5)**(1/5)).is_integer()
        if y:
            print(int((x - b**5)**(1/5)), -1*b)
            break


if __name__ == '__main__':
    main()


### FIXED CODE ###

X = int(input())
C= [i**5 for i in range(120)]

a = 0
b = 0

for a in range(len(C)):
    for b in range(len(C)):
        if C[a] + C[b] == X:
            print(a, -b)
            exit(0)
        elif C[a] - C[b] == X:
            print(a, b)
            exit(0)
a, b, c, d = map(int, input().split())
if d*2 >= a-c
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a, b, c, d = map(int, input().split())
diff = max(abs(a-b), abs(b-c))
if diff <= d or abs(a-c) <= d:
    print("Yes")
else:
    print("No")
a,b,k=map(int,input().split())
numlst=[]
for i in range(1,max(a,b)):
    if a%i==0 and b%i==0:
        numlst.append(i)

print(numlst[k-1])

### FIXED CODE ###

a,b,k=map(int,input().split())
numlst=[]
for i in range(max(a,b)):
    if a%(i+1)==0 and b%(i+1)==0:
        numlst.append(i+1)

print(numlst[len(numlst)-k])
Q, H, S, D = map(int, input().split())
N = int(input())

most_bargain = min(8 * Q, 4 * H, 2 * S, D)
if most_bargain != D:
    print((most_bargain // 2) * N)
else:
    if N % 2 == 0:
        print((N // 2) * D)
    else:
        print((N // 2) * D + min(4 * Q, 2 * H, S))5410760474836152
1524157763907942

### FIXED CODE ###

Q, H, S, D = map(int, input().split())
N = int(input())

most_bargain = min(8 * Q, 4 * H, 2 * S, D)
if most_bargain != D:
    print((most_bargain // 2) * N)
else:
    if N % 2 == 0:
        print((N // 2) * D)
    else:
        print((N // 2) * D + min(4 * Q, 2 * H, S))
n=int(input())
a=list(map(int,input().split()))
lst1=[0]*(n+2)
lst2=[0]*(n+2)
lst1[1]=abs(a[0])
lst2[1]=abs(a[n-1])
for i in range(1,n):
  lst1[i+1]=lst1[i]+abs(a[i]-a[i-1])
  lst2[i+1]=lst2[i]+abs(a[n-i]-a[n-i-1])
lst1[n+1]=lst1[n]+abs(a[n-1])
lst2[n+1]=lst2[n]+abs(a[0])
print(lst2[n-1]+abs([1]))
for i in range(1,n-1):
  print(lst1[i]+lst2[n-i]+abs(a[i+1]-a[i-1]))
print(lst1[n-1]+abs([n-2]))

 


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
list1=[abs(a[0])]*(n+1)
list2=[abs(a[n-1])]*(n+1)
for i in range(n-1):
  list1[i+1]=list1[i]+abs(a[i+1]-a[i])
  list2[i+1]=list2[i]+abs(a[n-i-1]-a[n-i-2])
list1[n]=abs(a[n-1])
list2[n]=abs(a[0])
print(list2[n-2]+abs(a[1]))
for i in range(1,n-1):
  print(list2[n-2-i]+list1[i-1]+abs(a[i+1]-a[i-1]))
print(list1[n-2]+abs(a[n-2]))
A = input()
a =[A[i] for i in range(0,len(A)+1,2)]
print(','.join(a).replace(',',''))

### FIXED CODE ###

A = input()
a =[A[i] for i in range(0,len(A),2)]
print(','.join(a).replace(',',''))
n, m, k = map(int, input().split())
clusterN = [1] * n
clusterI = list(range(n))
out = [0] * n
def generateC(x):
  if clusterI[x] != x:
    minI = generateC(clusterI[x])
    clusterI[x] = minI
    return minI
  else:
    return x

def unite(x, y):
  CX = clusterI[x]
  CY = clusterI[y]
  if CX != CY:
    if clusterI[CX] > clusterI[CY]:
      CX, CY = CY, CX
      x, y = y, x
    clusterN[CX] += clusterN[CY]
    clusterI[CY] = CX
    generateC(y)
    

for _ in range(m):
  a, b = map(int, input().split())

  unite(a-1, b-1)
  out[a-1] -= 1
  out[b-1] -= 1

for _ in range(k):

  a, b = map(int, input().split())
  if clusterI[a-1] == clusterI[b-1]:
    out[a-1] -= 1
    out[b-1] -= 1
out = [out[i] + clusterN[clusterI[i]] - 1 for i in range(n)]
print(*out)

### FIXED CODE ###

n, m, k = map(int, input().split())
clusterN = [1] * n
clusterI = list(range(n))
out = [0] * n
def generateC(x):
  if clusterI[x] != x:
    minI = generateC(clusterI[x])
    clusterI[x] = minI
    return minI
  else:
    return x

def unite(x, y):
  CX = generateC(x)
  CY = generateC(y)
  if CX != CY:
    if CX > CY:
      CX, CY = CY, CX
      x, y = y, x
    clusterN[CX] += clusterN[CY]
    clusterI[CY] = CX
    generateC(y)
    

for _ in range(m):
  a, b = map(int, input().split())

  unite(a-1, b-1)
  out[a-1] -= 1
  out[b-1] -= 1

for _ in range(k):

  a, b = map(int, input().split())
  if generateC(a-1) == generateC(b-1):
    out[a-1] -= 1
    out[b-1] -= 1
out = [out[i] + clusterN[generateC(i)] - 1 for i in range(n)]
print(*out)
n = int(input())

for i in range(1, n):
    if i**2 <= n:
        ans = min(n, i**2)
    else:
        break

print(ans)


### FIXED CODE ###

n = int(input())

for i in range(1, n+1):
    if i**2 <= n:
        ans = min(n, i**2)
    else:
        break

print(ans)
s = list(input())
 
a = 0
 
if s[0] = 1:
  a + 1
 
if s[1] = 1:
  a + 1
 
if s[2] = 1:
  a + 1
  
print(a)

### FIXED CODE ###

s = list(input())
 
a = 0
 
if s[0] == "1":
  a = a + 1
 
if s[1] == "1":
  a = a + 1
 
if s[2] == "1":
  a = a + 1
  
print(a)
N = int(input())
*A, = map(int, input().split())
ans = 0
for a in A:
  while a % 2 == 0:
    a //= 2
    ans += 1
print(ans)

### FIXED CODE ###

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

if A <= 8 and B <= 8:
    print("Yay!")
else:
    print(":(")
n=int(input())
d=list(map(int,input().split()))

from collections import Counter
q=Counter(d)

if D[0]!=0:
    print(0)
    exit()

ans=1
for i in range(1,max(D)+1):
    ans*=q[i-1]**q[i]

print(ans%998244353)

### FIXED CODE ###

n = int(input())
d = list(map(int,input().split()))
 
from collections import Counter
q=Counter(d)

# 例外対応
if q[0]!=1 or d[0]!=0:
  print(0)
  exit()

ans = 1
for i in range(1,max(d)+1):
  ans *= q[i-1]**q[i]
  if ans == 0:
    break
print(ans%998244353)
from collections import Counter

N = int(input())
V = list(map(int,input().split()))
even = Counter(V[1::2]).most_common()+([0, 0])
odd = Counter(V[::2]).most_common()+([0, 0])
if(even[0][0] != odd[0][0]):
  print(N-even[0][1]-odd[0][1])
else:
  print(min(N-even[1][1]-odd[0][1], N-even[0][1]-odd[1][1]))


### FIXED CODE ###

N = int(input())
V = list(map(int,input().split()))
even = [0] * (10 ** 5 + 10)
odd = [0] * (10 ** 5 + 10)
for v in V[1::2]:
  even[v] += 1
for v in V[::2]:
  odd[v] += 1
max_even = max(even)
max_odd = max(odd)
if(even.index(max_even) != odd.index(max_odd)):
  print(N - max_even - max_odd)
else:
  even.sort(reverse = True)
  odd.sort(reverse = True)
  print(min(N - even[0] - odd[1], N - even[1] - odd[0]))
# 空の配列を用意して各要素の-1,0,+1を試して
# 値のインデックスに+1して最大値をとる

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

cnt = [0] * 100000

for i in a:
    for j in [-1,0,1]:
        cnt[i+j] += 1

print(max(cnt))

### FIXED CODE ###

# 辞書を用意して最大値を取得する

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

cnt = {}

for i in a:
    for j in [-1,0,1]:
        cnt.setdefault(i+j, 0)
        cnt[i+j] += 1

print(max(cnt.values()))
N, M = map(int, input().split())
S = input()
T = input()

# ユークリッドの互除法
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

length = N * M // gcd(N, M)
ans1 = ['']*length
ans2 = ['']*length

for i in range(N):
    index = i * length // N + 1
    ans1[index-1] = S[i]

for i in range(M):
    index = i * length // M + 1
    if ans1[index-1] != '' and ans1[index-1] != T[i]:
        length = -1
        break

print(length)


### FIXED CODE ###

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

# ユークリッドの互除法
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

length = N * M // gcd(N, M)

if S[0::length//M] == T[0::length//N]:
    print(length)
else:
    print(-1)
import sys
import math
import copy
a = int(input());
b = [int(input()) for i in range(a)];
c = 0;
f = max(b);
for i in range(a):
    if max(b) > b[i]:
        print(f);
    elif max(b) == b[i]:
        d = copy.copy(b);
        del d[i]
        e = max(d);
        print(e);


### FIXED CODE ###

import sys
r = int(input());
ans = 3*r*r;
print(ans);
import numpy as np

K,N=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
x=np.array(A[1:])
y=np.array(A[:-1])
B=x-y
B.append(K+A[0]-A[N-1])
print(K-max(B))

### FIXED CODE ###

import numpy as np

K,N=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
x=np.array(A[1:])
y=np.array(A[:-1])
B=x-y
C=B.tolist()
C.append(K+A[0]-A[N-1])
print(K-int(max(C)))
s = input()
print('{}{}{}'.format(s[0], len(s)-1, s[-1])

### FIXED CODE ###

s = input()
print('{}{}{}'.format(s[0], len(s)-2, s[-1]))
n,m=map(int,input().split())
def yak1(n,m):
  l=[]
  for i in range(1,min(int((m)**1/2),m//n)+1):
    if m%i==0:
      l.append(i)
      if m//i!=i and m//i<=m//n:
        l.append(m//i)
  return l
print(max(yak1(n,m)))     


### FIXED CODE ###

def make_divisors(n,m):
    divisors = []
    for i in range(1,min(int(m**(1/2))+1,int(m//n)+1)):
      if m % i == 0:
          divisors.append(i)
          if i != m // i and m//i<=m//n:
              divisors.append(m//i)
    return divisors
n,m=map(int,input().split())
print(max(make_divisors(n,m)))
n, m, v, p = map(int, input().split())
a = list(map(int, input().split()))

a.sort()
a = a[::-1]

s = [0] * (p - 1)
for i in range(p, n + 1):
    s.append(s[-1] + a[i - 1])


ans = 0
for i in range(1, n + 1):
    if i <= p:
        ans += 1
    else:
        if v <= p - 1:
            if a[i - 1] + m >= a[p - 1]:
                ans += 1

        else:
            if v - p <= n - i:
                if a[i - 1] + m >= a[p - 1]:
                    ans += 1
            else:
                if (a[i-1] + m) * (i - p) - s[i - 1] >= m * (v - p - n + i):
                    ans += 1

print(ans)


### FIXED CODE ###

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

a.sort()
a = a[::-1]

s = [0] * p
for i in range(p, n + 1):
    s.append(s[-1] + a[i - 1])
s = s[1:]

ans = 0
for i in range(1, n + 1):
    if i <= p:
        ans += 1
    else:
        if v - 1 <= p - 1:
            if a[i - 1] + m >= a[p - 1]:
                ans += 1

        else:
            if v - p <= n - i:
                if a[i - 1] + m >= a[p - 1]:
                    ans += 1
            else:
                if a[i - 1] + m < a[p - 1]:
                    continue
                elif a[i-1] * (i - p) >= m * (v - n) + s[i - 2]:
                    ans += 1

print(ans)
import string

count = {x: 0 for x in string.ascii_lowercase}

s = input().lower()

for c in s:
    if 'a' <= c <= 'z':
        count[c] += 1
        
for key, num in count:
    print("{0} : {1}".format(key, num))

### FIXED CODE ###

import string

count = {x: 0 for x in string.ascii_lowercase}
lines = ""

while True:
    try:
        lines += input().lower()
    except EOFError:
        break
        
for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1

for key, in string.ascii_lowercase:
    print("{0} : {1}".format(key, count[key]))
x=int(input())
print(!x)

### FIXED CODE ###

x=int(input())
if x==0: print (1)
else:    print (0)
n = input()
for num in range(n+1):
  total = total + num
print(total)

### FIXED CODE ###

n = int(input())
total = 0
for num in range(n+1):
  total = total + num
print(total)
S=list(input())
n=len(S)

def search(t):
    for i in range(t,n-1):
        if S[i]=='B' and S[i+1]=='W':
            S[i],S[i+1]='W','B'
            if t>0:
                return 1+search(t-1)
            else:
                return 1+search(1)
    return 0

print(search(0))


### FIXED CODE ###

S=list(input())
n=len(S)
ans=0
b=0

for s in S:
    if s=='B':b+=1
    else:ans+=b
    
print(ans)
= int(input())
L = map(int, input().split())

import itertools
l = list(itertools.combinations(L, 3))

a = 0
n = 0

for x in range(len(l)):
  if max(l[n]) < sum(l[n]) - max(l[n]):
    a += 1
    n += 1
  else:
    n += 1
    
print(a)

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = 0
from bisect import bisect_left
for i in range(n-2):
  for j in range(i+1, n-1):
    ab = l[i] + l[j]
    idx = bisect_left(l, ab)
    ans += max(idx-j-1, 0)
print(ans)
x, y = map(int(), input().split(' '))
print(x + y / 2)

### FIXED CODE ###

x, y = map(int, input().split(' '))
print(x + y // 2)
# お約束
INF = float("inf")
MOD = int(1e9 + 7)
def int1(n):
    return int(n) - 1
def parse(*args):
    return tuple(p(v) for p, v in zip(args, input().split()))

# Union-Find木
class uft:
    def __init__(self, n):
        self.height = [1] * n
        self.group = [-1] * n
    def root(self, v):
        if self.group[v] < 0:
            return v
        self.group[v] = self.root(self.group[v])
        return self.group[v]
    def size(self, v):
        return - self.group[self.root(v)]
    def equal(self, v1, v2):
        v1, v2 = self.root(v1), self.root(v2)
        return v1 == v2
    def merge(self, v1, v2):
        if self.equal(v1, v2):
            return False
        if self.height[v1] < self.height[v2]:
            self.group[v2] += self.group[v1]
            self.group[v1] = v2
            self.height[v2] = max(self.height[v1] + 1, self.height[v2])
        else:
            self.group[v1] += self.group[v2]
            self.group[v2] = v1
            self.height[v1] = max(self.height[v1], self.height[v2] + 1)
        return True

# エントリーポイント
def main():
    N, M = parse(int, int)
    AB = [tuple(map(int, input().split())) for _ in range(M)]

    fuben = N * (N - 1) // 2
    g, rs = uft(N), [fuben]
    for a, b in reversed(AB):
        a, b = a - 1, b - 1
        if not g.equal(a, b):
            fuben -= g.size(a) * g.size(b)
            g.merge(a, b)
        rs += [fuben]
    for r in reversed(rs[:-1]):
        print(r)

main()


### FIXED CODE ###

N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(M)]

uft = [-1] * N
def uft_root(a):
	if uft[a] < 0:
		return a
	uft[a] = uft_root(uft[a])
	return uft[a]

def uft_same(a, b):
	return (uft_root(a) == uft_root(b))

def uft_size(a):
	return -uft[uft_root(a)]

def uft_merge(a, b):
	if uft_same(a, b):
		return
	hi, lo = uft_root(a), uft_root(b)
	if -uft[hi] < -uft[lo]:
		hi, lo = lo, hi
	uft[hi] += uft[lo]
	uft[lo] = hi

result = [(N * (N - 1)) // 2]
for a, b in AB[::-1]:
	a, b = a - 1, b - 1
	if uft_same(a, b):
		result += [result[-1]]
		continue
	result += [result[-1] - (uft_size(a) * uft_size(b))]
	uft_merge(a, b)

for l in result[::-1][1:]:
	print(l)
def gcd(a,b):
     
    # Everything divides 0 
    if (a == 0 or b == 0):
        False
    # base case
    if (a == b):
        return a
 
    # a is greater
    if (a > b):
        return gcd(a-b, b)
    return gcd(a, b-a)
for _ in range(int(input())):
    a,b,c,d=[int(x) for x in input().split()]
    if a<b:
        print("No")
        continue
    if d<b:
        print("No")
        continue
    if b<=c:
        print("Yes")
        continue
    g=gcd(b,d)
    if c>=b-g+a%g:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

def gcd(a, b): 
    if a == 0 :
        return b 
    return gcd(b%a, a)
for _ in range(int(input())):
    a,b,c,d=[int(x) for x in input().split()]
    if a<b:
        print("No")
        continue
    if d<b:
        print("No")
        continue
    if b<=c:
        print("Yes")
        continue
    g=gcd(b,d)
    if c>=b-g+a%g:
        print("Yes")
    else:
        print("No")
a = int(input())
b = int(input())
if a > b:
    print(GREATER)
elif a < b:
    print("LESS")
else:
    print("EQUAL")

### FIXED CODE ###

a = int(input())
b = int(input())
if a > b:
    print("GREATER")
elif a < b:
    print("LESS")
else:
    print("EQUAL")
#!/usr/bin/env python3

import collections

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

c = collections.Counter(A)
values = c.keys()
counts = c.values()


ans = 0
for i in range(len(values)):
    tmp = counts[i]
    ans += (tmp * (tmp-1))//2

for i in range(N):
    num = A[i]
    index = values.index(num)
    print(ans - counts[index] + 1)


### FIXED CODE ###

#!/usr/bin/env python3

import collections

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

c = collections.Counter(A)
values = c.keys()
counts = c.values()

subs = {}
a_sum = 0
for v, c in zip(values, counts):
    subs[v] = c
    a_sum += (c * (c-1)) // 2

for i in range(N):
    print(a_sum - subs[A[i]] + 1)
from math import gcd

a,b = map(int,input().split())
c = a*b//gcd(a,b)
print(c)

### FIXED CODE ###

from fractions import gcd

a,b = map(int,input().split())
print(a*b//gcd(a,b))
a,b=input().split()
N=int(a+b)

for i in range(N):
  s=N//i
  if N%i==0 and s==i:
    pritn("Yes")
  else:
    print("No")

### FIXED CODE ###

a,b=input().split()
N=int(a+b)
 
flag=1
for i in range(1,N):
  s=N//i
  if N%i==0 and s==i:
    print("Yes")
    flag=0
    break
if flag==1:
  print("No")
N, M = map(int, input().split())
li = [[] for i in range(N+1)]
for i in range(M):
  a, b = map(int, input().split())
  li[a].append(b)
  li[b].append(a)
  
ans = 0
for i in range(1, N+1):
  s = set(li[i])
  for x in s:
    for y in li[x]:
      if y == i:
        pass
      elif y in s:
        pass
      else:
        s.add(y)
  ans = max(ans, len(s)+1)
print(ans)

### FIXED CODE ###

class UnionFind:
    def __init__(self, n):
        self.n = n
        self.parent = [i for i in range(n)]  # 親
        self.rank = [1] * n  # 木の高さ
        self.size = [1] * n  # size[i] は i を根とするグループのサイズ

    def find(self, x):  # x の根を返す
        if self.parent[x] == x:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])  # 経路圧縮
            return self.parent[x]

    def unite(self, x, y):  # x, y の属する集合を併合する
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                self.parent[x] = y
                self.size[y] += self.size[x]
            else:
                self.parent[y] = x
                self.size[x] += self.size[y]
                if self.rank[x] == self.rank[y]:
                    self.rank[x] += 1

    def is_same(self, x, y):  # x, y が同じ集合に属するか判定する
        return self.find(x) == self.find(y)

    def group_size(self, x):  # x が属する集合の大きさを返す
        return self.size[self.find(x)]


N, M = map(int, input().split())
A, B = [0] * M, [0] * M  # 入力時に 0-index に合わせる

direct =[[] for _ in range(N)]  # 同じ集合の友達もしくはブロック関係の人
uf = UnionFind(N)  # 友達関係をまとめた UnionFind 木

for i in range(M):
    A[i], B[i] = map(int, input().split())
    A[i] -= 1
    B[i] -= 1
    direct[A[i]].append(B[i])
    direct[B[i]].append(A[i])
    uf.unite(A[i], B[i])

ans = [0] * N
for i in range(N):
    ans[i] = uf.group_size(i)
print(max(ans))