Harryxun/stf_run huggingface dataset:
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func ini() {
	var buf = make([]byte, 10000)
	sc.Buffer(buf, 1000000)
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	ini()
	N, _ := strconv.Atoi(nextLine())
	S := nextLine()
	b := make([]int, N+1)

	for i, s := range S {
		if s == '#' {
			b[i+1] = b[i] + 1
		} else {
			b[i+1] = b[i]
		}
	}
	ans := N
	for i := 1; i < N+1; i++ {
		ans = min(ans, b[i]+N-i-b[N]+b[i-1])
	}
	fmt.Println(ans)
}


### FIXED CODE ###

N = int(input())
S = input()

b = [0] * N
for i, s in enumerate(S):
    if s == '#':
        b[i] = b[i-1] + 1
    else:
        b[i] = b[i-1]
b = [0] + b + [0]
ans = N
for i in range(N+1):
    ans = min(ans, b[i] + N - i - b[N] + b[i-1])

print(ans)
in_data = input()
data = in_data.splite(' ')
A = data[0]
B = data[1]
c = (B - 1) // (A - 1)
 
print(c)

### FIXED CODE ###

in_data = input()
 
data = in_data.split(' ')
A = int(data[0])
B = int(data[1])
if B == 1:
  print("0")
else:
  c = (B - 1) // (A - 1)
  d = (B - 1) / (A - 1)
  if c < d:
    c = c + 1
  print(c)
L=int(input())
a=L/3
b=a**3
print("{;.12f}".format(b))

### FIXED CODE ###

L=int(input())
a=L/3
b=a**3
print("{:.12f}".format(b))
S=input()
print(max(i for i in range(4)if S.index("R"*i)))

### FIXED CODE ###

S = input()

if S == "SSS":
    cnt = 0
elif S == "RRR":
    cnt = 3
elif "RR" in S:
    cnt = 2
else:
    cnt = 1
    
print(cnt)
import sys
from collections import deque
n,q=map(int,input().split())
d=deque(map(lambda x,y:[x,int(y)],sys.stdin))
t=0
while d:
 k,v=d.popleft()
 v=int(v)
 if v>q:
  v-=q
  t+=q
  d.append([k,v])
 else:
  t+=v
  print(k,t)


### FIXED CODE ###

import sys
from collections import deque
def m():
 s=sys.stdin.readlines()
 q=int(s[0].split()[1])
 f=lambda x,y:(x,int(y))
 d=deque(f(*e.split())for e in s[1:])
 t,a=0,[]
 while d:
  k,v=d.popleft()
  if v>q:v-=q;t+=q;d.append([k,v])
  else:t+=v;a+=[f'{k} {t}']
 print('\n'.join(a))
if'__main__'==__name__:m()
import numpy as np
def inpl(): return [int(i) for i in input().split()]
def minisum(x):
    mini = np.argmin(x)
    d = len(x)
    if d == 1:
        return x[0]
    result = 0
    if mini != 0:
        result += minisum(x[0:mini])
    if mini != d-1:
        result += minisum(x[mini+1:d])
    return result + (d-mini)*(mini+1)*x[mini]

N = input()
a = np.array(inpl())
print(minisum(a))


### FIXED CODE ###

def inpl(): return [int(i) for i in input().split()]
N = int(input())
a = inpl()
b = {a[i]: i for i in range(N)}

left = list(range(N+2))
right = list(range(N+2))

ans = 0
for i in range(N,0,-1):
    x = b[i]
    ans += i*(right[x]-x +1)*(x-left[x] +1)
    right[left[x] - 1] = right[x]
    left[right[x] + 1] = left[x]
print(ans)
s = input()
f = False
for i in s:
    if i == '7':
        f = True
	break

if f:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s = input()
f = False
for i in s:
    if i == '7':
        f = True
        break

if f:
    print('Yes')
else:
    print('No')
n = int(input())
T = [0] + [None] * n
X = [0] + [None] * n
Y = [0] + [None] * n
for i in range(1, n + 1):
  T[i], X[i], Y[i] = map(int, input().split())

