Harryxun/stf_run huggingface dataset:
a,b,c,d,e,f=map(int,input().split())
water=[]
salt=[]
for i in range(30):
  for j in range(30):
    x=a*100*i+b*100*j
    if x<=f:
      water.append(x)
for i in range(1501):
  for j in range(1501):
    x=c*i+d*j
    if x<=f:
      salt.append(x)
water=list(set(water))
salt=list(set(salt))
stack=0
ans_sol=0
ans_sal=0
for i in water:
  for j in salt:
    if i+j<=f and j*100<=i*c:
      if j/(i+j)>stack:
        stack=j/(i+j)
        ans_sol=i+j
        ans_sal=j
print(ans_sol,ans_sal)

### FIXED CODE ###

a,b,c,d,e,f=map(int,input().split())
dp=[-1]*(f+1)
dp[0]=0
flag=True
for i in range(1,f+1):
  for j in [a*100,b*100]:
    if i-j>=0 and dp[i-j]!=-1:
      dp[i]=max(0,dp[i])
  for j in [c,d]:
    if i-j>=0 and dp[i-j]!=-1:
      if 100*(dp[i-j]+j)<=e*(i-(dp[i-j]+j)):
        dp[i]=max(dp[i],dp[i-j]+j)
      else:
        for k in [a*100,b*100]:
          if i-k-j>=0 and dp[i-k-j]!=-1:
            if 100*(dp[i-k-j]+j)<=e*(i-(dp[i-k-j]+j)):
              dp[i]=max(dp[i],dp[i-k-j]+j)
stack=0
index=min(a*100,b*100)
for i in range(index+1,f+1):
  if dp[i]>0:
    if stack<(dp[i]*100)/i:
      stack=(dp[i]*100)/i
      index=i
print(index,dp[index])
N, A, B, = map(int, [int(input()) for _ in range(3)])
if N == 1:
    print('Hello World')
else:
    print(A+B)

### FIXED CODE ###

N = int(input())
if N == 1:
    print('Hello World')
else:
    print(int(input()) + int(input()))
N = int(input())
S = list(str(input()))
countlist=[]
for i in range(1,N-1):
    s1 = set(S[0:i])
    s2 = set(S[i:])

    matched_list=list(s1 & s2)
    countlist.append(len(matched_list))

ans = max(countlist)
print(ans)

### FIXED CODE ###

N = int(input())
S = list(str(input()))
countlist=[]
for i in range(0,N):
    s1 = set(S[:i])
    s2 = set(S[i:])

    matched_list=list(s1 & s2)
    countlist.append(len(matched_list))

ans = max(countlist)
print(ans)
r = input()
print(3 * a * a)

### FIXED CODE ###

r = int(input())
print(3 * r * r)
N,M,Q=map(int,input().split())
a=[]
b=[]
c=[]
d=[]
for i in range(Q):
  ta,tb,tc,td=map(int,input().split())
  a+=[ta]
  b+=[tb]
  c+=[tc]
  d+=[td]
maxs=0

def suuretu(n,m):#n桁m以上
  if n>1:
    A=[]
    for i in range(1,9):
      for j in suuretu(n-1,i):
        A+=[10*i+j]
    return A
  else:
    A=[i for i in range(m,10)]
    return A
B=suuretu(N,1)
answer=0
for i in B:
  ans=0
  s=str(i)
  tmpl=[int(s[j]) for j in range(N)]  
  for k in range(Q):
    if tmpl[a[k]-1]-tmpl[b[k]-1]==c[k]:
      ans+=d[i]
  answer=max(answer,ans)
print(answer)

 


### FIXED CODE ###

N,M,Q=map(int,input().split())
a=[]
b=[]
c=[]
d=[]
for i in range(Q):
  ta,tb,tc,td=map(int,input().split())
  a+=[ta]
  b+=[tb]
  c+=[tc]
  d+=[td]
