Harryxun/stf_run huggingface dataset:
import sys
x, n = map(int, input().split())

if n > 0:
    p_list = [int(i) for i in input().split()]
else:
    print(x)
    sys.exit(0)

table = {i for i in range(101)}
table = table - set(p_list)
diff = 0
d_min = 100

for i in table:
    diff = abs(x - i)
    if d_min > diff:
        d_min = diff
    else:
        break
    pre_i = i

print(pre_i)


### FIXED CODE ###

x, n = map(int, input().split())
p = [int(i) for i in input().split()]

min = 1000
pre_i = 0
for i in range(102):
    if i in p:
        continue
    if min > abs(x - i):
        min = abs(x - i)
    else:
        break
    pre_i = i

print(pre_i)
import sys
from itertools import accumulate
from numba import njit

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

@njit(cache=True)
def solve(n, k, a):
    if n == 0:
        return
    for _ in range(k):
        b = [0]*n
        for i in range(n):
            if i > a[i]:
                b[i-a[i]] += 1
            else:
                b[0] += 1
            if i + a[i] + 1 < n:
                b[i + a[i] + 1] -= 1
        a = list(accumulate(b))
        if min(a) >= n:
            break
    print(*a)
    return

solve(0, 0, 0)
n, k = nm()
a = nl()
solve(n, k, a)


### FIXED CODE ###

import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
    n, k = nm()
    if k > 45:
        k = 45
    a = nl()
    b = [0]*n
    for _ in range(k):
        for i in range(n):
            b[max(0, i - a[i])] += 1
            if i + a[i] + 1 < n:
                b[i + a[i] + 1] -= 1
        for i in range(n-1):
            b[i+1] += b[i]
            a[i] = 0
        a[-1] = 0
        b, a = a, b
    print(*a)
    return

solve()
a,b,v,w,t = map(int,input().split())

d = abs(b-a)
p = abs(wt-vt)

if p>=d:
  print("YES")
else:
  print("NO")


### FIXED CODE ###

a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if v <= w:
    print('NO')
else:
    if 1 <= (abs(b - a) / (v - w)) <= t:
        print('YES')
    else:
        print('NO')
# https://atcoder.jp/contests/abc150/tasks/abc150_b
import sys
def read_int(): return int(input())
def read_str(): return input().strip()
def read_str_n(): return list(map(str, input().split()))

def error_print(*args): print(*args, file=sys.stderr)
def mt(f):
    import time
 
    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()
 
        error_print(e - s, 'sec')
        return ret
 
    return wrap



__DEBUG__ = False

if __DEBUG__:
    N = 33
    S = list('ABCCABCBABCCABACBCBBABCBCBCBCABCB')
else:
    N = read_int()
    # print(f"N = {N}")
    S = list(read_str())
    # print(f"S = {S}")
    

@mt
def solution():
    count = 0    
    for i in range(N-2):
        if __DEBUG__: print(f"checking {S[i]} at index: {i}")
        if S[i] == 'A':
            if S[i+1] == 'B' and S[i+2] == 'C':
                count += 1
                continue
    return count

    
if __name__ == '__main__':
    solution()

### FIXED CODE ###

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


count = 0    
for i in range(N-2):
  if S[i] == 'A':
    if S[i+1] == 'B' and S[i+2] == 'C':
      count += 1
    
print(count)
S = input()
if(S[3] == S[4] and S[5] == S[6]):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input()
if(S[2] == S[3] and S[4] == S[5]):
  print("Yes")
else:
  print("No")
# Aizu Problem 0261: Mayan Crucial Prediction

import sys, math, os, datetime

# read input:
PYDEV = os.environ.get('PYDEV')
#if PYDEV=="True":
sys.stdin = open("sample-input.txt", "rt")

dpm = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] # day per month

 
def get_day(year, month, day):
    if month <= 2:
        year -= 1
        month += 12
    dy = 365 * (year - 1)
    c = year // 100
    dl = (year >> 2) - c + (c >> 2)
    dm = (month * 979 - 1033) >> 5
    return dy + dl + dm + day - 1

offset = get_day(2012, 12, 21)
maya= [144000, 7200, 360, 20, 1]
    