for i in range(len(T) - 1):
  dt = abs(T[i + 1] - T[i])
  dx = abs(X[i + 1] - X[i])
  dy = abs(Y[i + 1] - Y[i])
  if (dt % 2 == (dx + dy) % 2 and (dx + dy) <= dt):
    res = res and True
  else:
    res = False

if (res):
  print('Yes')
else:
  print('No')


### FIXED CODE ###

n = int(input())
T = [0] + [None] * n
X = [0] + [None] * n
Y = [0] + [None] * n
for i in range(1, n + 1):
  T[i], X[i], Y[i] = map(int, input().split())

for i in range(len(T) - 1):
  dt = T[i + 1] - T[i]
  dx = abs(X[i + 1] - X[i])
  dy = abs(Y[i + 1] - Y[i])
  if (dt % 2 == (dx + dy) % 2 and (dx + dy) <= dt):
    res = True
  else:
    print('No')
    exit()

print('Yes')
a,b=input.split()

if a*b%2==1:
    print("Odd")
else:
    print("Even")

### FIXED CODE ###

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


if (a*b)%2==0:
    print("Even")
else:
    print("Odd")
H,W=map(int,input().split())

c=[list(str(input())) for i in range(H)]
#1<=sy<=R
d=[[0 for j in range(W)]for i in range(H)]
inf=10**6
ans=0
for i in range(H):
    for j in range(W):
        if c[i][j]=='#':
            d[i][j]=-1
        else:
            d[i][j]=inf
            ans+=1


d[0][0]=0
queue=collections.deque([[0,0]])
gy,gx=H-1,W-1

moves=[[1,0],[-1,0],[0,1],[0,-1]]

flag=False
while len(queue)>0:
    now=queue.popleft()
    for i in range(4):
        ny=now[0]+moves[i][0]
        nx=now[1]+moves[i][1]
        
        if 0<=ny and ny<H and 0<=nx and nx<W and c[ny][nx]=='.' and d[ny][nx]==inf:
            d[ny][nx]=d[now[0]][now[1]]+1
            queue.append([ny,nx])
            if ny==gy and nx==gx:
                print(ans-d[ny][nx]-1)
                exit()
print(-1)     

### FIXED CODE ###

import collections
import math


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

c=[list(str(input())) for i in range(H)]
#1<=sy<=R
d=[[0 for j in range(W)]for i in range(H)]
inf=10**6
ans=0
for i in range(H):
    for j in range(W):
        if c[i][j]=='#':
            d[i][j]=-1
        else:
            d[i][j]=inf
            ans+=1


d[0][0]=0
queue=collections.deque([[0,0]])
gy,gx=H-1,W-1

moves=[[1,0],[-1,0],[0,1],[0,-1]]

flag=False
while len(queue)>0:
    now=queue.popleft()
    for i in range(4):
        ny=now[0]+moves[i][0]
        nx=now[1]+moves[i][1]
        
        if 0<=ny and ny<H and 0<=nx and nx<W and c[ny][nx]=='.' and d[ny][nx]==inf:
            d[ny][nx]=d[now[0]][now[1]]+1
            queue.append([ny,nx])
            if ny==gy and nx==gx:
                print(ans-d[ny][nx]-1)
                exit()
print(-1)
s = input()
k = len(s)

# def dfs(i, f) :
#     """
#     argument i : どこから始めるか
#     f :　最初の数
#     returen : falese or ture(作れるならtrue)
#     """
#     if i == k-1:
#         return sum(list(map(int, f.split('+'))))

#     return dfs(i+1, f + s[ i +1 ]) + \
#            dfs(i+1, f + '+' +  s[ i +1 ]) 

# print(dfs(0, s[0]))

#bit木を書いていきます

ans = 0

for bit in range(1 << k-1):
    f = s[0]
    
    for i in range(k-1):
        # if bit & (1 << i)で、bitにiが含まれているか（フラグが立っているか）を判定してくれるらしい
        if bit & (1 << i):
            f += '+'
        f += f[i + 1]
    ans += sum(list(map(int, f.split('+'))))