maxs=0
A=[0 for i in range(10)]
for i in range(M):
  for j in range(i,M):
    for k in range(j,M):
      for l in range(k,M):
        for m in range(l,M):
          for n in range(m,M):
            for o in range(n,M):
              for p in range(o,M):
                for q in range(p,M):
                  for r in range(q,M):
                    A[0]=i
                    A[1]=j
                    A[2]=k
                    A[3]=l
                    A[4]=m
                    A[5]=n
                    A[6]=o
                    A[7]=p
                    A[8]=q
                    A[9]=r
                    su=0
                    for z in range(Q):
                      if A[b[z]-1]-A[a[z]-1]==c[z]:
                        su+=d[z]
                    if su>maxs:
                      maxs=su
print(maxs)
n = int(input())
d = list(map(int, input().split()))
m = int(input())
t = list(map(int, input().split()))
t_ = set(t)
for i in range(len(t_)):
  if t.count(t_[i]) > d.count(t_[i]):
    print("NO")
    exit()
print("YES")


### FIXED CODE ###

import collections

n = int(input())
d = list(map(int, input().split()))
m = int(input())
t = list(map(int, input().split()))
dc = collections.Counter(d)
tc = collections.Counter(t)
for i in tc:
    if tc[i] > dc[i]:
        print("NO")
        exit()
print("YES")
n = int(input())
a = list(map(int, input().split()))
ans = 1

for i in range(n):
	ans *= a[i]
	if ans > 10^18:
 		ans = -1
        break
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
if 0 in a:
	print(0)
	exit(0)
ans = 1
for i in range(n):
	ans *= a[i]
	if ans > 10**18:
		print(-1)
		exit(0)
print(ans)
n = int(input())
U = [[int(i) for i in input().split()] for j in range(n - 1)]

E = [[] for i in range(n + 1)]

for u, v, w in U:
    E[u].append((v, w))
    E[v].append((u, w))

visited = [False] * (n + 1)
color = [0] * (n + 1)

def dfs(v, w):
    if visited[v]:
        return None
    visited[v] = True
    color[v] = 1 if w % 2 == 1 else 0
    for u, weight in E[v]:
        dfs(u, w + weight)

    return None

dfs(1, 0)

for c in color[1:]:
    print(c)

### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(10 ** 9)

n = int(input())
U = [[int(i) for i in input().split()] for j in range(n - 1)]

E = [[] for i in range(n + 1)]

for u, v, w in U:
    E[u].append((v, w))
    E[v].append((u, w))

visited = [False] * (n + 1)
color = [0] * (n + 1)

def dfs(v, w):
    if visited[v]:
        return None
    visited[v] = True
    color[v] = 1 if w % 2 == 1 else 0
    for u, weight in E[v]:
        dfs(u, w + weight)

    return None

dfs(1, 0)

for c in color[1:]:
    print(c)
from math import gcd
n,x = map(int,input().split())
l = list(map(int,input().split()))
ll = [abs(x-i) for i in l]
ans = ll[0]
for i in range(len(ll)):
    ans = gcd(ans,ll[i])
print(ans)

### FIXED CODE ###

from fractions import gcd
n,x = map(int,input().split())
l = list(map(int,input().split()))
ll = [abs(x-i) for i in l]
ans = ll[0]
for i in range(len(ll)):
    ans = gcd(ans,ll[i])
print(ans)
#coding:utf-8

N = input()

p = []
max_val = -1
for i in range(N):
    p_i = input()
    p.append(p_i)
    max_val = max(max_val, p_i)

s = 0
flag = 0
for p_i in p:
    if p_i == max_val and flag==0:
        s += p_i * 0.5
        flag = 1
    else:
        s += p_i
print(int(s))
        


### FIXED CODE ###

#coding:utf-8

N = int(input())
p = []
max_val = -1
for i in range(N):
    p_i = int(input())
    p.append(p_i)
    max_val = max(max_val, p_i)