while True:
    inp = input().strip()
    if inp == "#":
        break
    inp = [int(_) for _ in inp.split('.')]
    if len(inp) == 3:
        # christian to mayan:
        n = (get_day(inp[0], inp[1], inp[2]) - offset) % 1872000
        out = ""
        for k in range(4):
            out += str(n // maya[k]) + '.'
            n %= maya[k]
        out += str(n)
        print(out)
    else:
        # mayan to christian:
        n = sum([maya[k] * inp[k] for k in range(5)])
        date = datetime.date.fromordinal(offset + n + 1)        
        print(str(date.year) + "." + str(date.month) + "." + str(date.day))

### FIXED CODE ###

#-*- coding: utf-8 _*_
import datetime
 
def is_leap(y):
    if y%400==0:   return True
    if y%100==0:   return False
    if y%4==0:     return True
    return False
 
def get_day(y,m,d):
    if m<=2:
        y-=1
        m+=12
    dy = 365*(y-1)
    c = y/100
    dl=(y>>2)-c+(c>>2)
    dm=(m*979-1033)>>5
    return dy+dl+dm+d-1
 
def solve(line):
    ipt = map(int, line.split("."))
#     print ipt
    if len(ipt) >3:
        n=0
        for i in range(5):  n+=ipt[i]*mm[i]
        date = datetime.date.fromordinal(offset+n+1)
        print str(date.year)+"."+str(date.month)+"."+str(date.day)
    else:
        n=get_day(*ipt)-offset
#         print n
        n%=1872000
        ret=""
        for i in range(4):
            ret+=str(n/mm[i])+"."
            n%=mm[i]
        ret+=str(n)
        print ret
 
if __name__=='__main__':
    # const
    mm=(144000,7200,360,20,1)
    w1=(0,0,31,59,90,120,151,181,212,243,273,304,334,365)
    w2=(0,0,31,60,91,121,152,182,213,244,274,305,335,366)
    offset = get_day(2012,12,21)
#     print datetime.MAXYEAR
     
    while True:
        line=raw_input()
        if line=="#":   exit()
        solve(line)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
from numba import njit

@njit('i4[:]')
def solve(S):
    dp = np.zeros(2019, np.int64)
    pow10 = 1
    answer = 0
    for x in S[::-1]:
        dp[0] += 1
        x = x * pow10 % 2019
        newdp = np.zeros_like(dp)
        newdp[x:] += dp[:-x]
        newdp[:x] += dp[-x:]
        answer += newdp[0]
        pow10 *= 10
        pow10 %= 2019
        dp = newdp
    return answer


S = np.array(list(read().rstrip()), dtype=np.int32) - ord('0')
print(solve(S))


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
from numba import njit

@njit('(i4[:],)')
def solve(S):
    dp = np.zeros(2019, np.int64)
    pow10 = 1
    answer = 0
    for x in S[::-1]:
        dp[0] += 1
        x = x * pow10 % 2019
        newdp = np.zeros_like(dp)
        newdp[x:] += dp[:-x]
        newdp[:x] += dp[-x:]
        answer += newdp[0]
        pow10 *= 10
        pow10 %= 2019
        dp = newdp
    return answer


S = np.array(list(read().rstrip()), dtype=np.int32) - ord('0')
print(solve(S))
from sys import stdin
input = stdin.readline

def main():
    N = int(input())
    A = list(map(int,input().split()))
    Q = int(input())
    BC = [list(map(int, input().split())) for _ in range(Q)]

    d = dict()

    # dictに格納 O(1)
    for a in A:
        try:
            d[a] += 1
        except KeyError:
            d[a] = 1
    
    ans = 0

    # 一旦ans出す
    for dat in d.items():
        ans += dat[0]*dat[1]

    # B,Cの操作
    for bc in BC:
        try:
            d[bc[1]] += d[bc[0]]
        except KeyError:
            try:
                d[bc[1]] = d[bc[0]]
            except KeyError:
                d[bc[1]] = 0
        finally:
        # 増減分だけ変更
            ans += bc[1]*d[bc[0]] - bc[0]*d[bc[0]]
            d[bc[0]] = 0
        print(ans)

main()

### FIXED CODE ###

from sys import stdin
input = stdin.readline

def main():
    N = int(input())
    A = list(map(int,input().split()))
    Q = int(input())
    BC = [list(map(int, input().split())) for _ in range(Q)]

    d = dict()

    # dictに格納 O(1)
    for a in A:
        try:
            d[a] += 1
        except KeyError:
            d[a] = 1
    
    ans = 100000000000000000000000000
    ans = 0

    # 一旦ans出す
    for dat in d.items():
        ans += dat[0]*dat[1]

    # B,Cの操作
    # for bc in BC:
    #     try:
    #         d[bc[1]] += d[bc[0]]
    #     except KeyError:
    #         try:
    #             d[bc[1]] = d[bc[0]]
    #         except KeyError:
    #             d[bc[0]] = 0
    #             d[bc[1]] = 0
    #     finally:
    #     # 増減分だけ変更
    #         ans += bc[1]*d[bc[0]] - bc[0]*d[bc[0]]
    #         d[bc[0]] = 0
    #     print(ans)

    # B,Cの操作
    for bc in BC:
        if bc[0] in d:
            if bc[1] in d:
                d[bc[1]] += d[bc[0]]
                ans += bc[1]*d[bc[0]] - bc[0]*d[bc[0]]
                d[bc[0]] = 0
            else:
                d[bc[1]] = d[bc[0]]
                ans += bc[1]*d[bc[0]] - bc[0]*d[bc[0]]
                d[bc[0]] = 0
        else:
            pass
        print(ans)



if __name__ == "__main__":
    main()
a = input()
b = input()
if a * b % 2:
  return "Yes"
return "No"

### FIXED CODE ###

numbers = input()
num_a = int(numbers.split()[0])
num_b = int(numbers.split()[1])
if (num_a * num_b) % 2 == 0:
  print("No")
else:
  print("Yes")
N = int(input())
P = list(map(int, input().split()))
ret = N
for i in range(len(P)):
  if min(P[:i+1]) != P[i]:
    ret = i + 1
  	break
print(ret)

### FIXED CODE ###

N = int(input())
P = list(map(int, input().split()))
ret = 0
minval = 0
for i in range(len(P)):
  if i == 0:
    minval = P[i]
  if minval >= P[i]:
    ret += 1
    minval = P[i]
print(ret)
n,m = map(int,input().split())
a = [[1,int(i)] for i in input().split()]
bc = [[int(i) for i in input().split()] for j in range(m)]
x = a+bc
x.sort(key=lambda y:y[1])
total = 0
ans = 0
for i in reversed(range(n+m)):
    if total >= n:
        break
    else:
        ans += x[1][i]*min(n-total,x[0][i])
        total += x[0][i]
print(ans)

### FIXED CODE ###

n,m = map(int,input().split())
a = [[1,int(i)] for i in input().split()]
bc = [[int(i) for i in input().split()] for j in range(m)]
x = a+bc
x.sort(key=lambda y:y[1])
total = 0
ans = 0
for i in reversed(range(n+m)):
    if total >= n:
        break
    else:
        ans += x[i][1]*min(n-total,x[i][0])
        total += x[i][0]
print(ans)
from collections import deque
import sys
n = int(input())
if n == 1:
    print('a')
    sys.exit()

q = deque([])
q.append((1, 'a', 1))
cur = 1
while cur != n:
    num = len(q)
    j = 0
    while j < num:
        a, b, c = q.popleft()
        for i in range(1, c+2):
            q.append((i, b + chr(96+i), max(map(int, list(b + chr(96+i)))))
        j += 1
    cur += 1

for i in range(len(q)):
    a, b, c = q.popleft()
    print(b)



### FIXED CODE ###

from collections import deque
import sys
n = int(input())
if n == 1:
    print('a')
    sys.exit()

q = deque([])
q.append((1, 'a', '1'))
cur = 1
while cur != n:
    num = len(q)
    j = 0
    while j < num:
        a, b, c = q.popleft()
        for i in range(1, max(map(int, list(c)))+2):
            q.append((i, b + chr(96+i), c + str(i)))
        j += 1
    cur += 1

for i in range(len(q)):
    a, b, c = q.popleft()
    print(b)
import numpy as np

N, Q = map(int, input().split())
S = input()
ac_array = np.zeros(N)
ans = []

for i in range(N):
    if S[i] == 'A' and S[i+1] == 'C':
        ac_array[i] += 1
        ac_array[i+1] += 1
#print(ac_array)
q_list = np.zeros([Q, 2])
for q in range(Q):
    q_list[q, 0], q_list[q, 1] = map(int, input().split())
    ans.append(np.trunc(ac_array[int(q_list[q, 0]-1):int(q_list[q,1])].sum()/2))

for a in range(Q):
    print(int(ans[a]))

### FIXED CODE ###

N, Q = map(int, input().split())
S = input()
t = [0] * (N+1)
ans = []

for i in range(N):
    t[i+1] += t[i] + ( 1 if S[i:i+2] == 'AC' else 0) 

for i in range(Q):
    l, r = map(int, input().split())
    ans.append(t[r-1] - t[l-1])
    
for i in range(Q):
    print(ans[i])
#-*- coding:utf-8 -*-

if __name__ == "__main__":
	A, B, C = list(map(int, input.split()))
	if A+B >= C:
		print("Yes")
	else:
		print("No")


### FIXED CODE ###

#-*- coding:utf-8 -*-

if __name__ == "__main__":
	A, B, C = list(map(int, input().split()))
	if A+B >= C:
		print("Yes")
	else:
		print("No")
s = input()
t = input()
lent = len(t)
tcount = 0
snow = 0
count = 0
flag = True
while True:
    snow = s.index(t[tcount])
    tcount += 1
    if tcount == lent:
        break
    if t[tcount] not in s:
        flag = False
        break
    if t[tcount] in s[snow+1:]:
        snow = s[snow+1:].index(t[tcount])
    else:
        snow = s.index(t[tcount])
        count += 1
if flag:
    print(count*len(s) + s.index(t[-1])+1)
else:
    print(-1)

### FIXED CODE ###

s = input()
t = input()
lent = len(t)
tcount = 0
snow = 0
count = 0
flag = True
if t[0] not in s:
    print(-1)
else:
    snow = s.index(t[0])
    while True:
        tcount += 1
        if tcount == lent:
            break
        if t[tcount] in s[snow+1:]:
            snow = s[snow+1:].index(t[tcount])+snow+1
        elif t[tcount] in s:
            snow = s.index(t[tcount])
            count += 1
        else:
            flag = False
            break
    if flag:
        print(count*len(s) + snow+1)
    else:
        print(-1)
from collections import deque

n, m = map(int, input().split())
graph = [[] for _ in range(n)]
edge = []
for i in range(m):
    l, r, d = map(int, input().split())
    l -= 1
    r -= 1
    graph[r].append((l, i))
    graph[l].append((r, i))
    edge.append(d)

check_v = [False for _ in range(n)]
check_e = [False for _ in range(n)]
max_int = 10 * 10
point = [max_int for _ in range(n)]

for v in range(n):
    Q = deque()
    Q.append(v)
    while Q:
        v = Q.popleft()
        if not check_v[v]:
            for next_v, e in graph[v]:
                if not check_e[e]:
                    if point[v] == max_int:
                        point[v] = 0
                    if point[next_v] == max_int:
                        point[next_v] = point[v] + edge[e]
                    else:
                        if point[next_v] != point[v] + edge[e]:
                            print('No')
                            exit()
                check_e[e] = True
                if not check_v[next_v]:
                    Q.append(next_v)
            check_v[v] = True
print('Yes')

### FIXED CODE ###

from collections import deque

n, m = map(int, input().split())
graph = [[] for _ in range(n)]
for i in range(m):
    l, r, d = map(int, input().split())
    l -= 1
    r -= 1
    graph[r].append((l, r, -d))
    graph[l].append((r, l, d))

max_int = 10 ** 10
point = [None for _ in range(n)]

for v in range(n):
    Q = deque()
    if point[v] is not None:
        continue
    Q.extend(graph[v])
    while Q:
        next_v, v, d = Q.popleft()
        if point[v] is None:
            point[v] = 0
        if point[next_v] is not None:
            if point[next_v] != point[v] + d:
                print('No')
                exit()
            else:
                continue
        point[next_v] = point[v] + d
        Q.extend(graph[next_v])
print('Yes')
N=int(input())
S=input()
s=list(S)

total=0
for i in range(N):
    if s[i]=="A":
        if s[i+1]=="B":
            if s[i+2]=="C":
                total=total+1
print(total)

### FIXED CODE ###

N=int(input())
S=input()
s=list(S)

total=0
for i in range(N-2):
    if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
        total=total+1
print(total)
import math
def yo(a,b,th):
    thr = math.radians(th)
    cosa = math.cos(thr)
    kk = 4.56425719433005567605
    ttt = (a**2 + b**2 - kk**2) / (2*a*b)
    acosa = math.acos(ttt)
    ttt = math.degrees(acosa)
    tmp = float(a**2) + float(b**2) - float(2*b*a*cosa)
    re = float(math.sqrt(tmp))
    return re
A,B,h,m = map(int, input().split())
longdig = ((h*60+m)%360) * 6
shortdig = (h*60+m) * 0.5
theta = abs(longdig - shortdig)
print(yo(A,B,theta))

### FIXED CODE ###

import math
def yo(a,b,th):
    thr = math.radians(th)
    cosa = math.cos(thr)
    tmp = float(a**2) + float(b**2) - float(2*b*a*cosa)
    re = float(math.sqrt(tmp))
    return re
A,B,h,m = map(int, input().split())
longdig = m * 6
shortdig = (h*60+m) * 0.5
theta = abs(longdig - shortdig)
print(yo(A,B,theta))
print("ABC"+str(input())

### FIXED CODE ###

print("ABC"+input())
#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define PI 3.141592653589793
#define MOD 1000000007

typedef long long ll;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int a,b,k;
    cin >> a >> b >> k;

    for(int i = a; i < min(a+k, b+1); ++i) cout << i << endl;
    for(int i = max(b-k+1, a+k); i <= b; ++i) cout << i << endl;

    return 0;
}

### FIXED CODE ###

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

for i in range(a, min(a+k, b+1)):
    print(i)

for i in range(max(b-k+1, a+k), b+1):
    print(i)
n = int(input())
l = [list(map(int,input().split())) for i in range(n)]
v = n*(n-1)//2
E = [[] for i in range(v)]
dic = {}
c = 0
for i in range(n):
    for j in range(n-1):
        a,b = i,l[i][j]-1
        if a > b:
            a,b = b,a
        if (a,b) in dic:
            l[i][j] = dic[(a,b)]
        else:
            dic[(a,b)] = c
            l[i][j] = dic[(a,b)]
            c += 1
    for j in range(n-2):
        E[l[i][j]].append(l[i][j+1])

def dfs(i):
    if visit[i]:
        if dis[i] == -1:
            return -1
        else:
            return dis[i]
    visit[i] = True
    d = 1
    for nex in E[i]:
        res = dfs(nex)
        if res == -1:
            return -1
        d = max(d,res+1)

    dis[i] = d
    return d
ans = 0
done = []
for i in range(n):
    if l[i][0] in done:
        continue
    visit = [False]*v
    dis = [-1]*v
    count = dfs(l[i][0])
    if count == -1:
        print(-1)
        exit()
    else:
        ans = max(ans,count)
    done.append(l[i][0])
print(ans)


### FIXED CODE ###

def main():
    import sys
    sys.setrecursionlimit(10**7)
    input = sys.stdin.readline
    n = int(input())
    l = [list(map(int,input().split())) for i in range(n)]
    ans = 1
    count = [0]*n
    check = set()
    game = []
    for i in range(n):
        if count[i] >= n-1 or i in check:
            continue
        ind = l[i][count[i]]-1
        if ind in check:
            continue
        if l[ind].index(i+1) == count[ind]:
            check |= set([i,ind])
            game.append([i,ind])
            count[i] += 1
            count[ind] += 1
    while True:
        gamepre = game
        check = set()
        game = []
        for i,j in gamepre:
            ci = True
            cj = True
            if count[i] >= n-1 or i in check:
                ci = False
            if count[j] >= n-1 or j in check:
                cj = False
            if ci:
                ci = True
                ind = l[i][count[i]]-1
                if ind in check:
                    ci = False
                if ci and l[ind].index(i+1) == count[ind]:
                    check |= set([i,ind])
                    game.append([i,ind])
                    count[i] += 1
                    count[ind] += 1
            if cj:
                cj = True
                ind = l[j][count[j]]-1
                if ind in check:
                    cj = False
                if cj and l[ind].index(j+1) == count[ind]:
                    check |= set([j,ind])
                    game.append([j,ind])
                    count[j] += 1
                    count[ind] += 1
        if not check:
            if sum(count) != n*(n-1):
                print(-1)
                exit()
            else:
                print(ans)
                exit()
        ans += 1
if __name__ == "__main__":
    main()
def main():
    i = list(map(int, input().split()))
    a = i[0]
    b = i[1]
    c = i[2]
    d = i[3]

    if not (0 <= a and a < b and b <= 100 and 0 <= c and c < d and d <= 100):
        return

    alice = b - a
    bob = d -c

    if(b <= c or c < b):
        print(0)
    elif(c < b and b < d):
        print(b - c)
    elif(a < c and d < b):
        print(d - c)
    elif(a < d and d < b):
        print(d - a)
    elif(c < a and b < d):
        print(b - a)


if __name__ == "__main__":
    main(

### FIXED CODE ###

def main():
    i = list(map(int, input().split()))
    a = i[0]
    b = i[1]
    c = i[2]
    d = i[3]

    if not (0 <= a and a < b and b <= 100 and 0 <= c and c < d and d <= 100):
        return
    if not (isinstance(a, int) and isinstance(b, int) and isinstance(c, int) and isinstance(d, int)):
        return
    
    if(b <= c or d <= a):
        print(0)
    elif(a <= c and c < b and b <= d):
        print(b - c)
    elif(c <= a and a < d and d <= b):
        print(d - a)
    elif(a <= c and d <= b):
        print(d - c)
    elif(c <= a and b <= d):
        print(b - a)


if __name__ == "__main__":
    main()
n = int(input())
lis = list(map(int, input()split(" ")))
big_num = 1000000
max_num, min_num, sum = -1*big_num, big_num, 0
for i in lis:
    if i > max_num:
        max_num = i
    if i < min_num:
        min_num = i
    sum += i
print("%d %d %d" % (min_num, max_num, sum))


### FIXED CODE ###

n = int(input())
lis = list(map(int, input().split(" ")))
big_num = 1000000
max_num, min_num, sum = -1*big_num, big_num, 0
for i in lis:
    if i > max_num:
        max_num = i
    if i < min_num:
        min_num = i
    sum += i
print("%d %d %d" % (min_num, max_num, sum))
S = input()
T = input()
if s in T*2:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

S = input()
T = input()
if S in T*2:
    print("Yes")
else:
    print("No")
A,B,C = map(int,input().split())
if C-(a-B)=>0:
    print(C-(A-B))
else:
    print(0)

### FIXED CODE ###

A,B,C = map(int,input().split())
if C-(A-B)>=0:
    print(C-(A-B))
else:
    print(0)
5
1 1 1 1 1

### FIXED CODE ###

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

A.sort()

B = [0 for _ in range(N)]
b = 0
for i in range(N):
    b += A[i]
    B[i] = b

ans = 1
for i in range(N-1):
    if 2*B[i]>=A[i+1]:
        ans += 1
    else:
        ans = 1
        
print(ans)
import sys
n,m=map(int,input().split())
MOD = 10**9+7
ans=1
def inv_mod(a, p=MOD):
    def inv_mod_sub(a, p):
        if a == 1:
            return 1, 0
        else:
            d, r = p//a, p%a
            x, y = inv_mod_sub(r, a)
            return y-d*x, x
    if p < 0: p = -p
    a %= p
    return inv_mod_sub(a,p)[0] % p

def comb_mod(n, k):
    if k < 0 or k > n:
        return 0
    else:
        return f_mod[n]*f_mod_inverse[k]*f_mod_inverse[n-k] % MOD
pf={}
for i in range(2,int(m**0.5)+1):
    while m%i==0:
        pf[i]=pf.get(i,0)+1
        m//=i
if m>1:pf[m]=1
if m==1
print(1)
sys.exit()
Max=max(list(pf.values()))
f_mod=[1]*(Max+n+1)
f_mod_inverse=[1]*(Max+n+1)
for i in range(1,Max+n+1):
  f_mod[i]=(f_mod[i-1]*i)%MOD
  f_mod_inverse[i]=(f_mod_inverse[i-1]*inv_mod(i)) % MOD  
for i in pf.values():
  ans*=comb_mod(i+n-1,n-1)
print(ans%MOD)


### FIXED CODE ###

import sys
n,m=map(int,input().split())
MOD = 10**9+7
ans=1
if m==1:
  print(1)
  sys.exit()
def inv_mod(a, p=MOD):
    def inv_mod_sub(a, p):
        if a == 1:
            return 1, 0
        else:
            d, r = p//a, p%a
            x, y = inv_mod_sub(r, a)
            return y-d*x, x
    if p < 0: p = -p
    a %= p
    return inv_mod_sub(a,p)[0] % p

def comb_mod(n, k):
    if k < 0 or k > n:
        return 0
    else:
        return f_mod[n]*f_mod_inverse[k]*f_mod_inverse[n-k] % MOD
pf={}
for i in range(2,int(m**0.5)+1):
    while m%i==0:
        pf[i]=pf.get(i,0)+1
        m//=i
if m>1:pf[m]=1
Max=max(list(pf.values()))
f_mod=[1]*(Max+n+1)
f_mod_inverse=[1]*(Max+n+1)
for i in range(1,Max+n+1):
  f_mod[i]=(f_mod[i-1]*i)%MOD
  f_mod_inverse[i]=(f_mod_inverse[i-1]*inv_mod(i)) % MOD  
for i in pf.values():
  ans*=comb_mod(i+n-1,n-1)
print(ans%MOD)