print(ans)

### FIXED CODE ###

s = input()
n = len(s)

ans = 0

for bit in range(1 << (n - 1)):
    # 各場合で式 f を生成する
    f = s[0]

    for i in range(n - 1):
        if bit & (1 << i):
            # フラグが立っているならば "+" を式の末尾に追加する
            f += "+"
        f += s[i + 1]

    ans += sum(map(int, f.split("+")))

print(ans)
n=int(input())
string_list=[sorted(input()) for i in range(n)]
string_set=set(string_list)
cnt=0
for s in string_set:
  n=string_list.count(s)
  cnt+=int(n*(n-1)/2)
print(cnt)

### FIXED CODE ###

from collections import Counter
n=int(input())
string_list=["".join(sorted(list(input()))) for i in range(n)]
counter=Counter(string_list)
cnt=0
for k, v in counter.items():
  cnt+=int(v*(v-1)/2)
print(cnt)
N,L=map(int,input().split())
＃リンゴの味のリスト
s=[]
for i in range(1,N+1):
  s.append(L+i-1)
＃リンゴの味の絶対値のリスト
s.remove(min(abs(s[i-1])))
print(sum(s))

  

### FIXED CODE ###

N,L=map(int,input().split())
s=[]
for i in range(1,N+1):
  s.append(L+i-1)
s.sort(key=lambda x: abs(x))
del s[0]
print(sum(s))
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")

x,n = map(int,input().split())
if n:
    p = list(map(int,input().split()))

p = set(p)
pp = set([item for item in range(0,101) if item not in p])
v = 3000
ans = -1
for item in pp:
    if v>abs(x-item):
        v = abs(x-item)
        ans = item
print(ans)

### FIXED CODE ###

x,n = map(int,input().split())
if n:
    p = list(map(int,input().split()))
else:
    p = []
p = set(p)
pp = set([item for item in range(0,105) if item not in p])
v = 3000
ans = -1
for item in pp:
    if v>abs(x-item):
        v = abs(x-item)
        ans = item
print(ans)
def dfs(curr, path, N, edges, visited):
    visited[curr] = True
    path.append(curr)
    for dst in edges[curr]:
        if not visited[dst]:
            return dfs(dst, path, N, edges, visited)
    return path

N,M=map(int,input().split())
edges=[[] for _ in range(N)]
for _ in range(M):
    A,B=map(int,input().split())
    edges[A-1].append(B-1)
    edges[B-1].append(A-1)
visited=[False]*N
path1 = dfs(0,[],N,edges,visited)
path2 = dfs(0,[],N,edges,visited)
path = path2[::-1] + path1[1:]

print(len(path))
print(" ".join([str(v+1) for v in path]))


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

N,M=map(int,input().split())
edges=[[] for _ in range(N)]
for _ in range(M):
    A,B=map(int,input().split())
    edges[A-1].append(B-1)
    edges[B-1].append(A-1)

visited=[False]*N
path=[]

def dfs(curr):
    visited[curr] = True
    path.append(curr)
    for dst in edges[curr]:
        if not visited[dst]:
            dfs(dst)
            return

dfs(0)
path=path[1:][::-1]
dfs(0)

print(len(path))
print(" ".join([str(v+1) for v in path]))
from heapq import *

N=int(input())
A=map(int,input().split())
A.reverse()
B=[]
heap=[]
for i in range(N):
    heappush(heap,A[i])
for i in range(N,2*N):
    if heap[0]<A[i]:
        B.append(heappop(heap))
        heappush(heap,A[i])
    else:
        B.append(A[i])
C=[]
for i in range(2*N,3*N):
    if 2*B[-1]-A[i]-heap[0]>0:
        C.append(B.pop(-1))
        B.append(heappop(heap))
    else:
        C.append(A[i])
print(sum(C)-sum(B))


### FIXED CODE ###

from heapq import *

