Harryxun/stf_run huggingface dataset:
from collections import deque
around = [(0,1),(1,0),(0,-1),(-1,0)]

H,W = map(int,input().split())
grid = [list(input()) for _ in range(H)]

checked = [[0]*W for i in range(H)]

def dfs(si,sj):
    if grid[si][sj] == ".":
        b = 0; w = 1
    if grid[si][sj] == "#":
        b = 1; w = 0
    dq = deque()
    dq.append((si,sj))
    checked[si][sj] = 1
    while dq:
        i,j = dq.pop()
        for di,dj in around:
            ni = i + di; nj = j + dj
            if not(0 <= ni <= H-1 and 0 <= nj <= W-1):
                continue
            if checked[ni][nj]:
                continue
            p = grid[i][j]
            np = grid[ni][nj]
            if (p,np) == (".","#"):
                b += 1
                dq.append((ni,nj))
                checked[ni][nj] = 1
            if (p,np) == ("#","."):
                w += 1
                dq.append((ni,nj))
                checked[ni][nj] = 1
    return b*w

ans = 0
for i in range(H):
    for j in range(W):
        if not checked[i][j] and grid[i][j] == ".":
            ans += bfs(i,j)
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

H,W = map(int,input().split())
grid = [["&"] * (W+2) for i in range(H+2)]
visited = [[False] * (W+2) for i in range(H+2)]
# debug: visited_count = [[0] * (W+2) for i in range(H+2)]
start = []
for i in range(H):
    s = input()
    for j in range(W):
        grid[i+1][j+1] = s[j]

ans = 0
b = 0
w = 0
def dfs(p_i,p_j):
    if visited[p_i][p_j] is True:
        global ans
        return
    visited[p_i][p_j] = True
    if grid[p_i][p_j] == "#":
        # debug: visited_count[p_i][p_j] += 1
        global b
        b += 1
    elif grid[p_i][p_j] == ".":
        # debug: visited_count[p_i][p_j] += 1
        global w
        w += 1
    around = [[p_i,p_j+1],[p_i+1,p_j],[p_i,p_j-1],[p_i-1,p_j]]
    for i,j in around:
        if grid[p_i][p_j] == "#" and grid[i][j] == ".":
            dfs(i,j)
        elif grid[p_i][p_j] == "." and grid[i][j] == "#":
            dfs(i,j)

for i in range(1,H+1):
    for j in range(1,W+1):
        if visited[i][j] is False:
            dfs(i,j)
            ans += b * w
            b = 0
            w = 0

print(ans)

""" debug
print(start)
for line in visited_count:
    print(line)
print("b = {}".format(b))
print("w = {}".format(w)) """
h,w,m=map(int,input().split())
table=[]
H=[0]*h
W=[0]*w
li_h=[]
li_w=[]

for i in range(m):
    h1,w1=list(map(int,input().split()))
    table.append((h1-1,w1-1))
    H[h1-1]+=1
    W[w1-1]+=1

h_flag=0
w_flag=0

Hm=max(H)
Wm=max(W)

Hh=[i for i, x in enumerate(H) if x == HM]
Ww=[i for i, x in enumerate(W) if x == Wm]

cnt=0

for (h, w) in table:
    if H[h] == HM and W[w] ==  Wm:
        cnt += 1

if cnt<len(Hh)*len(Ww):
    print(HM+Wm)
else:
    print(HM+Wm-1)



### FIXED CODE ###

h,w,m=map(int,input().split())
table=[]
H=[0]*h
W=[0]*w
li_h=[]
li_w=[]

for i in range(m):
    h1,w1=list(map(int,input().split()))
    table.append((h1-1,w1-1))
    H[h1-1]+=1
    W[w1-1]+=1

h_flag=0
w_flag=0

Hm=max(H)
Wm=max(W)

Hh=[i for i, x in enumerate(H) if x == Hm]
Ww=[i for i, x in enumerate(W) if x == Wm]

cnt=0

for (h, w) in table:
    if H[h] == Hm and W[w] ==  Wm:
        cnt += 1