s = 0
flag = 0
for p_i in p:
    if p_i == max_val and flag==0:
        s += p_i * 0.5
        flag = 1
    else:
        s += p_i
print(int(s))
t_at, t_hp, a_at, a_hp = map(int, input().split())

while True:
  a_hp -= t_at
  if a_hp <= 0:
    print("Yes")
  	exit()
  
  t_hp -= a_at
  if t_hp <= 0:
    print("No")
    exit()


### FIXED CODE ###

t_hp, t_at, a_hp, a_at = map(int, input().split())

while True:
    a_hp -= t_at
    if a_hp <= 0:
        print("Yes")
        exit()

    t_hp -= a_at
    if t_hp <= 0:
        print("No")
        exit()
S = input()

weather_list = ["Sunny", "Cloudy", "Rainy", "Sunny"]
print(weather_list[weather_list.index("S") + 1]) 

### FIXED CODE ###

S = input()

weather_list = ["Sunny", "Cloudy", "Rainy", "Sunny"]
print(weather_list[weather_list.index(S) + 1])
a,b=input().split()
print(a*b)

### FIXED CODE ###

a,b=[int(i) for i in input().split()]
print(a*b)
n = int(input())
t,a = map(int,input().split())
ar = list(map(int,input().split()))
mxt,tt,ind = 100000000, 0,0
for i in range(n):
    tt = t - ar[i]*0.006
    f = 0
    if a<0 and tt < 0:
        f a,tt =1, abs(a),abs(tt)
    if abs(a-tt) < mxt:
        mxt = abs(a-tt)
        ind = i
    if f == 1:
        a = -a
print(ind+1)

### FIXED CODE ###

n = int(input())
t,a = map(int,input().split())
ar = list(map(int,input().split()))
mxt,tt,ind = 100000000, 0,0
for i in range(n):
    tt = t - ar[i]*0.006
    f = 0
    if a<0 and tt < 0:
        f, a,tt =1, abs(a),abs(tt)
    if abs(a-tt) < mxt:
        mxt = abs(a-tt)
        ind = i
    if f == 1:
        a = -a
print(ind+1)
N, A = int(input()), int(input())
for i in range(len(A) + 1):
  if (N - i) % 500 == 0:
    print('Yes')
    exit()
print('No')

### FIXED CODE ###

N, A = int(input()), int(input())
for i in range(A + 1):
  if (N - i) % 500 == 0:
    print('Yes')
    exit()
print('No')
N = int(input())
lis = []
for a in range(1,int(N**0.5)):
    b = N // a
    if a * b == N:
       lis.append(a + b - 2)
print(min(lis)) 

### FIXED CODE ###

N = int(input())
lis = []
for a in range(1,int(N**0.5)+1):
    b = N // a
    if a * b == N:
       lis.append(a + b - 2)
print(min(lis))
import time
import random
N = int(input())
s = str(input())
maxlen = N//2
start = time.time()
def solve(tgt):
    for i in range(N-tgt*2+1):
        if s[i:i+tgt] in s[i+tgt:]:
            return True
    return False

ng = maxlen + 1
ok = 0
if N>650:
    ok = 2
first = 1
while ng-ok > 1:
    end = time.time()
    if end-start > 1.2:
        if ok >= 2496:
            assert()
        r = random.random.randint(ok,ng-1)
        print(r)
        exit()
    tgt = (ok+ng)//2
    if N>=4800 and first == 1:
        tgt = 2492
        first = 0
    if solve(tgt):
        ok = tgt
    else:
        ng = tgt
print(ok)


### FIXED CODE ###

from collections import defaultdict as dd
N = int(input())
s = str(input())
maxlen = N//2

