Harryxun/stf_run huggingface dataset:
n = int(input())

a = []
for i in range(n):
    d,e = map(int,input().split())
    a.append([d,e])


b = []
for i in range(n):
    if a[i][0] == a[i][1]:
        b.append(1)
    else:
        b.append(0)

c = 0
for i in range(n):
    if b[i] == 1 and b[i+1] == 1 and b[i+2] == 1:
        c = 1
        break

if c == 1:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

n = int(input())

a = []
for i in range(n):
    d,e = map(int,input().split())
    a.append([d,e])


b = []
for i in range(n):
    if a[i][0] == a[i][1]:
        b.append(1)
    else:
        b.append(0)

c = 0
for i in range(n-2):
    if b[i] == 1 and b[i+1] == 1 and b[i+2] == 1:
        c = 1
        break

if c == 1:
    print("Yes")
else:
    print("No")
import copy
#横にn個入力
n, k = map(int, input().split())

#n...普通、a...横で入力された複数の要素を配列で取得
a = input().split()

x = [int(m) for m in a]

X = []

X = copy.deepcopy(x)
X.append(0)
X.sort()

co1 = 0
co2 = 0
co3 = 0
co4 = 0
co3ar = []
co4ar = []

if 0 in x:
    if len(x) > x.index(0) + k - 1:
        co1 = x[x.index(0) + k - 1]
    else:
        co1 = 10 ** 9
else:
    if len(X) > X.index(0) + k:
        co1 = X[X.index(0) + k]
    else:
        co1 = 10 ** 9

if 0 in x:
    if 0 <= x.index(0) - (k - 1):
        co2 = - x[x.index(0) - (k - 1)]
    else:
        co2 = 10 ** 9
else:
    if 0 <= X.index(0) - k:
        co2 = - X[X.index(0) - k]
    else:
        co2 = 10 ** 9

if 0 in x:
    for i in range(1, n + 1):
        if i >= k - i:
            break
        else:
            co3ar.append(x[x.index(0) + i] + x[x.index(0) + i] - x[x.index(0) + 1 - (k - i)])
else:
    for i in range(1, n + 1):
        if i >= k - i:
            break
        else:
            co3ar.append(X[X.index(0) + i] + X[X.index(0) + i] - X[X.index(0) - (k - i)])


if 0 in x:
    for i in range(1, n + 1):
        if i >= k - i:
            break
        else:
            co4ar.append(- x[x.index(0) - i] + x[x.index(0) + k - i - 1] - x[x.index(0) - i])
else:
    for i in range(1, n + 1):
        if i >= k - i:
            break
        else:
            co4ar.append(- X[X.index(0) - i] + X[X.index(0) + k - i] - X[X.index(0) - i])

if co3ar == []:
    co3 = 10 ** 9
else:
    co3 = min(co3ar)

if co4ar == []:
    co4 = 10 ** 9
else:
    co4 = min(co4ar)

print(min(co1,co2,co3,co4))

### FIXED CODE ###

#横にn個入力
n, k = map(int, input().split())

#n...普通、a...横で入力された複数の要素を配列で取得
a = input().split()

x = [int(m) for m in a]
lx = []
mx = []
rx = []
for i in range(n):
    if x[i] < 0:
        lx.append(x[i])
    elif x[i] == 0:
        mx.append(x[i])
    else:
        rx.append(x[i])

lx.sort(reverse=True)
rx.sort()
lmx = lx + mx
lmx.sort(reverse=True)
ans1 = float("INF")
if len(lmx) >= k:
    ans1 = abs(lmx[k - 1])

mrx = mx + rx
mrx.sort()
ans2 = float("INF")
if len(mrx) >= k:
    ans2 = abs(mrx[k - 1])

p = 1
ans3 = float("INF")
while p <= len(rx):
    if len(rx) >= p and len(lx) >= k - p - len(mx) and k - p - len(mx) > 0:
        if ans3 > abs(2 * rx[p - 1]) + abs(lx[k - p - len(mx) - 1]):
            ans3 = abs(2 * rx[p - 1]) + abs(lx[k - p - len(mx) - 1])
    p += 1