if cnt<len(Hh)*len(Ww):
    print(Hm+Wm)
else:
    print(Hm+Wm-1)
n = map(int, raw_input().split())
list_str = []
for count in range(0,int(n[0])):
    list_str.append(raw_input())

for count in range(0,int(n[0])-1):
    if count == 0:
        compare1 = set(list_str[count])
    else:
        compare1 = set(output)
    compare2 = set(list_str[count+1])
    output = list(compare1 & compare2)
output = ''.join(output)

### FIXED CODE ###

n = int(raw_input())
list_str = []
for count in range(0,n):
    list_str.append(raw_input())
if n != 1:
	for count in range(0,n):
	    if count == 0:
	        output = set(list_str[count])
	    else:
	        compare1 = set(output)
	    	compare2 = set(list_str[count])
	    	output = list(compare1 & compare2)

	tmp_output = ""
	
	for count1 in range(0,len(output)):
		#print output[count1]
		min = 1000
		for count2 in range(0,n):
			num = list_str[count2].count(output[count1])
			if num < min:
				min = num
			#print min
		tmp_output += min*output[count1]
	output = tmp_output
	#output.sort()
else:
	output = list_str[0]
output = sorted(output)
output = ''.join(output)
print output
N = int(input())
A = [ int(input()) for i in range(N)]
a = [ 1/i for i in A]
res = 1/(sum(a))
print(res)

### FIXED CODE ###

N = int(input())
A = map(int,input().split())
a = [ 1/i for i in A]
res = 1/(sum(a))
print(res)
n = input()
a = list(map(int, input().split()))
A = 0
B = 0

a.sort(reverse=True)

for i in range(n):
  if i % 2 == 0:
    A += a[i]
  else:
    B += a[i]
    
print(A-B)

### FIXED CODE ###

N = int(input())
score = list(map(int, input().split()))
A = 0
B = 0
 
score.sort(reverse=True)
for i in range(N):
  if i % 2 == 0:
    A += score[i]
  else:
    B += score[i]

print(A-B)
from collections import defaultdict

n, k = map(int, input().split())
ans = 0
top = [0] * 10 ** 5
sub = []
kinds = 0

for i in range(n):
    t, d = map(int, input().split())
    if top[t] == 0:
        top[t] = d
        kinds += 1
    else:
        if d > top[t]:
            sub.append(top[t])
            top[t] = d
        else:
            sub.append(d)

top.sort(reverse=True)
top = top[:kinds]
top_sum = [0]
sub.sort(reverse=True)
sub_sum = [0]

for p in top:
    top_sum.append(top_sum[-1] + p)

for p in sub:
    sub_sum.append(sub_sum[-1] + p)

ans = 0
start = min(k, len(top_sum) - 1)
end = max(1, k - len(sub_sum) + 1)

for i in range(start, end - 1, -1):
    ans = max(ans, top_sum[i] + sub_sum[k - i] + i ** 2)
print(ans)


### FIXED CODE ###

from collections import defaultdict

n, k = map(int, input().split())
top = [0] * n
sub = []

for i in range(n):
    t, d = map(int, input().split())
    t -= 1
    if top[t] == 0:
        top[t] = d
    else:
        if d > top[t]:
            sub.append(top[t])
            top[t] = d
        else:
            sub.append(d)

top.sort(reverse=True)
top_sum = [0]
sub.sort(reverse=True)
sub_sum = [0]

for p in top:
    if p == 0:
        top_sum.append(-1)
    else:
        top_sum.append(top_sum[-1] + p)

for p in sub:
    sub_sum.append(sub_sum[-1] + p)

ans = 0

for i in range(1, k + 1):
    if (len(sub_sum) - 1) >= (k - i) and top_sum[i] != -1:
        ans = max(ans, top_sum[i] + sub_sum[k - i] + i ** 2)

print(ans)
# -*- coding:utf-8 -*-
a,b = map(str,input().split())
H1 = "1"
D1= "-1"
H = int(H1)
D = int(D1)
if a * b == 1:
  print("H")
else:
  print("D")

### FIXED CODE ###