def solve(tgt):
    dic = dd(int)
    st = s[tgt:2*tgt]
    dic[st] += 1
    ls = [st]
    for char in s[2*tgt:]:
        st = st[1:]+char
        dic[st] += 1
        ls.append(st)
    st = s[:tgt]
    if dic[st] > 0:
        return True
    dic[ls[0]] -= 1
    for i,char in enumerate(s[tgt:N-tgt]):
        st = st[1:]+char
        if dic[st] > 0:
            return True
        dic[ls[i+1]] -= 1
    return False

ng = maxlen + 1
ok = 0
while ng-ok > 1:
    tgt = (ok+ng)//2
    if solve(tgt):
        ok = tgt
    else:
        ng = tgt
print(ok)
N,K,Q = map(int,input().split())
A = []
P = []
for x in range(0,N):
    P.append(K)
for a in range(0,Q):
    A.append(input())
    
for a in range(0,Q):
    for x in range(0,N):
        P[x] = P[x] - 1
    P[int(A[a])-1]=P[int(A[a])-1]+1
for x in range(0,N):
    if P[x] <= 0:
        P[x] = 'No'
    else:
        P[x] = 'Yes'
for x in range(0,N):
    print(P[x])

### FIXED CODE ###

x = input()
if x == 'Cloudy':
    S = 'Rainy'
elif x == 'Sunny':
    S = 'Cloudy'
elif x == 'Rainy':
    S = 'Sunny'
print(S)
r, c = map(int, input().split())
table = [[*cc, sum(cc)] for cc in (list(map(int, input().split())) for _ in range(r))]
table.append(list(map(sum, zip(*table))))
print('\n'.join(' '.join(map(str, line)) for line in table) + '\n')

### FIXED CODE ###

r, c = map(int, input().split())
table = [cc + [sum(cc)] for cc in (list(map(int, input().split())) for _ in range(r))]
table.append(list(map(sum, zip(*table))))
for line in table:
    print(*line)
import math
import sys
sys.setrecursionlimit(10**11)
a,b = map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
if b != 0:
    print(lcm(a, b))
else:
    print(a)

### FIXED CODE ###

from fractions import gcd
import sys
sys.setrecursionlimit(10**7)
a,b = map(int,input().split())
def lcm(x, y):
    return (x * y) // gcd(x, y)
if b != 0:
    print(lcm(a, b))
else:
    print(a)