N=int(input())
A=list(map(int,input().split()))
B=[]
for i in range(N):
    heappush(B,A[i])
sumB=[sum(B)]
for i in range(N,2*N):
    heappush(B,A[i])
    poped=heappop(B)
    sumB.append(sumB[-1]-poped+A[i])

A.reverse()
C=[]
for i in range(N):
    heappush(C,A[i]*(-1))
sumC=[(-1)*sum(C)]
for i in range(N,2*N):
    heappush(C,A[i]*(-1))
    poped=heappop(C)*(-1)
    sumC.append(sumC[-1]-poped+A[i])
sumC.reverse()
ans=-10**19
for i,j in zip(sumB,sumC):
    ans=max(ans,i-j)
print(ans)
import numpy as np


n,m = map(int,input().split())
a = np.array(list(map(int,input().split())))
for i in range(m):
    a[a.argmax()] = a[a.argmax()]//2 
print(np.sum(a))


### FIXED CODE ###


N, M = map(int,input().split())
A = list(-int(i) for i in input().split())
import heapq

heapq.heapify(A)
for _ in range(M):
    a = heapq.heappop(A)//(-2)
    heapq.heappush(A,-a)

print(-sum(A))
MOD = 10**9 + 7
def Mod_Permutation(n, k, mod):
    ret = 1
    for i in range(n - k + 1, n + 1):
        ret = ret * i % mod
    return ret
N, M = map(int, input().split())
print(Mod_Permutation(N, N, MOD) * P(N+1, M, MOD) % MOD)

### FIXED CODE ###

MOD = 10**9 + 7
def Mod_Permutation(n, k, mod):
    ret = 1
    for i in range(n - k + 1, n + 1):
        ret = ret * i % mod
    return ret
N, M = map(int, input().split())
if abs(N - M) > 1:
    print(0)
elif N == M:
    print(int(Mod_Permutation(N, N, MOD) * (2 * Mod_Permutation(N, M, MOD) % MOD) % MOD))
else:
    if N < M:
        T = N
        N = M
        M = T
    print(int(Mod_Permutation(N, N, MOD) * Mod_Permutation(M, M, MOD) % MOD))
def Ics(x, y):
    a = len(x)
    b = len(y)
    c1 = [0] * (b + 1)

    for i in range(a):
        d = x[i]
        c2 = c1[:]
        for j in range(n):
            if d == y[j]:
                c1[j + 1] = c2[j] + 1
            elif c1[j + 1] < c1[j]:
                c1[j + 1] = c1[j]
    return (c1[-1])

q = int(input().rstrip())
r = []
for k in range(q):
    s1 = input().rstrip()
    s2 = input().rstrip()
    r.append(Ics(s1, s2))

print(*r, sep = "\n")

### FIXED CODE ###

def Ics(x, y):
    a = len(x)
    b = len(y)
    c1 = [0] * (b + 1)

    for i in range(a):
        d = x[i]
        c2 = c1[:]
        for j in range(b):
            if d == y[j]:
                c1[j + 1] = c2[j] + 1
            elif c1[j + 1] < c1[j]:
                c1[j + 1] = c1[j]
    return (c1[-1])

q = int(input().rstrip())
r = []
for k in range(q):
    s1 = input().rstrip()
    s2 = input().rstrip()
    r.append(Ics(s1, s2))

print(*r, sep = "\n")
s = input()
if s[3]=s[4] && s[5]=s[6]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = str(input())
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")
N = int(input())
A = reversed(sorted(map(int, input().split())))
assert len(A) == N
mul = 1
for a in A:
  mul *= a
  if mul >= 10 ** 18:
    print(-1)
    break
else:
  print(mul)

### FIXED CODE ###

N = int(input())
#A = list(reversed(sorted(list(map(int, input().split())))))
A = sorted(list(map(int, input().split())))
assert len(A) == N
mul = 1
for a in A:
  mul *= a
#  print(a, mul)
  if a == 0:
    print(0)
    break
  if mul > (10 ** 18):
    print(-1)
    break
