Harryxun/stf_run huggingface dataset:
n,m = map(int,input().split())
A = list(input().split())
B = sum(A)
a = 0
for i in range(n):
    if A[i] >= B/(4*m):
        a += 1
if a >= m:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n,m = map(int,input().split())
A = [int(x) for x in input().split()]
B = sum(A)
a = 0
for i in range(n):
    if A[i] >= B/(4*m):
        a += 1
if a >= m:
    print("Yes")
else:
    print("No")
total = int(input())
text = input()

res = 0

if total != 0:
    for x in range(0, total - 1):
        if text[x] == "A":
            if x + 2 <= total:
                if text[x + 1] == "B" and text[x + 2] == "C":
                    res += 1

print(res)

### FIXED CODE ###

total = int(input())
text = input()

res = 0

if total >= 3:
    for x in range(0, total - 1):
        if text[x] == "A":
            if x + 3 <= total:
                if text[x + 1] == "B" and text[x + 2] == "C":
                    res += 1

print(res)
S = list(input())

def hantei(S):
    flag = True
    if S[0:5] == list('dream'):
        del(S[0:5])
        if S[0:2] == list('er') and S[2] != 'a':
            del(S[0:2])
    elif S[0:5] == list('erase'):
        del(S[0:5])
        if S[0:1] == list("r"):
            del(S[0])
    else:
        flag = False
    return S, flag

flag = True
while flag == True:
    if len(S) == 0:
        print("YES")
        break
    S, flag = hantei(S)
if flag == False:
    print("NO")

### FIXED CODE ###

S = list(input())

flag = True
while flag == True:
    if len(S) == 0:
        break
    if len(S) >= 5:
        if S[-5:] == list("dream"): del S[-5:]
        elif S[-5:] == list("erase"): del S[-5:]
        elif len(S)>=6 and S[-6:] == list("eraser"): del S[-6:]
        elif len(S)>=7 and S[-7:] == list("dreamer"): del S[-7:]
        else:
            flag = False
    else:
        flag = False
if flag:
    print("YES")
else:print("NO")
class UnionFind():
    def __init__(self, n):
        self.__parent = [i for i in range(n)]
        self.size = [1 for _ in range(n)]

    def union(self, x, y):
        pX, pY = self.find(x), self.find(y)
        if pX != pY:
            if pX < pY:
                self.__parent[pY] = pX
                self.size[pX] += self.size[pY]
            else:
                self.__parent[pX] = pY
                self.size[pY] += self.size[pX]                                                                 

    def find(self, x):
        if self.__parent[x] != x:
            self.__parent[x] = self.find(self.__parent[x])
        return self.__parent[x]

N, M = map(int, input().split())
bridge = [tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(M)]
uf = UnionFind(N)
num_disconnect = int(N*(N-1)/2)
ans = []
for a, b in reversed(bridge):
    ans.append(num_disconnect)
    pA, pB = uf.find(a), uf.find(b)
    if pA != pB:
        num_disconnect -= uf.size[pA] * uf.size[pB]
    uf.union(a, b)

for i in reversed(ans): print(i) 

### FIXED CODE ###

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