A,P = map(int(input(),split())

apple_cut = A * 3

apple_pie = (apple_cut + P) /2
                 
print(int(apple_pie))

### FIXED CODE ###

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

apple_cut = A * 3

apple_pie = (apple_cut + P) /2
                 
print(int(apple_pie))
wide, height = map(int, input().split())

for i in range(height):
  c = input()
  print(c)
  print(c)
  

### FIXED CODE ###

height, wide = map(int, input().split())

for i in range(height):
  c = input()
  print(c)
  print(c)
N,Q = map(int, input().split())
import copy
import sys

sys.setrecursionlimit(10**6)
es = [[] for i in range(N)]

for i in range(N-1):
    a,b = map(int, input().split())
    a,b = a-1, b-1
    es[a].append(b)
    es[b].append(a)


point = [0] * N

for i in range(Q):
    p,x = map(int, input().split())
    point[p-1] += x 

ans = [0] * N
ans[0] = point[0] # 一番上の根なのでこれだけ
visited = [False] * N
visit_cnt = 1
from collections import deque
nexts = deque([0])
while len(nexts) >= 1:
    now = nexts.popleft()
    visited[now] = True

     for next in es[now]:
        if visited[next] == True:
            continue
        nexts.append(next)
        ans[next] = ans[now] + point[next]


print(*ans)

### FIXED CODE ###

N,Q = map(int, input().split())
import copy
import sys

sys.setrecursionlimit(10**6)
es = [[] for i in range(N)]

for i in range(N-1):
    a,b = map(int, input().split())
    a,b = a-1, b-1
    es[a].append(b)
    es[b].append(a)


point = [0] * N

for i in range(Q):
    p,x = map(int, input().split())
    point[p-1] += x 

ans = [0] * N
ans[0] = point[0] # 一番上の根なのでこれだけ
visited = [False] * N
visit_cnt = 1
from collections import deque
nexts = deque([0])
while len(nexts) >= 1:
    now = nexts.popleft()
    visited[now] = True

    for next in es[now]:
        if visited[next] == True:
            continue
        nexts.append(next)
        ans[next] = ans[now] + point[next]


print(*ans)
d=float(input())
t=float(input())
s=float(input())


if (d/t) <= s:
    print ('Yes')
    
else:
    print ('No')



### FIXED CODE ###

import sys

def main():
    input = sys.stdin.read()
    data = list(map(int, input.split()))

    a, b, c = data

    if b*c >= a:
        print('Yes')
    else:
        print('No')



if __name__ == '__main__':
    main()
a = int(input())
y = a//100
m = a%100
if y <= 12 and y >= 1:
        if m <= 12 and n >= 1:
            print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        if m <= 12 and n >= 1:
            print('YYMM')
        else:
            print('NA')


### FIXED CODE ###

a = int(input())
y = a//100
m = a%100
if 1 <= y <= 12 and 1 <= m <= 12:
	print('AMBIGUOUS')
elif 1 <= y <= 12:
	print('MMYY')
elif 1 <= m <= 12:
	print('YYMM')
else:
	print('NA')
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline

    n = int(input())
    s = input().rstrip()
    eng_list = 'abcdefghigklmnopqrstuvwxyz'
    eng_dict = {}
    for i in eng_list:
        eng_dict[i] = 1
    for i in s:
        eng_dict[i] += 1
    ans = 1
    for i in eng_dict.values():
        ans = (ans*i)%(10**9+7)
    print(ans-1)

### FIXED CODE ###

if __name__ == '__main__':
    import sys
    input = sys.stdin.readline

    n = int(input())
    s = input().rstrip()
    eng_list = 'abcdefghigklmnopqrstuvwxyz'
    eng_dict = {}
    for i in eng_list:
        eng_dict[i] = 1
    for i in s:
        try:
            eng_dict[i] += 1
        except KeyError:
            eng_dict[i] = 2
    ans = 1
    size = 10**9+7
    for i in eng_dict.values():
        ans = (ans*i)%size
    print((ans-1)%size)
import numpy as np
 
N = int(input())
A = np.array(map(int, input().split()))
 
A %= (1000000000+7)
_sum = 0
 
for n in range(N-1):
  for i in range(n+1):
    _sum += A[n+1] * A[i]
    _sum %= (1000000000+7)
    
print(_sum)

### FIXED CODE ###

#標準入力
N = int(input())
A = list(map(int, input().split()))

#累積和
S = [0]*N
for n in range(N):
  S[n] = S[n-1] + A[n]

_sum = int(0)
for i in range(N-1):
  _sum = _sum + (A[i] * (S[-1] - S[i]))

#modulo
_sum = _sum % (1000000000+7)
  
print(_sum)
import heapq
import itertools
def main():
    n,k=map(int, input().split())
    v=[int(i) for i in input().split()]
    #k回Vの両端から取り出したり詰めたりして持ってるものの価値の最大化をする
    v_1 = v[::-1]
    #左から取る回数をA、右から取る回数をBとしたとき、価値が負の宝石を捨てる操作は（k-(A+B)）回できる
    #これを利用して全探索
    res = 0
    for i in range(k+1):
        j = 0
        while(i+j<=k):
            q = []
            tmp = 0
            if(i>0):
                for l in range(i):
                    if(v[l]<0):
                        heapq.heappush(q,v[l])
                    tmp += v[l]
            if(j>0):
                for l in range(j):
                    if(v_1[l]<0):
                        heapq.heappush(q,v_1[l])
                    tmp += v_1[l]
            for l in range(k-(i+j)):
                if(len(q)>0):
                    z = heapq.heappop(q)
                    tmp -= z
            j+=1
            res = max(res,tmp)

    print(res)
if __name__ == '__main__':
    main()


### FIXED CODE ###

import heapq
import itertools
def main():
    n,k=map(int, input().split())
    v=[int(i) for i in input().split()]
    #k回Vの両端から取り出したり詰めたりして持ってるものの価値の最大化をする
    v_1 = v[::-1]
    #左から取る回数をA、右から取る回数をBとしたとき、価値が負の宝石を捨てる操作は（k-(A+B)）回できる
    #これを利用して全探索
    res = 0
    for i in range(k+1):
        j = 0
        while(i+j<=min(n,k)):

            q = []
            tmp = 0
            if(i>0):
                for l in range(i):
                    if(v[l]<0):
                        heapq.heappush(q,v[l])
                    tmp += v[l]
            if(j>0):
                for l in range(j):
                    if(v_1[l]<0):
                        heapq.heappush(q,v_1[l])
                    tmp += v_1[l]
            for l in range(k-(i+j)):
                if(len(q)>0):
                    z = heapq.heappop(q)
                    tmp -= z
            j+=1
            res = max(res,tmp)

    print(res)
if __name__ == '__main__':
    main()
N, M = map(int, input().split())
 
graph = [ [] for _ in range(N) ]
 
for i in range(M):
    x, y = map(int, input().split())
    graph[x-1].append(y-1)
 
dp = [-1] * N
length = [0] * N
 
def count(j):
    if dp[j] != -1:
        return(dp[j])
    else:
        dp[j] = 0
        for k in graph[j]:
            dp[j] = max(count(k)+1, dp[j])
        return dp[j]
 
for i in range(N):
    length[i] = count(i)
 
print(max(length))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)

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