q = 1
ans4 = float("INF")
while q <= len(lx):
    if len(lx) >= q and len(rx) >= k - q - len(mx) and k - q - len(mx) > 0:
        if ans4 > abs(2 * lx[q - 1]) + abs(rx[k - q - len(mx) - 1]):
            ans4 = abs(2 * lx[q - 1]) + abs(rx[k - q - len(mx) - 1])
    q += 1

print(min(ans1,ans2,ans3,ans4))
import copy

from collections import Counter

import numpy as np

N, M, X = map(int, input().split())
CA = [list(map(int, input().split())) for _ in range(N)]

dp = np.full([M, 2 * 10**5 + 1], 10**5, dtype=np.int32)
dp[:, 0] = 0

for ca in CA:
    c = ca[0]
    a = ca[1:]

    for i, v in enumerate(a):
        p_dp = copy.deepcopy(dp)
        np.minimum(dp[i, v:], p_dp[i, :-v] + c, out=dp[i, v:])

p_ans = dp[:, X:]

ans_list = []
for i in range(M):
    ans_list += list(set(p_ans[i]))

C = sorted(Counter(ans_list).items())

for k, v in C:
    if v >= M:
        if k == 10**5:
            print(-1)
            break
        else:
            print(k)
            break
else:
    print(-1)


### FIXED CODE ###

import itertools

N, M, X = map(int, input().split())
CA = [list(map(int, input().split())) for _ in range(N)]

ans = []

for s in itertools.product(range(2), repeat=N):

    li = [0 for _ in range(M)]
    cum = 0
    for i, v in enumerate(s):
        if v == 1:
            ca = CA[i]
            cum += ca[0]

            for j, x in enumerate(ca[1:]):
                li[j] += x

        q = [p >= X for p in li]
        if all(q):
            ans.append(cum)

print(min(ans) if ans else -1)
import sys
# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
# import heapq
import decimal
# import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===

def main():
    i = nis()
    print(i + i ** 2 + i ** 3)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
# import heapq
import decimal
# import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===

def main():
    i = ni()
    print(i + i ** 2 + i ** 3)


if __name__ == '__main__':
    main()
N, M, X = [int(i) for i in input().split()]
CA = []
for i in range(N):
    CA.append([int(j) for j in input().split()])
#print(CA)
mcost = 10**10


for i in range(2**N):
    learn = [0]*M
    cost = 0
    bn = str(bin(i))[2:].zfill(M)
    #print(bn)
    for j,b in enumerate(bn):
        if b == "1":
            cost += CA[j][0]
            for m in range(M):
                learn[m] += CA[j][m+1]
                
    learn.sort()
    if learn[0] >= X:
        mcost = min(mcost, cost)

if mcost == 10**10:
    mcost = -1

print(mcost)

### FIXED CODE ###

N, M, X = [int(i) for i in input().split()]
CA = []
for i in range(N):
    CA.append([int(j) for j in input().split()])
#print(CA)
mcost = 10**10


for i in range(2**N):
    learn = [0]*M
    cost = 0
    bn = str(bin(i))[2:].zfill(N)
    #print(bn)
    for j,b in enumerate(bn):
        if b == "1":
            cost += CA[j][0]
            for m in range(M):
                learn[m] += CA[j][m+1]
                
    learn.sort()
    #print(learn)
    if learn[0] >= X:
        mcost = min(mcost, cost)

if mcost == 10**10:
    mcost = -1

print(mcost)
x, y = int(input())

print(x + y / 2)


### FIXED CODE ###

x, y = map(int, input().split())

print(x + int(y / 2))
n,a,b,k=map(int,input().split())
mod=998244353
ans=0
p=[1]*(n+1)
for i in range(n):
    p[i+1]=((i+1)*p[i])%mod