else:
  print(mul)
a, b = input().split()
print( int(a) * int(b), 2 * ( int(a) + int(b) ) )



### FIXED CODE ###

a,b = input().split()
a = int( a )
b = int( b )
print(  a * b, 2 * ( a + b ) )
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N,M = map(int, readline().split())

    ans = [None]*N
    for i in range(M):
        s, c = map(int, readline().split())
        if ans[s-1] is None:
            ans[s-1] = c
        elif c == ans[s-1]:
            continue        
        else:
            print(-1)
            exit()
    
    if ans[0] is None:
        ans[0] = 1
    if ans[1] is None:
        ans[1] = 0
    if ans[2] is None:
        ans[2] = 0

    if N >= 2 and ans[0] == 0:
        print(-1)
        exit()

    print("".join(map(str,ans)))

if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N,M = map(int, readline().split())

    if N == 1 and M == 0:
        print(0)
        exit()

    ans = [None]*N
    for i in range(M):
        s, c = map(int, readline().split())
        if ans[s-1] is None:
            ans[s-1] = c
        elif c == ans[s-1]:
            continue        
        else:
            print(-1)
            exit()
    
    if ans[0] is None:
        ans[0] = 1
    
    for i in range(1,N):
        if ans[i] is None:
            ans[i] = 0

    if N >= 2 and ans[0] == 0:
        print(-1)
        exit()

    print("".join(map(str,ans)))

if __name__ == "__main__":
    main()
N,K = tuple(map(int,input.split(" ")))
cont = list(map(int,input.split(" ")))
print(sum(cont[:K]))

### FIXED CODE ###

N,K = tuple(map(int,input().split(" ")))
cont = sorted(list(map(int,input().split(" "))))
print(sum(cont[:K]))
n, m = list(map(int, input().split()))
a=[]
for i in range(n):
	a.append([int(j) for j in input().split()])
b = []
for i in range(m)
	b.append(int(input()))
for j in range(n):
	s = 0
	for j in range(m):
		s += a[i][j] * b[j]
	print(s)
	


### FIXED CODE ###

n, m = list(map(int, input().split()))
a=[]
for i in range(n):
	a.append([int(j) for j in input().split()])
b = []
for i in range(m):
	b.append(int(input()))
for i in range(n):
	s = 0
	for j in range(m):
		s += a[i][j] * b[j]
	print(s)
from collections import*
z,v,a=input,range,print
h,w,k=map(int,z().split());r,s,t,u=map(lambda x:int(x)-1,z().split())
b=[z()for _ in v(h)];l=[[-1]*w for _ in v(h)];l[r][s]=0
d=deque([(r,s)])
while d:x,y=d.popleft()
  if(x==t)&(y==u):exit(a(l[x][y]))
  for e,f in[[1,0],[-1,0],[0,-1],[0,1]]:
    for i in v(1,k+1):
      p,q=x+e*i,y+f*i
      if not((0<=p<h)&(0<=q<w))or b[p][q]=="@" or 0<=l[p][q]<=l[x][y]:break
      if l[p][q]<0:d+=[(p,q)];l[p][q]=l[x][y]+1
a(-1)

### FIXED CODE ###