graph = [ [] for _ in range(N) ]

for i in range(M):
    x, y = map(int, input().split())
    graph[x-1].append(y-1)

dp = [-1] * N
length = [0] * N

def cnt(j):
    if dp[j] != -1:
        return(dp[j])
    else:
        dp[j] = 0
        for k in graph[j]:
            dp[j] = max(cnt(k)+1, dp[j])
        return dp[j]

for i in range(N):
    length[i] = cnt(i)

print(max(length))
n = input()
li = list(map(int,input().split())
cnt = 0

while True:
    for i in range(n):
        if li[i]%2 ==0:
            li[i]=li[i]/2
        else:
            break
        if(i==n-1):
            cnt += 1

print(cnt)

### FIXED CODE ###

n = int(input())
li = list(map(int,input().split()))
cnt = 0

while all(i%2==0 for i in li):
  for i in range(n):
    li[i]/=2
  cnt+=1

print(cnt)
a = int(input())
b = int(input())

if (a - b) >= 2:
    print(a + a - 1)
elif (b - a) >= 2:
    print(b + b - 1)
else:
    print(a + b)

### FIXED CODE ###

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

if (A - B) >= 2:
    print(A + A - 1)
elif (B - A) >= 2:
    print(B + B - 1)
else:
    print(A + B)
a = input()
b = input()
 
area = int(a) * int(b)
length = 2 * int(a) + 2 * int(b)
 
print(area length)

### FIXED CODE ###

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

area = a*b
length = 2 * (a+b)

print(area,end=" ")
print(length)
class int(int):  
  def times(self, callback):
    for times in range(0,self):
      callback()

class list(list):
  def maps(self, callback):
    return list(map(callback, self))

  def each(self, callback):
    list(map(callback, self))
    return self

  # index will sent to the function as a second parameter.
  def each_with_index(self,callback):
    list(map(callback, self, range(0,len(self))))
    return self

# Make sure you initialize object with class name.
# Ex: int(10).times, array = list([1,2,3,4,5])

target, length = input().split()
target = int(target)
length = int(length)
nums = list(input().split())

def convert(arg):
    return int(arg)
nums = nums.maps(convert)

for i in range(0,101):
  a = target - i
  if a not in nums:
    print(a)
    exit()

  a = target + u
  if b not in nums:
    print(b)
    exit()

### FIXED CODE ###

class int(int):  
  def times(self, callback):
    for times in range(0,self):
      callback()

class list(list):
  def maps(self, callback):
    return list(map(callback, self))

  def each(self, callback):
    list(map(callback, self))
    return self

  # index will sent to the function as a second parameter.
  def each_with_index(self,callback):
    list(map(callback, self, range(0,len(self))))
    return self

# Make sure you initialize object with class name.
# Ex: int(10).times, array = list([1,2,3,4,5])

target, length = input().split()
target = int(target)
length = int(length)
nums = list(input().split())

def convert(arg):
    return int(arg)
nums = nums.maps(convert)

for i in range(0,101):
  a = target - i
  if a not in nums:
    print(a)
    exit()

  b = target + i
  if b not in nums:
    print(b)
    exit()
N, M, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(j) for j in input().split()]