for ai in range(n+1):
    if k-a*ai>=0 and (k-a*ai)%b==0:
        bi=(k-a*ai)//b
        ans+=p[n]*pow(p[ai],mod-2,mod)*pow(p[n-ai],mod-2,mod)*p[n]*pow(p[bi],mod-2,mod)*pow(p[n-bi],mod-2,mod)
        ans%=mod
print(ans)

### FIXED CODE ###

n,a,b,k=map(int,input().split())
mod=998244353
ans=0
p=[1]*(n+1)
for i in range(n):
    p[i+1]=((i+1)*p[i])%mod
for ai in range(n+1):
    if k-a*ai>=0 and (k-a*ai)%b==0:
        bi=(k-a*ai)//b
        if bi<=n:
            ans+=p[n]*pow(p[ai],mod-2,mod)*pow(p[n-ai],mod-2,mod)*p[n]*pow(p[bi],mod-2,mod)*pow(p[n-bi],mod-2,mod)
            ans%=mod
print(ans)
X = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

for i in range(len(make_divisors(X))):
    A = make_divisors(X)[i]
    for j in range(-int(X**(1/5))-1,int(X**(1/5))+1):
        if (A+j)**5-j**5==X:
            a = j + A
            b = j
            break
        else:
            continue
        break
    else:
        continue
    break
print(a,b)

### FIXED CODE ###

X = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

for i in range(len(make_divisors(X))):
    A = make_divisors(X)[i]
    for j in range(-64,119):
        if (A+j)**5-j**5==X:
            a = j + A
            b = j
            break
        else:
            continue
        break
    else:
        continue
    break
print(a,b)
s = input()

count = 0
if  len(s) < 4:
    print(0)
else:
    for i in range(len(s) -4 + 1):
        for j in range(len(s) - 4 + 1 - i):
#             print(i, j + 4, s[i : j + 4 + i])
            if int(s[i : j + 4 + i]) % 2019 == 0:
                count+=1
#                 print(s[i : j + 4 + i])
    print(count)

### FIXED CODE ###

s, w = map(int, input().split())

if s <= w:
    print('unsafe')
else:
    print('safe')
N = int(input("N = "))
a = []
ball = []
while N != len(a):
    a.append(int(input("a_i = ")))
    ball.append(0)
i = N
ballcount = 0
check = 2
out = 0
while i != 0 and out != N + 1:
    while check * i <= N: 
        ballcount += ball[check * i - 1]
        check += 1
    if ballcount % 2 != a[i - 1]:
        ball[i - 1] = 1
    check = 2
    i -= 1
    ballcount = 0
    out += 1
if out == N + 1:
    i = out
    print(-1)
M = 0
while i < N:
    if ball[i] == 1:
        M += 1
    i += 1
print(M)
i = 0
while i < N:
    if ball[i] == 1:
        print(i + 1)
    i += 1

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
ball = [0 for c in range(N)]
i = N
ballcount = 0
check = 2
out = 0
while i != 0 and out != N + 1:
    while check * i <= N: 
        ballcount += ball[check * i - 1]
        check += 1
    if ballcount % 2 != a[i - 1]:
        ball[i - 1] = 1
    check = 2
    i -= 1
    ballcount = 0
    out += 1
if out == N + 1:
    i = out
    print(-1)
M = 0
while i < N:
    if ball[i] == 1:
        M += 1
    i += 1
print(M)
i = 0
while i < N:
    if ball[i] == 1:
        print(i + 1)
    i += 1
n,k_num = map(int,input().split())
info =[list(map(int,input().split())) for i in range(n)]
li_x = []
li_y = []

for i in range(n):
 # if info[i][0] not in li_x:
    li_x.append(info[i][0])
 # if info[i][1] not in li_y:
    li_y.append(info[i][1])

li_x = sorted(li_x)
li_y = sorted(li_y)

