Harryxun/stf_run huggingface dataset:
n,x = map(int, input().split())
l = [0] + list(map(int, input().split()))
d = 0
i = 0
while d <= x and n+2 > i:
  d += l[i]
  i += 1
if n+2 <= i:
  print(n+1)
else:
  print(i-1)

### FIXED CODE ###

n,x = map(int, input().split())
l = [0] + list(map(int, input().split()))
d = 0
i = 0
c = 0
while d <= x:
  d += l[i]
  i += 1
  if n+1 == i and d <= x:
    c = 1
    break
if c == 1:
  print(n+1)
else:
  print(i-1)
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    S = [int(s) for s in input().split()]
    S.sort()

    result = []
    result.append(S.pop(-1))



    for i in range(N):
        x = 1
        for j in range(2**i):
            while(True):
                if x>2**i:
                    break
                if result[j]>S[-1*x]:
                    result.append(S.pop(-1*x))
                    break
                else:
                    x += 1
            if x>2**i:
                print("No")
                break
        else:
            continue
        break
    else:
        print("Yes")

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys

def I(): return(int(sys.stdin.readline()))
def LI(): return([int(x) for x in sys.stdin.readline().split()])


def main():
    N = I()
    S = sorted(LI(),reverse=True)

    flag = [True]*len(S)

    cur = []
    cur.append(S[0])
    flag[0] = False

    for i in range(N):
        nxt = [x for x in cur]
        j = 0

        for k in range(len(S)):
            if j >= len(cur):
                break
            elif flag[k] and S[k]<cur[j]:
                nxt.append(S[k])
                j+=1
                flag[k] = False
        if len(cur) != j:
            return("No")
        cur = sorted(nxt,reverse=True)
    return("Yes")

if __name__ == "__main__":
    print(main())
n,x=map(int, input().split())
if x==1 or x==2*n+1:print('No')
else:
    print('Yes')
    a=list(range(1,2*n))
    b=[]
    b.append(a.pop(x))
    b.append(a.pop(x-1))
    b.append(a.pop(x-2))
    for i in a[:n-2]+b+a[n-2:]:
        print(i)

### FIXED CODE ###

n,x=map(int, input().split())
if x==1 or x==2*n-1:print('No')
else:
    print('Yes')
    a=list(range(1,2*n))
    b=[]
    b.append(a.pop(x))
    b.append(a.pop(x-1))
    b.append(a.pop(x-2))
    for i in a[:n-2]+b+a[n-2:]:
        print(i)
import sys

readline = sys.stdin.buffer.readline


def main():
    N = int(readline())
    P = list(map(int, readline().split()))
    P = list(map(lambda x: x-1, P))

    cnt = 0
    for i in range(0, N):
        if P[i] == i:
            if P[i+1] == i+1 and i != N-1:
                P[i], P[i+1] = P[i+1], P[i]
                cnt += 1
            elif i != 0:
                P[i], P[i-1] = P[i-1], P[i]
                cnt += 1
            else:
                cnt += 1

    print(cnt)


main()


### FIXED CODE ###

import sys

readline = sys.stdin.buffer.readline


def main():
    N = int(readline())
    P = list(map(int, readline().split()))
    P = list(map(lambda x: x-1, P))

    cnt = 0
    for i in range(0, N):
        if i == N-1:
            if P[i] == i:
                P[i], P[i-1] = P[i-1], P[i]
                cnt += 1
        elif P[i] == i:
            if P[i+1] == i+1 and i != N-1:
                P[i], P[i+1] = P[i+1], P[i]
                cnt += 1
            elif i != 0:
                P[i], P[i-1] = P[i-1], P[i]
                cnt += 1
            else:
                P[i], P[i+1] = P[i+1], P[i]
                cnt += 1

    print(cnt)


main()
def f(x):
    p=0
    cnt=0
    for i in range(n-1,-1,-1):
        while p<n and a[i]+a[p]<x:
            p+=1
        cnt+=n-p
    return cnt

n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()

l,r=a[0]*2,a[n-1]*2