import sys
inf=1000002
sys.setrecursionlimit(inf)
from collections import deque
h,w,k=map(int,input().split())
x1,y1,x2,y2=map(int,input().split())
c=[input() for i in range(h)]
dp=[[inf if c[i][j]=="." else -1 for j in range(w)] for i in range(h)]
now=deque()
now.append([x1-1,y1-1])
dp[x1-1][y1-1]=0
#kの更新が遅い
def bfs(d):
    global h,w,k,dp,now,x2,y2
    l=len(now)
    if l==0:
        return
    dp_sub=deque()
    cand=set()
    for i in range(l):
        x,y=now.popleft()
        for j in range(1,min(k+1,w-y)):
            if dp[x][y+j]==inf:
                dp_sub.append([x,y+j,d])
                #dp[x][y+j]=d
                cand.add((x,y+j))
                #now.append([x,y+j])
            else:
                break
        for j in range(1,min(k+1,y+1)):
            if dp[x][y-j]==inf:
                dp_sub.append([x,y-j,d])
                #dp[x][y-j]=d
                cand.add((x,y-j))
                #now.append([x,y-j])
            else:
                break
        for j in range(1,min(k+1,h-x)):
            if dp[x+j][y]==inf:
                dp_sub.append([x+j,y,d])
                #dp[x+j][y]=d
                cand.add((x+j,y))
                #now.append([x+j,y])
            else:
                break
        for j in range(1,min(k+1,x+1)):
            if dp[x-j][y]==inf:
                dp_sub.append([x-j,y,d])
                #dp[x-j][y]=d
                cand.add((x-j,y))
                #now.append([x-j,y])
            else:
                break
    while dp_sub!=deque([]):
        e=dp_sub.popleft()
        dp[e[0]][e[1]]=e[2]
    for i in cand:
        now.append(i)
    bfs(d+1)
bfs(1)
print(dp[x2-1][y2-1] if dp[x2-1][y2-1]!=inf else -1)
N, M = map(int,input().split())
Q = [list(map(int,input().split())) for _ in range(M)]
C = [[] for _ in range(N+1)]
count = 0
for q in Q:
    X = q[0]
    Y = q[1]
    C[X].append(Y)
    C[Y].append(X)

flag = [-1]*(N+1)
flag[1] = 0
def dfs(s):
    global count
    for c in C[s]:
        flag[s] = 0
        if flag[c] == -1:
            flag[c] = 0
            count += 1
            dfs(c)

for i in range(1,N+1):
    dfs(i)
print(N-count)


### FIXED CODE ###

import sys
sys.setrecursionlimit(500*500)
N, M = map(int,input().split())
Q = [list(map(int,input().split())) for _ in range(M)]
C = [[] for _ in range(N+1)]
count = 0
for q in Q:
    X = q[0]
    Y = q[1]
    C[X].append(Y)
    C[Y].append(X)

flag = [-1]*(N+1)
flag[1] = 0
def dfs(s):
    global count
    for c in C[s]:
        flag[s] = 0
        if flag[c] == -1:
            flag[c] = 0
            count += 1
            dfs(c)

for i in range(1,N+1):
    dfs(i)
print(N-count)
from bisect import bisect_left

MOD = 10 ** 9 + 7

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

a = list(map(int, input().split()))
a = sorted(a)
la = len(a)
sa = set(a)
lsa = len(sa)
if la != lsa:
    print(0)
    exit()

b = list(map(int, input().split()))
b = sorted(b)
lb = len(b)
sb = set(b)
lsb = len(sb)
if lb != lsb:
    print(0)
    exit()

ans = 1
ai = 0
bi = 0
k = N * M
d = 0
while k > 0:
    ai = bisect_left(a, k)
    bi = bisect_left(b, k)

    if a[ai] == k:
        ta = 1
        if b[bi] == k:
            tb = 1
            t = ta * tb
        else:
            tb = (lb - bi)
            t = ta * tb
    else:
        ta = (la - ai)
        if b[bi] == k:
            tb = 1
            t = ta * tb
        else:
            tb = (lb - bi)
            t = ta * tb - d

    # print(ta, tb)
    ans *= t

    ans %= MOD
    # print(ans)
    k -= 1
    d += 1

print(ans)


### FIXED CODE ###

from bisect import bisect_left

MOD = 10 ** 9 + 7

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

a = list(map(int, input().split()))
a = sorted(a)
la = len(a)
sa = set(a)
lsa = len(sa)
if la != lsa:
    print(0)
    exit()

b = list(map(int, input().split()))
b = sorted(b)
lb = len(b)
sb = set(b)
lsb = len(sb)
if lb != lsb:
    print(0)
    exit()