a, b = [0], [0]
for i in range(N):
    a.append[a[i] + A[i]]
for i in range(M):
    b.append[b[i] + B[i]]

ans, j = 0, M
for i in range(N+1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)

print(ans)
    


### FIXED CODE ###

N, M, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(j) for j in input().split()]

a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N+1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)

print(ans)
import math

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]


n, a, b, k = map(int, input().split())
count = 0
for i in range(n+1):
    if (k - (i * a)) % b == 0:
        count += int(cmb(n, i) * cmb(n, int((k-i*a)/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)
x = input().split()

n = int(x[0])
k = int(x[1])
ds = []
bool_array = [0]*n

for num in range(k):
  di = int(input())
  ajs_input = input().split(' ')
  for j in range(di):
     bool_array[int(ajs_input[j])-1] = 1
      
print(n - np.array(bool_array).sum())


### FIXED CODE ###

import numpy as np

x = input().split()

n = int(x[0])
k = int(x[1])
ds = []
bool_array = [0]*n

for num in range(k):
  di = int(input())
  ajs_input = input().split(' ')
  for j in range(di):
     bool_array[int(ajs_input[j])-1] = 1
      
print(n - np.array(bool_array).sum())
count = 0
out = 0
for i in range(len(S_list)-1):
    #print(i)
    if S_list[i]=='h':
        if S_list[i+1]=='i':    
            if i+2 > len(S_list)-1:
                count += 1                
            else:
                if S_list[i+2]=='i':
                    out += 1

if count >0 and out ==0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

S = input()

List = ['hihi', 'hi', 'hihihi', 'hihihihi', 'hihihihihi']

if S in List:
  print('Yes')
  
else:
  print('No')
a,b = map(int(input().split()))
ans = 0
for i in range(a,b+1):
  j = str(i)[::-1]
  if i == int(j):
    ans += 1
print(ans)


### FIXED CODE ###

a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
  j = str(i)[::-1]
  if i == int(j):
    ans += 1
print(ans)
n=int(input())
a=list(map(int,input().split()))
a=set(a)
print(len(a))


### FIXED CODE ###

n=int(input())
a=[0]*n
for i in range(n):
  a[i]=input()
  
a=set(a)
print(len(a))
N,M=map(int,input().split())
x=[0]*(n+1)
y=[0]*(n+1)
for i in range(M):
    a,b=map(int,input().split())
    if a==1:
        x[b]=1
    if b==N:
        y[a]=1
for i in range(N+1):
    if x[i]==1 and y[i]==1:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

### FIXED CODE ###

N,M=map(int,input().split())
x=[0]*(N+1)
y=[0]*(N+1)
for i in range(M):
    a,b=map(int,input().split())
    if a==1:
        x[b]=1
    if b==N:
        y[a]=1
for i in range(N+1):
    if x[i]==1 and y[i]==1:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")