# -*- coding: utf-8 -*-
a,b = map(str,input().split())
if (a == "H" and b == "H")or(a =="D" and b == "D"):
  print("H")
else:
  print("D")
T = input()
for i in range(1,len(T)):
    if T[i]=='?':
        if T[i-1]=='P':
            T=T.replace('?','D',1)
        elif T[i+1]=='D':
            T=T.replace('?','P',1)
        elif T[i+1]=='?':
            T=T.replace('??','PD',1)
print(T)

### FIXED CODE ###

T=input()
T=T.replace('?','D')
print(T)
import math
n = int(input())
li=[int(input()) for i in range(n)]
print(math.ceil(n/min(li))+4)

### FIXED CODE ###

li = []
for i in range(6):
  li.append(int(input()))
if li[4] - li[0] <= li[5]:
  print("Yay!")
else:
  print(":(")
import math
from functools import reduce
from itertools import product

x = int(input())
print(sum([reduce(math.gcd, *i) for i in product(range(1, x+1), repeat=3)]))

### FIXED CODE ###

import math
from itertools import product
 
x = int(input())

s = 0
for a, b, c in product(range(1, x+1), repeat=3):
  s += math.gcd(math.gcd(a, b), c)
print(s)
import math

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

# for small
score = 0
times = []
for i in range(1, min(n + 1, k)):
    times.append(math.ceil(math.log2((k / i))))
bottom_max = times[0]
for t in times:
    score += 2 ** (bottom_max - t)
score /= 2 ** (bottom_max) * n

# for big
big = [i for i in range(k, max(k, n + 1))]
score += len(big) / n
print('{:.10f}'.format(score))


### FIXED CODE ###

import math

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

# for small
score = 0
times = []
for i in range(1, min(n + 1, k)):
    times.append(math.ceil(math.log2((k / i))))

if len(times):
    bottom_max = times[0]
    for t in times:
        score += 2 ** (bottom_max - t)
    score /= 2 ** (bottom_max) * n

# for big
big = [i for i in range(k, max(k, n + 1))]
score += len(big) / n
print('{:.10f}'.format(score))
from sys import stdin

input = stdin.readline