bunpu = [[0]*n for i in range(n)]
for i in range(n):
  for j in range(n):
    if info[i][0]==li_x[j]:
      zahyo_x=j
      break
  for k in range(n):
    if info[i][0]==li_y[k]:
      zahyo_y=k
      break
  bunpu[zahyo_x][zahyo_y]=1

ruiseki = [[0]*n for i in range(n)]


for i in range(0,n):
  for j in range(0,n):
    ruiseki[i][j] = bunpu[i][j]
#横方向(j)の累積
for i in range(n):
  for j in range(1,n):
    ruiseki[i][j] = ruiseki[i][j-1] + ruiseki[i][j]
#縦方向(i)の累積
for j in range(n):
  for i in range(1,n):
    ruiseki[i][j] = ruiseki[i-1][j] + ruiseki[i][j]

#print(bunpu)
#print(ruiseki)

ans = float("inf")

for i in range(len(li_x)):
  for j in range(i,len(li_x)):
    for k in range(len(li_y)):
      for l in range(j,len(li_y)):
        count = ruiseki[j][l]
        if 0<=k-1:
          count -= ruiseki[j][k-1]
        if 0<=i-1:
          count -= ruiseki[i-1][l]
        if 0<=k-1 and 0<=i-1:
          count += ruiseki[i-1][k-1]      
        if count ==k_num:
          ans = min(ans,(li_x[j]-li_x[i])*(li_y[l]-li_y[k]))
print(ans)

### FIXED CODE ###

n,k_num = map(int,input().split())
info =[list(map(int,input().split())) for i in range(n)]
li_x = []
li_y = []

for i in range(n):
 # if info[i][0] not in li_x:
    li_x.append(info[i][0])
 # if info[i][1] not in li_y:
    li_y.append(info[i][1])

li_x = sorted(li_x)
li_y = sorted(li_y)

bunpu = [[0]*n for i in range(n)]
for i in range(n):
  for j in range(n):
    if info[i][0]==li_x[j]:
      zahyo_x=j
      break
  for k in range(n):
    if info[i][1]==li_y[k]:
      zahyo_y=k
      break
  bunpu[zahyo_x][zahyo_y]=1

ruiseki = [[0]*n for i in range(n)]


for i in range(0,n):
  for j in range(0,n):
    ruiseki[i][j] = bunpu[i][j]
#横方向(j)の累積
for i in range(n):
  for j in range(1,n):
    ruiseki[i][j] = ruiseki[i][j-1] + ruiseki[i][j]
#縦方向(i)の累積
for j in range(n):
  for i in range(1,n):
    ruiseki[i][j] = ruiseki[i-1][j] + ruiseki[i][j]

#print(bunpu)
#print(ruiseki)

ans = float("inf")

for i in range(len(li_x)):
  for j in range(i,len(li_x)):
    for k in range(len(li_y)):
      for l in range(k,len(li_y)):
        count = ruiseki[j][l]
        if 0<=k-1:
          count -= ruiseki[j][k-1]
        if 0<=i-1:
          count -= ruiseki[i-1][l]
        if 0<=k-1 and 0<=i-1:
          count += ruiseki[i-1][k-1]      
        if count ==k_num:
          ans = min(ans,(li_x[j]-li_x[i])*(li_y[l]-li_y[k]))
print(ans)
A=int(input())
B=int(input())
if (A=1 and B=2)or(A=2 and B=1):
  print(3)
if (A=2 and B=3)or(A=3 and B=2):
  print(1)
else:
  print(2)

### FIXED CODE ###

A=int(input())
B=int(input())  
C=6-A-B
print(C)
def fib(n):
   if n == 0 || n == 1:
       return 1
    
   return fib(n-1) + fib(n-2)


n=int(raw_input())
print fib(n)

### FIXED CODE ###

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

def main():
    def _fibonacci(n,cache):
        if n in cache:
            return cache[n]

        elif n == 0 or n == 1:
            ret = 1
            cache[n] = ret
            return ret
        else:
            ret = _fibonacci(n - 1, cache) + _fibonacci(n - 2, cache)
            cache[n] = ret
            return ret

    N = int(raw_input())
    cache = {}
    return _fibonacci(N,cache)