ans = 1
ai = 0
bi = 0
k = N * M
d = 0
while k > 0:
    ai = bisect_left(a, k)
    bi = bisect_left(b, k)
    
    if ai == la or bi == lb:
        print(0)
        exit()
        
    if a[ai] == k:
        ta = 1
        if b[bi] == k:
            tb = 1
            t = ta * tb
        else:
            tb = (lb - bi)
            t = ta * tb
    else:
        ta = (la - ai)
        if b[bi] == k:
            tb = 1
            t = ta * tb
        else:
            tb = (lb - bi)
            t = ta * tb - d

    # print(ta, tb)
    ans *= t

    ans %= MOD
    # print(ans)
    k -= 1
    d += 1

print(ans)
N=list(map(int.input(),split()))
if sorted(N)==[5,7,7]:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

N=list(map(int,input().split()))
if sorted(N)==[5,5,7]:
    print("YES")
else:
    print("NO")
import math
a,b,c = map(input(),split())
n = math.pow((c-(a-b)), 2)
m = a*b*4
if((a+b) >= c):
	print("no")
else:
	if(n < m):
		print("yes")
	else:
		print("no")

### FIXED CODE ###

import math
a,b,c = map(int,input().split())
l = 4*a*b
r = (c-a-b)**2
if (a+b >= c):
    print("No")
else:
    if(l < r):
        print("Yes")
    else:
        print("No")
## import

## function definition 

## main process
if __name__ == '__main__':
    
    ## input
    N, M = map(int,input().split())
    HEIGHT_LIST = list(map(int,input().split())) 
    ROAD_LIST = []
    for j in range(M): 
        ROAD_LIST.append(
            set(map(int,input().split()))
        )
    
    ## business logic
    COUNT = 0
    
    for i in list(range(1, N+1)):
        unioned_i = set([])
        for k in ROAD_LIST:
            if i in k:
                unioned_i = unioned_i | k
        if len(unioned_i) == 0:
            COUNT = COUNT + 1
            continue
        HIGHT_i = HEIGHT_LIST[i-1]
        if HIGHT_i >= max(
            [ HEIGHT_LIST[l-1] for l in list(unioned_i) ]
        ):
            COUNT = COUNT + 1
    
    ## output
    print(COUNT)

### FIXED CODE ###

S = input()
if S == 'ABC':
    print('ARC')
else:
    print('ABC')
import math

def gcd(A):
    s=A[0]
    for i in A:
        s=math.gcd(s,i)
    return s

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

### FIXED CODE ###

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

def gcd(l):
    ans=l[0]
    for i in l:
        ans=gcd_(ans,i)
    return ans  
  
N=int(input())
A=list(map(int,input().split()))
print(gcd(A))
S = set(input())
    print("Yes" if len(S) == 2 else "No")


### FIXED CODE ###

S = set(input())
print("Yes" if len(S) == 2 else "No")
a,b=map(int,input())
if a<2*b:
  print(0)
else:
  print(a-2*b)

### FIXED CODE ###

a,b=map(int,input().split())
if a<2*b:
  print(0)
else:
  print(int(a-2*b))
A, op, B = map(input().split())
A = int(A)
B = int(B)

if op == "+":
    print(A + B)
if op == "-":
    print(A - B)

### FIXED CODE ###

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

if op == "+":
    print(A + B)
if op == "-":
    print(A - B)
from functools import lru_cache

L = input().split()
sprime = 998244353 # approx 10**9
N = int(L[0])
A = int(L[1])
B = int(L[2])
K = int(L[3])

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

@lru_cache(maxsize=N)
def factorial(m):
	a = 1
	for i in range(1,m):
		a = (a*i) % sprime

def binom(m):
	if N == m:
		return 1
	elif m == 1:
		return N
	elif m > N:
		return 0
	else:
		return (factorial(N) * modinv(factorial(m),sprime) * modinv(factorial(N-m),sprime)) % sprime

# max is A*N + B*N
sum = 0
for i in range(0,N):
	if (K - A*i) % B == 0:
		j = (K-A*i)//B
		sum += (binom(N,i) * binom(N,j)) % sp

print(sum)



### 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)