while r-l>0:
    if r-l<=1: md=l;break
    md=int((r+l)//2)
    k=f(md)
    if k==m: break
    elif k>m: l=md
    else: r=md

p=0
cnt=0
ans=0
for i in range(n-1,-1,-1):
    while p<n and a[i]+a[p]<=md:
        p+=1
    cnt+=n-p
    ans+=a[i]*(n-p)*2


ans+=(m-cnt)*md
print(ans)

### FIXED CODE ###

import sys

def f(x):
    p=0
    cnt=0
    for i in range(n-1,-1,-1):
        while p<n and a[i]+a[p]<x:
            p+=1
        cnt+=n-p
    return cnt

n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()

l,r=a[0]*2,a[n-1]*2
md=(r+l)//2
while r-l>0:
    if r-l<=1:
        if f(r)==m: md=r;break 
        else: md=l;break
    md=(r+l)//2
    k=f(md)
    if k==m: break
    elif k>m: l=md
    else: r=md

p=0
cnt=0
ans=0

for q in range(n-1,-1,-1):
    try:
        while p<n and a[q]+a[p]<=md:
            p+=1
    except:
        b=1
        while True:
            b+=1

    if p==n: break
    cnt+=n-p
    ans+=a[q]*(n-p)*2


ans+=(m-cnt)*md
print(ans)
n_str = raw_input()
n = int(n_str)
total = sum(map(int, list(n_str)))
if n % total == 0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n_str = raw_input()
n = int(n_str)
total = sum(map(int, list(n_str)))
if n % total == 0:
    print('Yes')
else:
    print('No')
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
      
N, M = map(int,input().split())
uf = UnionFind(N)
for _ in range(M):
  a,b = map(int,input().split())
  uf.union(a,b)
  
print(uf.group_count() - 1)

### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
      
N, M = map(int,input().split())
uf = UnionFind(N)
for _ in range(M):
  a,b = map(int,input().split())
  uf.union(a-1,b-1)
  
print(uf.group_count() - 1)
S = input()

def solve(s):
    for i in range(len(s) // 2 + 1):
        if s[i] != s[- i - 1]:
            return False
    
    return True

if solve(S) and solve(S[:(len(S) - 1) // 2]) and solve(S[(len(S) + 3) // 2 + 1:]):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

S = input()

def solve(string): return True if string == string[::-1] else False

if solve(S) and solve(S[:round((len(S) - 1) / 2)]) and solve(S[round((len(S) + 3) / 2) - 1:]):
    print("Yes")
else:
    print("No")
#include<bits/stdc++.h>
	using namespace std;
	using ll = long long;
	#define forn(i,n) for(int i = 0; i< n;++i)
	int INF = 1e9 + 7;
	ll MOD = 998244353;


	int main(){
		ios_base::sync_with_stdio(false);
		cin.tie(NULL);
		int a,b,c,d;
		cin >> a >> b >> c >> d;

		vector<vector<ll>> dp(c+10,vector<ll>(d+10,0));
		
		for(int i = a; i <= c; ++i){
			for(int j = b; j <= d; ++j){
				if(i == a && j == b){
					dp[i][j] = 1;
					continue;
				}
				dp[i][j] = dp[i-1][j]*j + dp[i][j-1]*i - dp[i-1][j-1]*(i-1)*(j-1);
				//dp[i][j] %= MOD;
				dp[i][j] = (MOD + dp[i][j] % MOD) % MOD;
			}
		}
		cout << dp[c][d] << endl;
				
	}


### FIXED CODE ###

a,b,c,d = [int(x) for x in input().split()]
MOD = 998244353
dp = [[0 for i in range(d+10)] for j in range(c+10)]

for i in range(a,c+1):
    for j in range(b,d+1):
        # print(str(i) +'  '+str(j))
        if i == a and j == b:
            dp[i][j] = 1
            continue
        dp[i][j] = dp[i-1][j]*j + dp[i][j-1]*i - dp[i-1][j-1]*(i-1)*(j-1)
        dp[i][j] %= MOD
print(dp[c][d])
from math import pi
k = int(input())
print(pi*k**2,pi*k*2)


### FIXED CODE ###

from math import pi
k = float(input())
print(pi*k**2,pi*k*2)
import numpy as np

N, K = (int(i) for i in input().split())
x = np.sort(np.array([int(i) for i in input().split()]))

result = []
if(N==1):
    print(x[0])
    exit()
else:
    for i in range(N - K):
        left = x[i]
        right = x[i + K - 1]

        if (left * right < 0):
            if (np.abs(left) < np.abs(right)):
                diff = np.abs(left) * 2 + np.abs(right)
            else:
                diff = np.abs(left) + np.abs(right) * 2

        else:
            diff = np.max([left, right])

        result.append(diff)

print(np.min(result))


### FIXED CODE ###

import numpy as np

N, K = (int(i) for i in input().split())
x = np.sort(np.array([int(i) for i in input().split()]))

result = []
if(N==1):
    print(np.abs(x[0]))

else:
    for i in range(N - K + 1):
        left = x[i]
        right = x[i + K - 1]

        if (left * right < 0):
            if (np.abs(left) < np.abs(right)):
                diff = np.abs(left) * 2 + np.abs(right)
            else:
                diff = np.abs(left) + np.abs(right) * 2

        else:
            diff = np.max([np.abs(left), np.abs(right)])

        result.append(diff)

    print(np.min(result))
def func2(l, value):
    i = -1
    c = len(l)
    result = []
    while i < c:
        try:
            i = l.index(value, i + 1)
            result.append(i)
        except:
            return result
    return result

T=list(input())
que_list=(func2(T,"?"))
T_now= T
ans_T = ''.join(T)
count = 0 
N=T.count("?")
for i in range(2 ** N):
    op = ["P"] * N
    for j in range(N):
        if ((i >> j) & 1):
            op[N - 1 - j] = "D"
    for k,que_index in zip(op,que_list):
        T[que_index]=k
        test_T=''.join(T)
    check_value=test_T.count("D")+test_T.count("DP")
    if(count < check_value):
        ans_T = test_T
        count = check_value
    T=T_now
print(''.join(ans_T))


### FIXED CODE ###

def func2(l, value):
    i = -1
    c = len(l)
    result = []
    while i < c:
        try:
            i = l.index(value, i + 1)
            result.append(i)
        except:
            return result
    return result

T=list(input())
que_list=(func2(T,"?"))
for i in que_list:
    T[i]='D'
print(''.join(T))
i = input().split(" ")
mul = i[0]*i[1]
if mul < 81:
  print(mul)
else:
  print(-1)


### FIXED CODE ###

a,b=map(int,input().split())
if a>9 or b>9:print(-1)
else:print(a*b)
import math

mod = 1000000007
n = int(input())
zero = 0
dic = {}
dic[(0, 1.5)] = 0
dic[(1.5, 0)] = 0
for i in range(n):
    ai, bi = map(int, input().split())
    if ai < 0:
        ai, bi = -ai, -bi
    g = math.gcd(abs(ai), abs(bi))
    ai = ai // g
    bi = bi // g
    idx = (ai, bi)
    if idx == (0, 0):
        zero += 1
    elif idx[0] == 0:
        dic[(0, 1.5)] += 1
    elif idx[1] == 0:
        dic[(1.5, 0)] += 1
    else:
        if idx in dic:
            dic[idx] += 1
        else:
            dic[idx] = 1

ans = 1
already = set([])
for key, value in dic.items():
    if key in already: continue
    a, b = key
    if a == 1.5 or b == 1.5:
        pair1 = dic[(0, 1.5)]
        pair2 = dic[(1.5, 0)]
        ans = (ans * (pow(2, pair1, mod)+pow(2, pair2, mod)-1)) % mod
        already.add((0, 1.5))
        already.add((1.5, 0))
    else:
        if b > 0: idx = (b, -a)
        else: idx = (-b, a)
        if idx in dic:
            pair1 = dic[key]
            pair2 = dic[idx]
            ans = (ans * (pow(2, pair1, mod)+pow(2, pair2, mod)-1)) % mod
            already.add(key)
            already.add(idx)
        else:
            pair1 = dic[key]
            ans = (ans * pow(2, pair1, mod)) % mod
            already.add(key)

ans = ans + zero - 1
print(ans)

### FIXED CODE ###

import math

mod = 1000000007
n = int(input())
zero = 0
dic = {}
dic[(0, 1.5)] = 0
dic[(1.5, 0)] = 0
for i in range(n):
    ai, bi = map(int, input().split())
    idx = (ai, bi)
    if ai < 0:
        ai, bi = -ai, -bi
    if idx == (0, 0):
        zero += 1
    elif idx[0] == 0:
        dic[(0, 1.5)] += 1
    elif idx[1] == 0:
        dic[(1.5, 0)] += 1
    else:
        g = math.gcd(abs(ai), abs(bi))
        ai = ai // g
        bi = bi // g
        idx = (ai, bi)
        if idx in dic:
            dic[idx] += 1
        else:
            dic[idx] = 1

ans = 1
already = set([])
for key, value in dic.items():
    if key in already: continue
    a, b = key
    if a == 1.5 or b == 1.5:
        pair1 = dic[(0, 1.5)]
        pair2 = dic[(1.5, 0)]
        ans = (ans * (pow(2, pair1, mod)+pow(2, pair2, mod)-1)) % mod
        already.add((0, 1.5))
        already.add((1.5, 0))
    else:
        if b > 0: idx = (b, -a)
        else: idx = (-b, a)
        if idx in dic:
            pair1 = dic[key]
            pair2 = dic[idx]
            ans = (ans * (pow(2, pair1, mod)+pow(2, pair2, mod)-1)) % mod
            already.add(key)
            already.add(idx)
        else:
            pair1 = dic[key]
            ans = (ans * pow(2, pair1, mod)) % mod
            already.add(key)

ans = (ans + zero - 1) % mod
print(ans)
import sys
input = sys.stdin.buffer.readline
N,Q = map(int,input().split())

BIT = [0]*(N+1)　#BITを使う

def BIT_query(idx):　#idxまでの合計を返す
    res_sum = 0
    while idx > 0:
        res_sum += BIT[idx]
        idx -= idx&(-idx)
    return res_sum

def BIT_update(idx,x):　#idxにxを足す
    while idx <= N:
        BIT[idx] += x
        idx += idx&(-idx)
    return

c = [0]+list(map(int,input().split()))　#1-indexedで扱う
lastAppeared = [-1]*(N+1)　#その色が最後に現れた位置
ans = [0]*Q　
queries = []
for q in range(Q):
    l,r = map(int,input().split())
    queries.append(r*10**12+l*10**6+q)　#tupleのソートは遅いので6桁区切りでintにする
queries.sort()　#rでソートされる

curR = 0　#右端の位置
for i in range(Q):
    query = queries[i]
    r = query//10**12
    l = (query//10**6)%(10**6)
    q = query % 10**6
    while curR < r:
        curR += 1
        color = c[curR]
        last = lastAppeared[color]　
        if last != -1:
            BIT_update(last,-1) #すでに現れているなら前に現れた位置から-1
        lastAppeared[color] = curR
        BIT_update(curR,1)
    ans[q] = BIT_query(r)-BIT_query(l-1) #クエリを先読みしているのでansに格納
for i in range(Q):
    print(ans[i])

### FIXED CODE ###

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

def BIT_query(idx):
    res_sum = 0
    while idx > 0:
        res_sum += BIT[idx]
        idx -= idx&(-idx)
    return res_sum

def BIT_update(idx,x):
    while idx <= N:
        BIT[idx] += x
        idx += idx&(-idx)
    return

c = [-1]+list(map(int,input().split()))
lastAppeared = [-1]*(N+1)
ans = [0]*Q
queries = []
for q in range(Q):
    l,r = map(int,input().split())
    queries.append((l,r,q))
queries.sort(key = lambda x:x[1])

curR = 0
for i in range(Q):
    l,r,q = queries[i]
    while curR < r:
        curR += 1
        new = c[curR]
        last = lastAppeared[new]
        if last != -1:
            BIT_update(last,-1)
        lastAppeared[new] = curR
        BIT_update(curR,1)
    ans[q] = BIT_query(r)-BIT_query(l-1)
for i in range(Q):
    print(ans[i])
l = map(int, raw_input().split())

x = int(l[0])
a = int(l[1])

if x < a:
    print(0)

elif a <= x:
    print(10)


### FIXED CODE ###

c = input()
l = c.split()

x = int(l[0])
a = int(l[1])

if x < a:
    print(0)

elif a <= x:
    print(10)
n, x = map(int, input().split())
a = sorted([*map(int, input().split())])
ans = 0
for i in a:
	if i <= x:
		ans += 1
		x -= i
	else:
		break
if not x == 0 and ans > 0: ans -= 1
print(ans)

### FIXED CODE ###

n, x = map(int, input().split())
a = sorted(list(map(int, input().split())))
ans, i = 0, 0
while i < (n - 1):
    if x - a[i] >= 0:
        x -= a[i]
        ans += 1
    else:
        break
    i += 1
if x == a[i]:
	ans += 1
print(ans)
N,M= list(map(int, input().split()))
P = [list(map(int,input().split())) for i in range(M)]
Q = list(map(list, set(map(tuple, P))))
C = []
S = []
n = N -1
sum1 = 0

for s in range(len(Q)):
    C.append(Q[s][0])
for t in range(len(Q)):
    S.append(Q[t][1])
D = list(set(C))
if len(D) <len(S) :
    print("-1")
elif N < max(C):
    print("-1")
else:
    if N == 1 and M == 1 and Q[0][1] == 0:
        print("0")

    else:
        for u in range(len(Q)):
            sum1 = sum1 + Q[u][1]*(10 ** (N - Q[u][0]))
        if sum1 >= (10 ** n):
            print(sum1)
        else:
            if D.count(1) >= 1:
                unko = C.index(1)
                if Q[unko][1] == 0:
                    print("-1")
                else:
                    print(sum1 + 10 ** n)
            else:
                print(sum1 + 10 ** n)


### FIXED CODE ###

N,M= list(map(int, input().split()))
P = [list(map(int,input().split())) for i in range(M)]
Q = list(map(list, set(map(tuple, P))))
C = []
S = []
n = N -1
sum1 = 0
 
for s in range(len(Q)):
    C.append(Q[s][0])
for t in range(len(Q)):
    S.append(Q[t][1])
D = list(set(C))
if len(D) <len(S) :
    print("-1")
else:
    if N == 1 and M == 1 and Q[0][1] == 0:
        print("0")
    elif N == 1 and M == 0:
                print("0")
    else:
        for u in range(len(Q)):
            sum1 = sum1 + Q[u][1]*(10 ** (N - Q[u][0]))
        if sum1 >= (10 ** n):
            print(sum1)
        else:
            if D.count(1) >= 1:
                unko = C.index(1)
                if Q[unko][1] == 0:
                    print("-1")
                else:
                    print(sum1 + 10 ** n)
            else:
                print(sum1 + 10 ** n)
N = int(input())  
for i in range(1,10):
  for j in range(1,10):
    if i*j == N:
      print('Yes')
      return
print('No')

### FIXED CODE ###

def main():
    N = int(input())  
    for i in range(1,10):
        for j in range(1,10):
            if i*j == N:
                print('Yes')
                return
    print('No')

if __name__ == '__main__':
    main()
import sys
import math

input = sys.stdin.readline
sys.setrecursionlimit(100000)

def getN():
    return int(input())

def getlist():
    return list(map(int, input().split()))

n = getN() #22

dig_num = math.floor(math.log2(n))  # 5
sen_end = 2 ** (dig_num - 1) - 1  # 15

if 2 ** dig_num == n:
    print("No")
    sys.exit(0)
else:
    print("Yes")

for i in range(sen_end):
    print(i+1, i+2)  # 1-2, 2-3, ..., 14-15
    print(i+1+n, i+2+n)  # 23-24, 24-25, ..., 36-37

print(1, sen_end)

uni_end = n
if n % 2 == 0:
    uni_end -= 1  # 21

for i in range((uni_end - sen_end) // 2):  # 3 times
    print(1, sen_end + i * 2 + 1)  # 1-16
    print(1, sen_end + i * 2 + 2 + n)  # 1-39
    print(sen_end + i * 2 + 1 + n, sen_end + i * 2 + 2 + n)  # 38-39
    print(sen_end + i * 2 + 1, sen_end + i * 2 + 2)  # 16-17

if n % 2 == 0:
    one_count = 0
    for idx, digit in enumerate(bin(n)[2:]):
        # print(digit, one_count)
        if one_count == 0:
            # print(digit)
            if digit == "1":
                one_count += 1
        else:
            if digit == "1":
                one_goal = dig_num - idx  # second "1" from upper digit
                break

    print(n, 2**one_goal)
    print(2*n, n - 2**one_goal)


### FIXED CODE ###

import sys
import math

input = sys.stdin.readline
sys.setrecursionlimit(100000)

def getN():
    return int(input())

def getlist():
    return list(map(int, input().split()))

n = getN() #22

dig_num = math.floor(math.log2(n + 1))  # 5
# print(dig_num)
sen_end = 2 ** (dig_num) - 1  # 15

if 2 ** (dig_num) == n or n == 1:
    print("No")
    sys.exit(0)
else:
    print("Yes")

for i in range(sen_end - 1):
    print(i+1, i+2)  # 1-2, 2-3, ..., 14-15
    print(i+1+n, i+2+n)  # 23-24, 24-25, ..., 36-37

print(n + 1, sen_end)

uni_end = n
if n % 2 == 0:
    uni_end -= 1  # 21

for i in range((uni_end - sen_end) // 2):  # 3 times
    print(1, sen_end + i * 2 + 1)  # 1-16
    print(1, sen_end + i * 2 + 2 + n)  # 1-39
    print(sen_end + i * 2 + 1 + n, sen_end + i * 2 + 2 + n)  # 38-39
    print(sen_end + i * 2 + 1, sen_end + i * 2 + 2)  # 16-17

if n % 2 == 0:
    one_count = 0
    for idx, digit in enumerate(bin(n)[2:]):
        # print(digit, one_count)
        if one_count == 0:
            # print(digit)
            if digit == "1":
                one_count += 1
        else:
            if digit == "1":
                one_goal = dig_num - idx  # second "1" from upper digit
                break

    if one_goal != 1:
        print(n, 2**one_goal)
        print(2*n, n - 2**one_goal)

    else:
        print(n, 2 ** one_goal)
        print(2 * n, 2 * n - 2 ** one_goal + 1)
n=int(input())
a=int(input())
print("No") if (n%500)>=a else ptrint("Yes")

### FIXED CODE ###

n=int(input())
a=int(input())
print("No") if (n%500) > a else print("Yes")
l=int(input())
ans=[]
for i in range(1,l//2+1):
    for j in range(1,l//2+1):
        ans.append(i*j*(l-i-j))
print(max(ans))

### FIXED CODE ###

l=int(input())
a=l/3
print(a*a*a)
N,K = map(int,input().split())
L = list(map(int,input().split()))
Lplus = list(filter(lambda x: x>=0, L))
Lminus = list(filter(lambda x: x<0 ,L))[::-1]
ans_table = []
#print(L)
#right_only
if len(Lplus) >= K:
    ans_table.append(Lplus[K-1])
#left_only
if len(Lminus) >= K:
    ans_table.append(Lminus[K-1])
#once_turn_right_to_left
for i in range(len(Lplus)):
    if i > K: break
    remain = K - i
    tmp = abs(Lplus[i-1])
    if K - i <= len(Lminus):
  #      print(Lminus[K-i-1],Lplus[i-1],i)
        tmp += abs(Lplus[i-1] - Lminus[K-i-1])
        ans_table.append(tmp)
#once_turn_left_to_right
Lplus,Lminus = Lminus,Lplus
for i in range(len(Lplus)):
    if i > K: break
    remain = K - i
    tmp = abs(Lplus[i-1])
    if K - i <= len(Lminus):
 #       print(Lminus[K-i-1],Lplus[i-1],i)
        tmp += abs(Lplus[i-1] - Lminus[K-i-1])
        ans_table.append(tmp)

#print(ans_table)
print(min(ans_table))


### FIXED CODE ###

N, K  = map(int,input().split())
L =list(map(int,input().split()))
Lzero = list(filter(lambda x:x==0,L))
Lright = list(filter(lambda x:x>0,L))
Lleft = list(map(lambda x:abs(x),filter(lambda x:x<0,L)))[::-1]
K -= len(Lzero)
if K <= 0:
    print(0)
    quit()

dis = []
if len(Lright) == 0:
    print(Lleft[K-1])
    quit()
if len(Lleft) == 0:
    print(Lright[K-1])
    quit()
try :
    dis.append(Lright[K-1])
    dis.append(Lleft[K-1])
except:
    pass


for i in range(len(Lright)):
    remain = K
    if i+1 >K:
        break
    elif i+1 == K:
        dis.append(Lright[i])
        break
    d = 2*Lright[i]
    remain -= (i+1)
    try :
        d += Lleft[remain-1]
        dis.append(d)
    except:
        pass
for i in range(len(Lleft)):
    remain = K
    if i+1 >K:
        break
    elif i+1 == K:
        dis.append(Lleft[i])
        break
    d = 2*Lleft[i]
    remain -= (i+1)
    try:
        d += Lright[remain-1]
        dis.append(d)
    except:
        pass
print(min(dis))