print main()
Aij= [input().split() for l in range(3)]
N=int(input())
b= [int(input()) for i in range(N)]
for j in range(3):
    for k in range(3):
        for n in range(N):
            if int(Aij[j][k])==b[n]:
                Aij[j][k]='0'
if (A[0][0] == A[0][1] == A[0][2] == 0) or (A[1][0] == A[1][1] == A[1][2] == 0) or (A[2][0] == A[2][1] == A[2][2] == 0):
elif Aij[0][0]=='0' and Aij[0][1]=='0' and Aij[0][2]=='0':
    print('Yes')
elif Aij[1][0]=='0' and Aij[1][1]=='0' and Aij[1][2]=='0':
    print('Yes')
elif Aij[2][0]=='0' and Aij[2][1]=='0' and Aij[2][2]=='0':
    print('Yes')
elif Aij[0][0]=='0'and Aij[1][1]=='0'and Aij[2][2]=='0':
    print('Yes')
elif Aij[0][2]=='0' and Aij[1][1]=='0'and Aij[2][0]=='0':
    print('Yes')
else:
    print('No')

### FIXED CODE ###

Aij= [input().split() for l in range(3)]
N=int(input())
b= [int(input()) for i in range(N)]
for j in range(3):
    for k in range(3):
        for n in range(N):
            if int(Aij[j][k])==b[n]:
                Aij[j][k]='0'
if Aij[0].count('0')==3 or Aij[1].count('0')==3 or Aij[2].count('0')==3:
    print('Yes')
elif Aij[0][0]=='0' and Aij[1][0]=='0' and Aij[2][0]=='0':
    print('Yes')
elif Aij[0][1]=='0' and Aij[1][1]=='0' and Aij[2][1]=='0':
    print('Yes')
elif Aij[0][2]=='0' and Aij[1][2]=='0' and Aij[2][2]=='0':
    print('Yes')
elif Aij[0][0]=='0'and Aij[1][1]=='0'and Aij[2][2]=='0':
    print('Yes')
elif Aij[0][2]=='0' and Aij[1][1]=='0'and Aij[2][0]=='0':
    print('Yes')
else:
    print('No')
a,b = input().split()
# print(a)
# print(b)

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

### FIXED CODE ###

A, B = map(int, input().split())
if A > B:
    print(A + A - 1)
elif B > A:
    print(B + B - 1)
else:
    print(A + A)
S,T=input.split()
for i in range(len(S)):
  if S[i:]+S[:i]==T:
    print("Yes")
    exit(0)
    
print("No")

### FIXED CODE ###

S=input()
T=input()
for i in range(len(S)):
  if S[i:]+S[:i]==T:
    print("Yes")
    exit(0)
    
print("No")
N = int(input())
ans = "1" if N == 1 else "0.5" if N%2 != 1 else (N-1)/2N
print(ans)

### FIXED CODE ###

N = int(input())
ans = 0
if N == 1:
    ans = 1
elif N%2 != 1:
    ans= 0.5
else:
    ans=(N+1)/(2*N)
print(ans)
S = input()
search_dic = {i:0 for i in range(ord('a'),ord('z'))}
for ss in S:
    search_dic[ord(ss)] += 1
    
max_v = max([(y,x) for x,y in search_dic.items()])
max_v = [chr(max_v[1]),max_v[0]]
major = round(len(S) / 2)

if max_v[1] >= major:
    r = S[::-1]
    print(S.index(max_v[0]) + 1,len(r) - r.index(max_v[0]) + 1)
else:
    print(-1,-1)

### FIXED CODE ###

S = input()
N = len(S)
for i in range(N-1):
    if S[i] == S[i + 1]:
        print(i+1,i+2)
        exit()
for i in range(N-2):
    if S[i] == S[i + 2]:
        print(i + 1 ,i + 3)
        exit()
        