if b//a >= c: print(c)
else: print(b//a)
import bisect
a,b,q=map(int,input().split())
inf=10**18
s=[-inf]+[int(input()) for _ in range(a)]+[inf]
t=[-inf]+[int(input()) for _ in range(b)]+[inf]
for _ in range(q):
  x=int(input())
  b,d=bisect.bisect_right(s,x),bisect.bisect_right(t,x)
  res=inf
  for i in [s[b-1],s[b]]:
    for j in [t[d-1],s[d]]:
      d1,d2=abs(i-x)+abs(i-j),abs(j-x)+abs(j-i)
      res=min(res,d1,d2)
  print(res)
#copy code.


### FIXED CODE ###

import bisect
A, B, Q = map(int, input().split())
INF=10**18
s=[-INF] + [int(input()) for i in range(A)] + [INF]
t=[-INF] + [int(input()) for i in range(B)] + [INF]
for q in range(Q):
  x = int(input())
  b, d = bisect.bisect_right(s, x), bisect.bisect_right(t, x)
  res = INF
  for S in [s[b - 1], s[b]]:
    for T in [t[d - 1], t[d]]:
      d1, d2 = abs(S - x) + abs(T - S), abs(T - x) + abs(S - T)
      res = min(res, d1, d2)
  print(res)
#copy code.
N = int(input())
A = list(map(int, input().split()))

ANS = []
for i in range(N):
  Alist = A[:i]+A[i+1:]
  ANS.append(max(Alist))

for i in ANS:
    print(i)

### FIXED CODE ###

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

maxA = max(A)
max_in = A.index(max(A))
ANS = [maxA]*N
ANS[max_in] = max(A[:max_in]+A[max_in+1:])

for i in ANS:
    print(i)
N = int(input())
ans = 0
dict_word = {}
for i in range(N):
  sorted_word = [''.join(sorted(list(input()))) for i in range(N)]
  try:
    ans += dict_word[sorted_word]
    dict_word[sorted_word] += 1
  except:
    dict_word[sorted_word] = 1

print(ans)


### FIXED CODE ###

N = int(input())
ans = 0
dict_word = {}
for i in range(N):
  sorted_word = str(''.join(sorted(list(input()))))
  try:
    ans += dict_word[sorted_word]
    dict_word[sorted_word] += 1
  except:
    dict_word[sorted_word] = 1
print(ans)
n,m = list(map(int,input().split()))
locations = list(map(int,input().split()))
locations = sorted(locations)
distance = list()

for i in range(len(locations) - 1):
    distance.append(locations[i+1] - locations[i])
    
distance = sorted(distance)

for i in range(n-1):
    distance.pop()
    
print(sum(distance))

### FIXED CODE ###

n,m = list(map(int,input().split()))
locations = list(map(int,input().split()))
locations = sorted(locations)
distance = list()

if n >= m:
    print(0)
else:
    for i in range(len(locations) - 1):
        distance.append(locations[i+1] - locations[i])
    
    distance = sorted(distance)

    if n != 1:
        for i in range(n-1):
            distance.pop()
    
    print(sum(distance))
n , k = map(int,input().split())
list = input().split()
list = list.sort()
a = 0

for i in range(k):
  a += list[i]

### FIXED CODE ###

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

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

a = 0

for i in range(k):
    a += list[i]

print(a)
import sys
sys.setrecursionlimit(10**6)

a,b=input().split()

#print(a)
#print(b)
ans=int(a)*int(b*100)
ans=ans//100

print(ans)


### FIXED CODE ###

from decimal import *
import sys
sys.setrecursionlimit(10**6)

a,b=input().split()

ans=int(Decimal(a)*Decimal(b))

print(ans)
n = int(input())
a = map(int, input().split())


count = 0



while(True):
    even_count = 0
    even_index = 0
    for i in range(len(i)):
        if a[i] % 2 == 0:
            even_index = i
            even_count += 1

    if even_count >= 2:
        count += 1
        a[even_index] = int(a[even_index] / 2)
    else:
        break

print(count)

### FIXED CODE ###

N = int(input())
a_li = list(map(int,input().split()))
         
cnt = 0
for i in a_li:
    while i % 2 == 0:
        cnt += 1
        i //= 2
        if i % 2 != 0:
            break
        
print(cnt)
# from math import sqrt
# from heapq import heappush, heappop
# from collections import deque
from functools import reduce

# a, b = [int(v) for v in input().split()]


def main():
    N, M = [int(v) for v in input().split()]
    A = list(set([int(v) // 2 for v in input().split()]))

    def gcd(v1, v2):
        while v1 % v2 != 0:
            tmp = v2
            v2 = v1 % v2
            v1 = tmp
        return v2

    def lcm(v1, v2):
        return v1 * v2 // gcd(v1, v2)

    alcm = 1
    for a in A:
        d = gcd(alcm, a)
        lcm = lcm * a // d
        if alcm > M:
            print(0)
            exit()

    # a_lcm = reduce(lambda v1, v2: lcm(v1, v2), A)

    if a_lcm > M:
        print(0)
    else:
        print((M // a_lcm + 1) // 2)


main()


### FIXED CODE ###

# from math import sqrt
# from heapq import heappush, heappop
# from collections import deque
from functools import reduce

# a, b = [int(v) for v in input().split()]


def main():
    N, M = [int(v) for v in input().split()]
    A = list(set([int(v) // 2 for v in input().split()]))

    def func(a):
        count = 0
        while a % 2 == 0:
            count += 1
            a //= 2
        return count

    fa = func(A[0])
    for a in A[1:]:
        if func(a) != fa:
            print(0)
            exit()

    def gcd(a, b):
        if b == 0:
            return a
        return gcd(b, a % b)

    def lcm(v1, v2):
        return v1 * v2 // gcd(v1, v2)

    a_lcm = 1
    for a in A:
        d = gcd(a_lcm, a)
        a_lcm = a_lcm * a // d
        if a_lcm > M:
            print(0)
            exit()

    # a_lcm = reduce(lambda v1, v2: lcm(v1, v2), A)

    print((M // a_lcm + 1) // 2)


main()
N, K = map(int, input().split())

if (N % K == 0):
	print(0)
else:
	print(1)
hibiki@hibiki-MB-E41

### FIXED CODE ###

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

if (N % K == 0):
	print(0)
	print()
else:
	print(1)
	print()
n=int(input())
a=list(map(int,input().split()))
a.sort()
print(a[n-1]=a[0])

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a.sort()
print(a[n-1]-a[0])
def gcd(a,b): 
        if a == 0: 
            return b 
        return gcd(b % a, a) 
      
    def lcm(a,b): 
        return (a*b) // gcd(a,b) 
      
    n = int(input())
    arr = input()   # takes the whole line of n numbers
    a = list(map(int,arr.split(' ')))
    l = a[0]
    ans = 0
    for i in range(n):
        l = lcm(l, a[i])
    for i in range(n):
        ans = ans + l//a[i]
    print(ans%1000000007)

### FIXED CODE ###

import math
from functools import reduce
     
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
     
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
      
N = int(input())
A = list(map(int,input().split()))
ans = 0
     
lcm = lcm_list(A)
     
for i in range(N):
    ans += lcm//A[i]
     
print(ans%1000000007)
s = str(input())
ans = 0
for i in range(len(s)):
    count = 0
    if S[i] == "A" or "T" or "C" or "G":
        count += 1
        for j in range(len(s)-i):
            if S[j] == "A" or "T" or "C" or "G":       
                count += 1
            else:
                break:
    if ans < count:
        ans = count
print(ans)

### FIXED CODE ###

S = str(input())
ans = []
for i in range(len(S)):
    preans = []
    if S[i] == "A" or S[i] == "C" or S[i]  == "G" or S[i] =="T":
        preans.append(S[i])
        for j in range(1,len(S)-i):
            if S[i+j] == "A" or S[i+j] == "C" or S[i+j]  == "G" or S[i+j] =="T":
                preans.append(S[i+j])
            else:
                break
    if len(preans) > len(ans):
        ans = preans
if len(ans) == 2 and ans[0] == "A" and ans[1] == "C":
    print(0)
else:
    print(len(ans))
A = int(raw_input())
B = int(raw_input())

if (A <= 8) and (B <= 8):print "Yay!"
else : print ":("

### FIXED CODE ###


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

if (A <= 8) and (B <= 8):print "Yay!"
else : print ":("
import sys
N, Q = [int(i) for i in input().split()]
tree = {i:[] for i in range(N+1)}
cost_ls = {i:0 for i in range(N)}
for i in range(N-1):
    a, b = [int(j) for j in sys.stdin.readline().split()]
    a -= 1
    b -= 1
    tree[a].append(b)
    tree[b].append(a)

yet = set()
def plus(node, num):
    yet.add(node)
    cost_ls[node] += num
    if len(tree[node]) > 0:
        for child in tree[node]:
            if child in yet:
                continue
            plus(child, cost_ls[node])

for i in range(Q):
    p, x = [int(j) for j in sys.stdin.readline().split()]
    cost_ls[p-1] += x

plus(0, 0)

print(" ".join([str(cost) for cost in cost_ls]))

### FIXED CODE ###

import sys

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

N, Q = map(int, input().split())
V = {i: [] for i in range(1, N + 1)}
for _ in range(N - 1):
    a, b = map(int, input().split())
    V[a].append(b)
    V[b].append(a)

C = {i: 0 for i in range(1, N + 1)}

for _ in range(Q):
    p, x = map(int, input().split())
    C[p] += x


def propagate(u, p):
    for v in V[u]:
        if v == p:
            continue
        C[v] += C[u]
        propagate(v, u)


propagate(1, 0)

print(' '.join(str(C[i]) for i in range(1, N + 1)))
n = int(input())
cnt = [0]*(n+1)

for i in range(1,int(n**0.5)+1):
  for j in range(1,int(n**0.5)+1):
    for k in range(1,int(n**0.5)+1):
      v = (i**2)+(j**2)+(k**2)+i*j+j*k+k*i
      if v<=n:
        cnt[v] += 1
for i in range(1,n+1):
  print(cnt[i])

### FIXED CODE ###

l,r,n = map(int, input().split())
L = l//n if l%n!=0 else (l//n)-1
R = r//n
print(R-L)
a,b = map(int, input().split())

if a > 8 and b > 8 :
  print (":(")
elif
  print ("Yay!")


### FIXED CODE ###

ALL = input().split()
A = int(ALL[0])
B = int(ALL[1])
 
if A < 9 and B < 9:
    print('Yay!')
else:
    print(':(')
N,M = map(int,input().split())
X = sorted(list(map(int,input().split())))
diff = []
for i in range(M-1):
    diff.append(X[i+1] - X[i])
diff.sort(reverse = True)
for i in range(N-1):
    diff.pop(0)
print(sum(diff))

### FIXED CODE ###

N,M = list(map(int,input().split()))
xarray = sorted(list(map(int,input().split())))
 
diff = []
if len(xarray) == 1:
    print(0)
elif N >= M:
    print(0)
else:
    for i in range(len(xarray)-1):
        diff.append(abs(xarray[i+1]-xarray[i]))
 
    if len(diff) == 0:
        print(0)
    else:
        diff2 = sorted(diff, reverse = True)
        
 
        if N == 1:
            
            print(sum(diff2))
        else:
            for j in range(N-1):
                diff2[j] = 0
            
            print(sum(diff2))
# coding:utf-8
if __name__=='__main__':
  r,D,x = map(int, input().split())
  for i in range(10):
    x = r*x-D
    print(x)
    

### FIXED CODE ###

# coding:utf-8

if __name__ == '__main__':
  A,B = map(int,input().split())
  if A >= 13:
    print(B)
  elif A>=6:
    print(int(B/2))
  else:
    print(0)
a,b=input().split(" ")
a,b=int(a),int(b)

if(1<=a<=9 & 1<=b<=9):
   print a*b
else:
   pring -1

### FIXED CODE ###


a,b = list(map(int, input().split()))
  
if(1<=a<=9 and 1<=b<=9):
    print(a*b)

else:
    print(-1)
# coding: utf-8
# @????????? #?????? *?????????
import sys

def dfs(x, y, fru):
    # ???????????¨?????????.???????????????
    field[x][y] = '.'
    # 4??????????????????
    for dx in [-1,0,1]:
        nx = x + dx
        if 0 <= nx and nx < W and field[nx][y] == fru:
            dfs(nx,y,fru)
    for dy in [-1,0,1]:
        ny = y + dy
        if 0 <= ny and ny < H and field[x][ny] == fru:
            dfs(x,ny,fru)

def solv(H,W):
    count = 0
    for i in range(H):
        for j in range(W):
            if field[i][j] == '@':
                dfs(i,j,'@')
                count+=1
            elif field[i][j] == '#':
                dfs(i,j,'#')
                count+=1
            elif field[i][j] == '*':
                dfs(i,j,'*')
                count+=1
    print(count)

#x,y??§2??¶?????°???1?????§??\????????????????????\???????????°?????§????????¨???
while(True):
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        sys.exit()
    field = [] # ????¨??????¨??????
    for i in range(H):
        field.append(list(input()))
    solv(H,W)

### FIXED CODE ###

# coding: utf-8
# @????????? #?????? *?????????
import sys
sys.setrecursionlimit(10000000)

def dfs(x, y, fru):
    # ???????????¨?????????.???????????????
    field[x][y] = '.'
    # 4??????????????????
    for dx in [-1,0,1]:
        nx = x + dx
        if 0 <= nx and nx < H and field[nx][y] == fru:
            dfs(nx,y,fru)
    for dy in [-1,0,1]:
        ny = y + dy
        if 0 <= ny and ny < W and field[x][ny] == fru:
            dfs(x,ny,fru)

def solv(H,W):
    count = 0
    for i in range(H):
        for j in range(W):
            if field[i][j] != '.':
                dfs(i,j,field[i][j])
                count+=1
            # elif field[i][j] == '#':
            #     dfs(i,j,'#')
            #     count+=1
            # elif field[i][j] == '*':
            #     dfs(i,j,'*')
            #     count+=1
    print(count)

f = 0
while(f == 0):
    H, W = map(int, input().split())
    if H != 0 and W != 0:
        field = [] # ????¨??????¨?????????
        for i in range(H):
            field.append(list(input()))
        solv(H,W)
    else:
        f = 1
# - coding:utf-8 -*-
from numpy.random import mtrand

mt = []

for i in range(10):
    mt.append(input())

print(str(mt.pop(mt.index(max(mt)))))
print(str(mt.pop(mt.index(max(mt)))))
print(str(mt.pop(mt.index(max(mt)))))

### FIXED CODE ###

mt = []

for i in range(10):
        mt.append(int(input()))

mt.sort()
print( mt[9] )
print( mt[8] )
print( mt[7] )
def main():
    _, _, m_num = map(int, input().split())
    a = [int(s) for s in input().split()]
    b = [int(s) for s in input().split()]

    min_price = min(a) + min(b)

    m = []
    for _ in range(m_num):
        price = a[x - 1] + b[y - 1] - c
        print(x, y, c, price)
        min_price = min(min_price, price)
    
    print(min_price)

main()

### FIXED CODE ###

def main():
    _, _, m_num = map(int, input().split())
    a = [int(s) for s in input().split()]
    b = [int(s) for s in input().split()]

    min_price = min(a) + min(b)

    m = []
    for _ in range(m_num):
        x, y, c = map(int, input().split())
        price = a[x - 1] + b[y - 1] - c
        min_price = min(min_price, price)
    
    print(min_price)

main()
a,b,c = [int(i) for i in input().split()]
if a<b<c :
    print("Yes")

else :
    print("No")
number = [int(i) for i in input().split()]
number.sort()
print(number)


### FIXED CODE ###

number = [i for i in input().split()]
number.sort()
print(' '.join(number))
h,w,m=map(int,input().split())
g=[0]*h
l=[0]*w
b=[[0]*w for i in range(h)]
for i in range(m):
  x,y=map(int,input().split())
  g[x-1]+=1
  l[y-1]+=1
  b[x-1][y-1]=1
mg=[i for i,x in enumerate(g) if x==max(g)]
ml=[i for i,x in enumerate(l) if x==max(l)]
for i in mg:
  for j in ml:
    if b[i][j]==0:
      print(max(g)+max(l))
      exit()
print(max(g)+max(l)-1)

### FIXED CODE ###

h,w,m=map(int,input().split())
g=[0]*h
l=[0]*w
b=[]
for i in range(m):
  x,y=map(int,input().split())
  g[x-1]+=1
  l[y-1]+=1
  b.append((x-1,y-1))
mxg=max(g);mxl=max(l)
mg=set([i for i,x in enumerate(g) if x==mxg])
ml=set([i for i,x in enumerate(l) if x==mxl])
c=0
for x,y in b:
  if x in mg and y in ml:
    c+=1
print(mxg+mxl-(c==(len(mg)*len(ml))))
import sys
def gcd(m,n):
    x=max(m,n)
    y=min(m,n)
    if x%y==0:
        return y
    else:
        while x%y!=0:
            z=x%y
            x=y
            y=z
        else:
            return z
def lcm(m,n):
    return int(m*n/gcd(m,n))
n=int(input())
a=[]
if n==1:
    print(int(input()))
    sys.exit()
for i in range(n):
    a.append(int(input()))
b=lcm(a[0],a[1])
for i in range(n-2):
    b=lcm(b,a[i+2])
print(b)

### FIXED CODE ###

import fractions
from functools import reduce
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
n=int(input())
print(lcm_list([int(input()) for i in range(n)]))
N = int(input())
t = 0
a = 0

for _iin range(N):
  rt,ra = map(int,input().split())
  c = max((t-1)//rt+1,(a-1)//ra+1)
  t = rt*c
  a = ra*c
  if a+t == 0:
    t += rt
    a += ra

print(a+t)

### FIXED CODE ###

N = int(input())
t = 0
a = 0

for _ in range(N):
  rt,ra = map(int,input().split())
  c = max((t-1)//rt+1,(a-1)//ra+1)
  t = rt*c
  a = ra*c
  if a+t == 0:
    t += rt
    a += ra

print(a+t)
s=input()

a,b=int(s[0]+s[1]),int(s[2]+s[3])

if b==0:
    print('NA')
elif a==0:
    print('NA')
elif a>12:
    if b>12:
        print('NA')
    elif 0<b<13:
        print('YYMM')
elif 0<a<13:
    if b>12:
        print('MMYY')
    elif 0<b<13:
        print('AMBIGUOUS')


### FIXED CODE ###

n,k=map(int, input().split())
s=input()

for i in range(len(s)):
    if i==k-1:
        if s[k-1]=='A':
            print('a',end='')
        elif s[k-1]=='B':
            print('b',end='')
        elif s[k-1]=='C':
            print('c',end='')
    else:
        print(s[i],end='')

print()
from math import  gcd

K = INT()
sum = 0
 
for n in range(K):
  for m in range(K):
    for l in range(K):
      sum += gcd(n+1, gcd(m+1, l+1))
 
print(sum)

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
K = INT()
sum = 0
 
for n in range(K):
  for m in range(K):
    for l in range(K):
      sum += gcd(n+1, gcd(m+1, l+1))
 
print(sum)
S = input()
h = S // 3600
m = S % 3600 //60
s = S % 3600 % 60
print str(h) + ':' + str(m) + ':' + str(t)

### FIXED CODE ###

S = input()
h = S // 3600
m = S % 3600 //60
s = S % 3600 % 60
print str(h) + ':' + str(m) + ':' + str(s)
N = int(input())
list_d = list(map(int,input().split()))

count = 0

for i in range(N):
    for j in range(i+1,N):
        count += list_d[i]*list_d[j]

print(count)

### FIXED CODE ###

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

if A-2*B >= 0:
    print(A-2*B)
else:
    print(0)
S=input()
if S[2]=S[3] and S[4]=S[5]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S=input()
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")
import numpy as np
import math

# input

r, D, x = [float(_) for _ in input().split()]

xans = np.ones(10)

def Linear_Recursive(x, r, D, N):
    
    if N==0:
        xans = x
        return xans
    
        
    
    xans = r*Linear_Recursive(x, r, D, N-1) - D # linear eq.
    
    return xans
  
for i in range(10):
    xans[i] = Linear_Recursive(x, r, D, 10)
    
    pritnt(x[i])
    


### FIXED CODE ###

import numpy as np
import math

# input

r, D, x = [int(_) for _ in input().split()]

xans = x


for i in range(10):
    xans = r*xans - D
    
    print(xans)
a = list(map(int,input()))
print("Yay!") if a[0]<=8 and a[1]<=8 else print(":(")

### FIXED CODE ###

a = list(map(int,input().split()))
if a[0]<=8 and a[1]<=8:
  print("Yay!")
else:
  print(":(")
N = int(input())
A = list(map(int,input().split()))
from collections import Counter
AA = Counter(A)
B = []
C = []
for k,v in AA.items():
    if v>=2:
        B.append(k)
    if v>=4:
        C.append(k)
B.sort(reverse=True)
C.sort(reverse=True)
if len(B)<2:
    print(0)
else:
    print(max(B[0]*B[1],C[0]*C[0]))

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
from collections import Counter
AA = Counter(A)
B = []
C = []
for k,v in AA.items():
    if v>=2:
        B.append(k)
    if v>=4:
        C.append(k)
B.sort(reverse=True)
C.sort(reverse=True)
if len(B)<=1 and len(C)==0:
    print(0)
else:
    if len(B)<=1:
        print(C[0]*C[0])
    elif len(C)==0:
        print(B[0]*B[1])
    else:
        print(max(B[0]*B[1],C[0]*C[0]))
#入力
n, d = map(int, input().split())
point = [int(input()) for i in range(n)]
#点1から計算する
m = 0
for i in range(n):
	for j in range(i+1,n):
		a = 0
		for k in range(d):
			a += (point[i][k]-pont[j][k])**2
		if isinstance(a ** 0.5, int) 
		m += 0
print(m)

### FIXED CODE ###

#入力
n, d = map(int, input().split())
point = [[int(i) for i in input().split()] for j in range(n)]
#点1から計算する
m = 0
for i in range(n):
	for j in range(i+1,n):
		a = 0
		for k in range(d):
			a += (point[i][k]-point[j][k])**2
		b = a**(1/2)
		if b.is_integer():
			m += 1
print(m)
n=int(input())
s=input()
tmp=0
for i in range(n):
  lf s[i]==".":
    tmp+=1
ans=tmp
for i in range(n):
  if s[i]==".":
    tmp-=1
  else:
    tmp+=1
  ans=min(ans,tmp)
print(ans)

### FIXED CODE ###

n=int(input())
s=input()
tmp=0
for i in range(n):
  if s[i]==".":
    tmp+=1
ans=tmp
for i in range(n):
  if s[i]==".":
    tmp-=1
  else:
    tmp+=1
  ans=min(ans,tmp)
print(ans)