def solve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    left = 0
    right = max(a)

    def ok(l):
        s = sum([i // l for i in a])
        return s <= k

    while left < right:
        mid = (left + right) // 2
        if ok(mid):
            right = mid
        else:
            left = mid + 1
    print(left)


if __name__ == '__main__':
    solve()


### FIXED CODE ###

from sys import stdin

input = stdin.readline
import math
import heapq


def solve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    left = 1
    right = max(a)

    def ok(l):
        s = sum([(i-1) // l for i in a])
        return s <= k
    while left < right:
        mid = (left + right) // 2
        if ok(mid):
            right = mid
        else:
            left = mid + 1
    print(left)


if __name__ == '__main__':
    solve()
class UnionFind():
    # 作りたい要素数nで初期化
    # 使用するインスタンス変数の初期化
    def __init__(self, n):
        self.n = n
        # root[x]<0ならそのノードが根かつその値が木の要素数
        # rootノードでその木の要素数を記録する
        self.root = [-1]*(n+1)
        # 木をくっつける時にアンバランスにならないように調整する
        self.rnk = [0]*(n+1)
        
        self.par = [0]*(n+1)

    # ノードxのrootノードを見つける
    def Find_Root(self, x):
        if(self.root[x] < 0):
            return x
        else:
            # ここで代入しておくことで、後の繰り返しを避ける
            self.root[x] = self.Find_Root(self.root[x])
            
            return self.root[x]
    # 木の併合、入力は併合したい各ノード
    def Unite(self, x, y):
        tmpx,tmpy=x,y
        # 入力ノードのrootノードを見つける
        x = self.Find_Root(x)
        y = self.Find_Root(y)
        # すでに同じ木に属していた場合
        if(x == y):
            return 
        # 違う木に属していた場合rnkを見てくっつける方を決める
        elif(self.rnk[x] > self.rnk[y]):
            self.root[x] += self.root[y]
            self.root[y] = x
            self.par[tmpy]  =tmpx

        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            self.par[tmpx]  = tmpy
            # rnkが同じ（深さに差がない場合）は1増やす
            if(self.rnk[x] == self.rnk[y]):
                self.rnk[y] += 1
    # xとyが同じグループに属するか判断
    def isSameGroup(self, x, y):
        return self.Find_Root(x) == self.Find_Root(y)

    # ノードxが属する木のサイズを返す
    def Count(self, x):
        return -self.root[self.Find_Root(x)]


def cur(n):
    if memo[n]==-1: memo[n]=(cur(tree.par[n])+state[n])%2
    return memo[n]

N=int(input())
tree=UnionFind(N)

state=[-1]*(N+1)
for i in range(N-1):
    u,v,w=map(int,input().split())
    tree.Unite(u,v)
    if tree.par[u]==v: state[u]=w%2
    if tree.par[v]==u: state[v]=w%2

memo=[-1]*(N+1)
memo[tree.Find_Root(1)]=0
for i in range(1,N+1):
    print(cur(i))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

def cur(current,e,dist,color):
    for it in e[current]:
        if color[it]!=-1: continue
        color[it]=(color[current]+dist[(it,current)])%2
        cur(it,e,dist,color)

N=int(input())
e=[[] for i in range(N+1)]
dist={}
for i in range(N-1):
    u,v,w=map(int,input().split())
    e[u].append(v)
    e[v].append(u)
    dist[(u,v)],dist[(v,u)]=w,w
memo=[-1]*N




color=[-1]*(N+1)
color[1]=0
cur(1,e,dist,color)

for i in range(1,N+1):
    print(color[i])
N, M = list(map(int, input().split()))
K, A = [0] * N, [0] * N
for i in range(N):
    K[i], *A[i] = list(map(int, input().split()))
k = set(i for i in range(1, M + 1))
ki = k.intersection(*A)
print(len(ki))

### FIXED CODE ###

n, m, c = list(map(int, input().split()))
B = list(map(int, input().split()))
A = (list(map(int, input().split())) for _ in range(n))
ans = 0
cnt = 0
for i, u in enumerate(A):
    for j, v in enumerate(u):
        ans += v * B[j]

    ans += c
    if ans > 0:
        cnt += 1
    ans = 0
print(cnt)
def check(arr, x, y):
    d = ((0, -1), (0, 1), (1, -1), (1, 0), (1, 1), (-1, -1), (-1, 0), (-1, 1))

    if arr[x][y] == '#':
        return -1
    else:
        cnt = 0
        for dx, dy in d:
            try:
                if (x+dx) >=0 and (y+dy) >= 0:
                    if arr[x + dx][y + dy] == '#':
                        cnt += 1
            except:
                pass
    return cnt    

h, w = map(int, input().split())
s = []
for _ in range(h):
    s.append(input())
ans = []
for x in range(h):
    for y in range(w):
        val = check(s, x, y)
        if val == -1:
            ans.append('#')
        else:
            ans.append(val)

for i in range(h*w):
    print(ans[i], end="")
    if (i+1)%w == 0:
        print()

### FIXED CODE ###

n = int(input())
k = int(input())

ans = 1
for i in range(n):
    if ans*2 > ans + k:
        ans += k
    else:
        ans *= 2
print(ans)
# -*- coding: utf-8 -*-
from functools import reduce
import fractions


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


n = int(input())
lst = list(map(int, input().split()))
min_v = min(lst)

max_gcd = 0
for i in range(n):
  arr = lst[:i] + lst[i + 1:len(lst)]
  # if min_v < max_gcd:
  #   break
  wk_gcd = gcd(*arr)
  max_gcd = wk_gcd if wk_gcd > max_gcd else max_gcd

print(max_gcd)


### FIXED CODE ###

# -*- coding: utf-8 -*-
def check(a, time):
  ret, mod = divmod(time, a)
  value = True if mod == 0 else check(a, ret) if ret > a else False
  return value


a, b, t, biscuit = map(int, input().split() + ["0"])
for i in range(1, t + 1):
  if check(a, i):
    biscuit = biscuit + b

print(biscuit)
k, n = input().split()
a = input().split()
max = 0
for i in range(len(a)):
    if i==0:
        continue
    d = int(a[i])-int(a[i-1])
    if d>max:
        max=d
print(k-max)

### FIXED CODE ###

k, n = input().split()
a = input().split()
max = 0
for i in range(0,len(a)):
    if i==0:
        max = int(k)-int(a[len(a)-1])+int(a[0])
    d = int(a[i])-int(a[i-1])
    if d>max:
        max=d
print(int(k)-max)
S = raw_input()
s = S % 60
h = (S - S % 3600) / 3600
m = (S - s - h * 3600) / 60

print h + ':' + m + ':' + s

### FIXED CODE ###

S = input()
h = S / 3600
s = S % 60
m = (S - h * 3600 - s) / 60

print "%d:%d:%d" %(h,m,s)
N, x = map(int, input().split())
a = [int(j) for j in input().split()]

count = 0
for i in range(N-1):
      dif = a[i] + a[i+1] - x
      if dif > x:
            if a[i+1] >x:
                  count += dif
                  a[i+1] -= dif
            else:
                  count += dif
                  a[i] -= dif - a[i + 1]
                  a[i + 1] = 0
print(count)


### FIXED CODE ###

a, x, c = input().split()
print("A"+x[0]+"C")
r = int(raw_input())
p = 3.141592
print p * float(r)**2,
print 2.0 * p * float(r)

### FIXED CODE ###

r = float(raw_input())
p = 3.14159265358979323846
print '%f %f' %(p * r**2, 2.0 * p * r)
from sys import stdin

k = int(stdin.readline().rstrip())
s = int(stdin.readline().rstrip())
count = 0

x = 0
y = 0
z = 0

for x in range(s+1):
    y = 0
    for y in range(s+1):
        z = 0
        z = s - x - y
        if x <= k and y <= k and z<= k and 0 <= z:
            count +=1
            #print(x,y,z)

print(count,flush=True)



### FIXED CODE ###

from sys import stdin
lis =[]
#k = int(stdin.readline().rstrip())
lis= stdin.readline().rstrip().split()
k = int(lis[0])
s = int(lis[1])
count = 0
x = 0
y = 0
z = 0
for x in range(k+1):
    y = 0
    for y in range(k+1):
        z = 0
        z = s - x - y
        if z <= k and z >= 0:
                count +=1



print(count)
n = input().split(" ")

a = abs((int(n[1])-int(n[0]))+abs((int(n[2])-int(n[1]))
b = abs((int(n[2])-int(n[0]))+abs((int(n[1])-int(n[2]))
c = abs((int(n[2])-int(n[1]))+abs((int(n[0])-int(n[2]))
d = abs((int(n[0])-int(n[1]))+abs((int(n[2])-int(n[0]))
e = abs((int(n[1])-int(n[2]))+abs((int(n[0])-int(n[1]))
f = abs((int(n[0])-int(n[2]))+abs((int(n[1])-int(n[0]))

w = min(a,b,c,d,e,f)

print(w)

### FIXED CODE ###

n = list(map(int,input().split()))
n.sort()
ans = n[2]-n[0]
print(ans)
s=str(input())
a=len(s)
if a%2!=0:
  print('No')
elif s=[hi,hihi,hihihi,hihihihi,hihihihihi]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s=str(input())
a=len(s)
b=['hi','hihi','hihihi','hihihihi','hihihihihi']
if a%2!=0:
  print('No')
elif s in b:
  print('Yes')
else:
  print('No')
N = int(input())
name_list = [input() for name in range(N)]
char_list = ['M', 'A', 'R', 'C', 'H']
count_list = [0 for _ in range(N)]

for name in name_list:
    if name[0] in char_list:
        count_list[char_list.index(name[0])] += 1
score=0
for x in range(5):
    for y in range(x+1,5):
        for z in range(y+1,5):
            score+=count_list[x]*count_list[y]*count_list[z]

print(score)


### FIXED CODE ###

N = int(input())
name_list = [input() for name in range(N)]
char_list = ['M', 'A', 'R', 'C', 'H']
count_list = [0 for _ in range(len(char_list))]

flag = False

for name in name_list:
    if name[0] in char_list:
        count_list[char_list.index(name[0])] += 1
score = 0
for x in range(5):
    for y in range(x + 1, 5):
        for z in range(y + 1, 5):
            score += count_list[x] * count_list[y] * count_list[z]

print(score)
import sys
import time
import math
import itertools as it
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N = int(input())
P = inpl()
Q = inpl()
ls = P.copy()
ls.sort()
cnt = 0
for l in it.permutations(ls):
    cnt += 1
    if P == l:
        a = cnt
    if Q == l:
        b = cnt
print(abs(a-b))
# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)


### FIXED CODE ###

import sys
import time
import math
import itertools as it
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N = int(input())
P = inpl()
Q = inpl()
ls = P.copy()
ls.sort()
cnt = 0
a = 0
b = 0
for l in it.permutations(ls):
    cnt += 1
    l = list(l)
    if P == l:
        a = cnt
    if Q == l:
        b = cnt
print(abs(a - b))
# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)
a, b , k = map(int, input().split())
l = list(range(a, b+1))
result = l[:k] + l[-k:]
for i in result:
  print(i)

### FIXED CODE ###

a, b, k = map(int, input().split())
if b-a < k:
  for i in range(a, b+1):
    print(i)
else:
  min_a = [i for i in range(a, a+k)]
  max_b = [i for i in range(b, b-k,-1)]
  r = min_a + max_b
  for i in list(sorted(set(r))):
    print(i)
#include <iostream>
#include <vector>
using namespace std;

int main() {
    vector<vector<int>> vec(100, vector<int>(100, 0));
    cin >> vec.at(99).at(99);
    cout << vec.at(100).at(100) << endl;
}


### FIXED CODE ###

y = int(input())
print(y*y*y)
a = input()
b = 0
for c, (i, j) in enumerate(zip(a, a[::-1])):
	if i != j:
    	b += 1

print(b//2 + b%2)

### FIXED CODE ###

a = input()
b = 0
for i, j in zip(a, a[::-1]):
	if i != j:
		b += 1

print(b//2 + b%2)
A,B,C = list(map(int,input().split()))

if A == B and A==C:
    print('No')
elif A<> B and B <> C :
    print('No')
elif A == B :
    print('Yes')
elif A == C :
    print('Yes')
elif B == A :
    print('Yes')
elif C == A :
    print('Yes')
else :
    print('No')


### FIXED CODE ###

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

if A == B == C:
    print('No')
elif A == B and B != C:
    print('Yes')
elif A != B and A == C:
    print('Yes')
elif A != B and B ==C:
    print('Yes')
elif A != B and A != C:
    print('No')
else:
    print('No')
x = input()
a = x ** 3
print (a)

### FIXED CODE ###

x = int(input())
a = x ** 3
print (a)
n, a, b, k = map(int, input().split())

if False:
    n = 4
    a = 1
    b = 2
    k = 5

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)
    
def mod_combinationaaaaaaaaa(n, k, mod):
    # nCk (mod m)
    def mod_permutationaaa(n, k, mod):
        if n<=k:
            return 1
        else:
            return (n * mod_permutation(n-1,k,mod))%mod

    def mod_inv_permutationaaa(k, mod):
        k, mod = int(k), int(mod)
        if k<=1:
            return 1
        else:
            return (pow(k,mod-2,mod) * mod_inv_permutation(k-1, mod))%mod

    return (mod_permutation(n,n-k,mod) * mod_inv_permutation(k, mod))%mod

def mod_combination(N, K, M):
    def mod_permutation(n, k, mod):
        ret = 1
        for i in range(n, n-k, -1):
            ret *= i
            ret %= mod
        print("P =", ret)
        return ret

    def mod_inv(k, mod):
        return (pow(k,mod-2,mod))
    
    def mod_inv_permutation(n, k, mod):
        return mod_inv(mod_permutation(n, k, mod), mod)

    return (mod_permutation(N,K,M) * mod_inv_permutation(K, K, M))%M

g = gcd(k, gcd(a, b))
a //= g
b //= g
k //= g

if a < b:
    tmp = a
    a = b
    b = tmp

mod = 998244353
ans = 0
print("n, a, b =", n, a, b)
print((k-b*n)//a, k//a+1)
for x in range(max(-int(-(k-b*n)//a),0), k//a+1):
    if (k-x*a) % b == 0:
        print("n, x, y, mod", n, x, y, mod)
        print(mod_combination(n, x, mod))
        print(mod_combination(n, y, mod))
        
        y = (k-x*a)//b
        ans += mod_combination(n, x, mod) * mod_combination(n, y, mod)
        ans %= mod
    
print(ans)

### FIXED CODE ###

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

mod = 998244353
fact = [1] + [0] * n
inv_fact = [0] * (n+1)
for i in range(n):
    fact[i+1] = (fact[i] * (i+1)) % mod

for i in range(n+1):
    inv_fact[i] = pow(fact[i],mod-2,mod)
    
def cb(n, k, mod):
    return (fact[n] * inv_fact[k] * inv_fact[n-k]) % mod

ans = 0
for x in range(n+1):
    if (k-x*a) % b == 0:
        y = (k-x*a)//b
        if y >= 0:
            if x > n or y > n:
                pass
            else:
                ans += cb(n, x, mod) * cb(n, y, mod)
                ans %= mod
    
print(ans)
S = input()
N = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
  for j in range(26):
    if li[j] == sli[i]:
      sli[i] == li[j+2]
print("".join(sli)
  

### FIXED CODE ###

N = int(input())
S = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
  for j in range(26):
    if li[j] == sli[i]:
      sli[i] = li[j+N]
      break
print("".join(sli))
a=list(input())
if len(a)==3:
    a.reverse()
    ans=""
    for i in a:
        ans+=i
    print(ans)
elif len(a)==2:
    ans = ""
    for i in a:
        ans += i
    print(ans)

### FIXED CODE ###

a=list(input())
if len(a)==3:
    a.reverse()
    ans=""
    for i in a:
        ans+=i
    print(ans)
elif len(a)==2:
    ans = ""
    for i in a:
        ans += i
    print(ans)
L, R = map(int,input().split())
L_mod = L%2019
R_mod = R%2019
list =[]
for i in range(L_mod,R_mod,1):
  mod_i = i%2019
  for j in range(i+1,R_mod+1,1):
    mod_j = j%2019
    mod = (mod_i *mod_j)%2019
    list.append(mod)
    
print(min(list))

### FIXED CODE ###

L, R = map(int,input().split())
L_mod = L%2019
if L_mod ==0:
  print(0)
else:
  R_mod = R%2019
  if R_mod ==0:
    print(0)
  else:
    if L_mod<R_mod:
      Ls = L//2019
      Rs = R//2019
      if Rs-Ls ==0:
        list =[]
        for i in range(L_mod,R_mod,1):
          mod_i = i%2019
          for j in range(i+1,R_mod+1,1):
            mod_j = j%2019
            mod = (mod_i *mod_j)%2019
            list.append(mod)

        print(min(list))
      else:
        print(0)
    else:
      print(0)
def division(x,y):
    if y == 0:
        return x
    return  division(y, x%y)

def checker(x):
    for i in range(2,x//2+1):
        v = division(x,i)
        if v > 1 :
            return False
        else:
            return True

cnt=0
q=int(input())
for i in range(q):
    o=checker(int(input))
    if o:
        cnt+=1
print(cnt)

### FIXED CODE ###

def checker(x):
    if x == 2:
        return True
    if x < 2 or x % 2 == 0 :
        return False
    for i in range(2,int(x**0.5)+1):
        if x % i == 0 :
            return False
    return True

cnt=0
q=int(input())
for _ in range(q):
    v=int(input())
    if checker(v):
        cnt += 1
print(cnt)