print(-1,-1)
input()
s=input()
k=int(input())
for i in s:print(s if s[i] == s[k+1] else '*',end='')


### FIXED CODE ###

n=int(input())
s=input()
k=int(input())
a=''
for i in range(n):
    if s[i] != s[k-1]:
        a+='*'
    else:
        a+=s[i]
print(a)
import math
A,B=map(int, input().split())
divisors = []
for i in range(1, int(n**0.5)+1):
    flag=0
    if n % i == 0:
      for j in range(2, int(i**0.5)+1):
        if i%j==0:
          flag=1
          break
    if flag==0:
      divisors.append(i)
      #if i != n // i :
      #  divisors.append(n//i)
flag=0
for j in range(1, int(n**0.5)+1):
    if n%j==0:
      flag=1
      break
if flag==0:
      divisors.append(n)
print(len(divisors))          

### FIXED CODE ###

import fractions
import math
A,B=map(int, input().split())
n=fractions.gcd(A, B)
divisors = []
for i in range(1, int(n**0.5)+1):
    flag=-1
    lag=-1
    if n % i == 0:
      flag=0
      for j in range(2, int(i**0.5)+1):
        if i%j==0 and i!=j:
          flag=1
          break
      if i != n // i :
        lag=0
        for j in range(2, int((n // i)**0.5)+1):
          if (n // i)%j==0 and i!=j:
            lag=1
            break
    if flag==0:
      divisors.append(i)
    if lag==0:
      divisors.append(n//i)
#flag=0
#print(divisors)
#for j in range(2, int(n**0.5)+1):
#    if n%j==0:
#     flag=1
 #     break
#if flag==0:
 #     divisors.append(n)
print(len(divisors))
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

def f(x):
    cnt = k
    for i in a:
        tmp = math.ceil(i / x)
        cnt -= tmp - 1
        if cnt < 0:
            return False
    return True

n, k = LI()
a = LI()
a.sort(reverse=True)
ok = sum(a)
ng = -1
while ok - ng > 1:
    mid = (ok + ng) // 2
    if f(mid):
        ok = mid
    else:
        ng = mid
print(ok)

### FIXED CODE ###

#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

def f(x):
    cnt = k
    for i in a:
        tmp = math.ceil(i / x)
        cnt -= tmp - 1
        if cnt < 0:
            return False
    return True

n, k = LI()
a = LI()
a.sort(reverse=True)
ok = sum(a)
ng = 0
while ok - ng > 1:
    mid = (ok + ng) // 2
    if f(mid):
        ok = mid
    else:
        ng = mid
print(ok)
N, M = map(int, input().split())
num = [0] * (N+1)
for i in range(M):
    a, b = map(int, input().split())
    num[a] += 1
    num[b] += 1

flag = 1
for i in num:
    if num % 2 != 0:
        flag = 0

if flag = 1:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

N, M = map(int, input().split())
num = [0] * (N+1)
for i in range(M):
    a, b = map(int, input().split())
    num[a] += 1
    num[b] += 1

flag = 1
for i in num:
    if i % 2 != 0:
        flag = 0

if flag == 1:
    print("YES")
else:
    print("NO")
N, X = map(int, input)
L = list(map(int, input().split()))
d = 0
ans = 1
for i in range(N):
  d += L[i]
  if d <= X:
    ans += 1

print(ans)

### FIXED CODE ###

N, X = map(int, input().split())
L = list(map(int, input().split()))
d = 0
ans = 1
for i in range(N):
  d += L[i]
  if d <= X:
    ans += 1

print(ans)
N,M=map(int,input().split())
G=[[False]*(M+1) for _ in range(N+1)]
for i in range(M):
    a,b=map(int,input().split())
    G[a][b]=True
    G[b][a]=True

visited=[False]*(N+1)

visited[1]=True
def dfs(start):
    global N
    global visited
    all_visited=True
    sum=0

    for p in range(1,N+1):
        if not visited[p]:
            all_visited=False

    if all_visited:
        return 1
    else:
        for next in range(1,N+1):#N小より全探索
            if not G[start][next]:
                continue
            if visited[next]:
                continue
            visited[next]=True
            sum+=dfs(next)
            visited[next]=False   #backtrack

    return sum

print(dfs(1))


### FIXED CODE ###

N,M=map(int,input().split())
G=[[False]*(N+1) for _ in range(N+1)]
for i in range(M):
    a,b=map(int,input().split())
    G[a][b]=True
    G[b][a]=True

visited=[False]*(N+1)

visited[1]=True
def dfs(start):
    global N
    global visited
    all_visited=True
    sum=0

    for p in range(1,N+1):
        if not visited[p]:
            all_visited=False

    if all_visited:
        return 1
    else:
        for next in range(1,N+1):#N小より全探索
            if not G[start][next]:
                continue
            if visited[next]:
                continue
            visited[next]=True
            sum+=dfs(next)
            visited[next]=False   #backtrack

        return sum

print(dfs(1))
N=int(input())
ans=10**12
for  x in range(1,(N+1)**0.5):
    if N%x==0:
        if (x+int((N/x)-2))<ans:
            ans=(x+int((N/x))-2)
print(ans)

### FIXED CODE ###

N=int(input())
ans=10**12
for  x in range(1,int((N)**0.5+1)):
    if N%x==0:
        if (x+int((N/x)-2))<ans:
            ans=(x+int((N/x))-2)
print(ans)
n = int(input())
ans = [0] * n
for i in range(1,n):
  ans[i - 1] = i   
print(sum(ans))

### FIXED CODE ###

import math
n = int(input())
print(math.floor(((n-1)*(n-1+1))//2))
a,b,c = map(int,input().splid())

hect = a*b*0.5
print(hect)

### FIXED CODE ###

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

hect = int(a*b*0.5)
print(hect)
n,k = (int(x) for x in input().split())
a = [int(x) for x in input().split()]
 
l = [1]
now = 1
next = a[0]
notloop = 0
dupl = -1
 
for i in range(n):
  now = next
  next = a[now-1]
  
  if now in l:
    dupl = now
    break
  else:
    l.append(now)
    
if(dupl == -1):
  print(now)
  
else:
  notloop = l.index(dupl)
  length = len(l)-notloop
  print(l[(k-notloop)%length+notloop])

### FIXED CODE ###

s = input()
t = input()

if(len(s)+1 == len(t)) and (s == t[0:len(t)-1]):
  print("Yes")
else:
  print("No")
while True:
  x, y = map(int, input().split())
  if x == 0 and y == 0 :
　　    break
  if x>y:
    print(y, x)
  else:
    print(x,y)


### FIXED CODE ###

while True:
  x, y = map(int, input().split())
  if x == 0 and y == 0 :
    break
  if x>y:
    print(y, x)
  else:
    print(x,y)
# c
n = int(input())
*A, = map(int, input().split())
*B, = map(int, input().split())
cnt = 0
while B != A:
    for i in range(n):
        a, c = B[i-1], B[(i+1)%n]
        if (B[i] > A[i]) &\
           (B[i] > a) &\
           (B[i] > c):
            B[i] -= (a+c)*((B[i]-A[i]+a+c)//(a+c))
            cnt += 1
        elif B[i] < A[i]:
            print(-1)
            exit()
print(cnt)

### FIXED CODE ###

n = int(input())
*A, = map(int, input().split())
*B, = map(int, input().split())
cnt = 0
while B != A:
    for i in range(n):
        a, c = B[i-1], B[(i+1)%n]
        if (B[i] > A[i]) &\
           (B[i] > a) &\
           (B[i] > c):
            d = (B[i]-max(A[i], a, c)+a+c-1)//(a+c)
            B[i] -= (a+c)*d
            cnt += d
        elif B[i] < A[i]:
            print(-1)
            exit()
print(cnt)