Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

A, B, K = map(int, input().split())
li = [i for i in range(A, B + 1)]
for i, l in enumerate(li) :
    if i + 1 <= K or len(li) - i <= K :
        print(l)


### FIXED CODE ###

A, B, K = map(int, input().split())
for i in range(A, A + K):
    if i == B + 1:
        break
    print(i)
for j in range(B - K + 1, B + 1):
    if j <= i :
        continue
    print(j)
### BUGGY CODE ###

N,K = map(int,input().split())
flag = 0
a = 1
while a <= N:
  b = 1
  while b <= N:
    c = 1
    while c <= N:
      if (a+b)%K == 0 and (b+c)%K == 0 and (c+a)%K == 0:
        flag = flag + 1
      c = c + 1
    b = b + 1
  a = a + 1
print(flag)

### FIXED CODE ###

N,K = map(int,input().split())
if K%2==1:
    maxn = int(N/K)
    print(maxn**3)
else:
    maxn=int(N/K)
    if N%K >= int(K/2):
        print(maxn**3+(maxn+1)**3)
    else:
        print(2*maxn**3)
### BUGGY CODE ###

# B
R, G, B = map(int, input().split())
K = int(input())
ans = 'No'

num = 0

while (True):
    if  (num == K):
        break
        
    if (R > G):
        G *= 2
        num += 1
        
    if (R < G):
        break
    
while (True):
    if  (num == K):
        break
        
    if (G > B):
        B*= 2
        num += 1
        
    if (G < B):
        break

if (R < G and G < B):
    ans = 'Yes'
    
print(ans)

### FIXED CODE ###

# B
R, G, B = map(int, input().split())
K = int(input())
ans = 'No'

num = 0

while (True):
    if  (num == K):
        break
        
    if (R >= G):
        G *= 2
        num += 1
        
    if (R < G):
        break
    
while (True):
    if  (num == K):
        break
        
    if (G >= B):
        B *= 2
        num += 1
        
    if (G < B):
        break

if (R < G and G < B):
    ans = 'Yes'
    
print(ans)
### BUGGY CODE ###

s = input()
q = int(input())
Q = [input().split() for _ in range(q)]

s = list(s)
for query in Q:
    if len(query) == 1:
        s.reverse()
    else:
        if query[1] == '1':
            s.insert(0, query[2])
        elif query[1] == '2':
            s.append(query[2])

print("".join(s))

### FIXED CODE ###

from collections import deque

s = input()
q = int(input())
Q = [input() for _ in range(q)]

s = deque(list(s))
insert = s.appendleft
append = s.append
flag = True

for query in Q:
    if query[0] == '1':
        flag = not flag
    else:
        if (query[2] == '1' and flag) or (query[2] == '2' and not flag):
            insert(query[4])
        else:
            append(query[4])

if not flag:
    s.reverse()

print(*s, sep='')
### BUGGY CODE ###

from time import time
from random import randrange
start = time()

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

for i in range(n):
    if A[i] != B[i]:
        continue
    while time() - start < 1.9:
        j = randrange(n)
        if A[i] != B[j] and A[j] != B[i]:
            B[i], B[j] = B[j], B[i]
            break
    else:
        print("No")
        exit(0)

print("Yes")
print(*B)

### FIXED CODE ###

import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
from collections import Counter
from random import randrange
def resolve():
    n = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    if Counter(A + B).most_common()[0][1] > n:
        print("No")
        return

    for i in range(n):
        if A[i] != B[i]:
            continue
        while 1:
            j = randrange(0, n)
            if A[i] != B[j] and A[j] != B[i]:
                B[i], B[j] = B[j], B[i]
                break
    print("Yes")
    print(*B)
resolve()
### BUGGY CODE ###

import sys
from io import StringIO
import unittest
import os

# 再帰処理上限(dfs作成時に設定するのが面倒なので限度近い値を組み込む)
sys.setrecursionlimit(999999999)


# 実装を行う関数
def resolve(test_def_name=""):
    n = int(input())

    ans = 0

    for j in range(1, n + 1):
        for i in range(1, n + 1):
            if i % j == 0:
                ans += i

    print(ans)


# テストクラス
class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """4"""
        output = """23"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """100"""
        output = """26879"""
        self.assertIO(test_input, output)

    # def test_input_3(self):
    #     test_input = """10000000"""
    #     output = """838627288460105"""
    #     self.assertIO(test_input, output)

    # 自作テストパターンのひな形(利用時は「tes_t」のアンダーバーを削除すること
    def tes_t_1original_1(self):
        test_input = """データ"""
        output = """データ"""
        self.assertIO(test_input, output)


# 実装orテストの呼び出し
if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main()


### FIXED CODE ###

import sys
from io import StringIO
import unittest
import os

sys.setrecursionlimit(999999999)

def get_arithmetic_progression(a, d, n):
    return n * (2 * a + (n - 1) * d) // 2

# 実装を行う関数
def resolve(test_def_name=""):
    n = int(input())

    ans = 0
    for i in range(1, n + 1):
        ans += get_arithmetic_progression(i, i, n // i)

    print(ans)


# テストクラス
class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """4"""
        output = """23"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """100"""
        output = """26879"""
        self.assertIO(test_input, output)

    # def test_input_3(self):
    #     test_input = """10000000"""
    #     output = """838627288460105"""
    #     self.assertIO(test_input, output)

    # 自作テストパターンのひな形(利用時は「tes_t」のアンダーバーを削除すること
    def tes_t_1original_1(self):
        test_input = """データ"""
        output = """データ"""
        self.assertIO(test_input, output)


# 実装orテストの呼び出し
if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main()
### BUGGY CODE ###

N = int(input())
l = [sorted([i+1, j]) for i, j in enumerate(map(int, input().split()))]

def f(l):
	ul = []
	return [x for x in l if x not in ul and not ul.append(x)]

print(len(l) - len(f(l)))

### FIXED CODE ###

N = int(input())
l = tuple(map(int, input().split()))
cnt = 0
for i in range(N):
	if l[l[i]-1] == i+1:
		cnt += 1
print(cnt//2)
### BUGGY CODE ###

from fractions import gcd
MOD=(10**9)+7
n=int(input())
a=list(map(int,input().split()))
a_lcm=a[0]

for ai in a:
    a_lcm=(a_lcm*ai) // gcd(a_lcm, ai)

b=[]
sum_b=0
for ai in a:
    bi=a_lcm//ai
    b.append(bi)
    sum_b+=bi
print(sum_b%MOD)

### FIXED CODE ###

from fractions import gcd
MOD=(10**9)+7
n=int(input())
a=list(map(int,input().split()))
a_lcm=a[-1]

for ai in a:
    a_lcm=(a_lcm*ai) // gcd(a_lcm, ai)

sum_b=0
for ai in a:
    bi=a_lcm//ai
    sum_b+=bi
print(sum_b%MOD)
### BUGGY CODE ###

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

B = [0 for i in range(N)]
R = []
I = list(range(1, N+1))

for i in I[::-1]:
    if B[i-1] % 2 != A[i-1]:
        for j in I[:i+1]:
            if i % j == 0:
                B[j-1] += 1
                if i == j:
                    R.append(i)
R.sort()
print(len(R))
if R:
    print(' '.join(map(str, R)))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().strip().split(' ')))
R = [0 for i in range(N+1)]
ans = []

for _ in range(N):
    i = N - _
    a = A[i-1]
    if sum(R[i::i]) % 2 != a:
        R[i] = 1
        ans.append(i)

ans.sort()
print(len(ans))
if ans:
    print(' '.join(map(str, ans)))
### BUGGY CODE ###

n=int(input())
x=list(map(int,input().split()))
list1=[]
def ap1(num):
    list1.append(num)
for i in range(n):
    ap1([x[i],i+1])
str1= lambda val: val[0]
list1.sort(key=str1)
numa=[]
numb=[]
def apa(num):
    numa.append(num)
def apb(num):
    numb.append(num)
for i in range(n):
    num3=list1[i][1]
    for j in range(num3-1):
        apa(num3)
    for j in range(n-num3):
        apb(num3)
count1=0
count2=0
count3=0
ans=[]
ansnum=0
def apans(num):
    ans.append(num)
for i in range(n*n):
    yn=0
    if count1!=n:
        if i==list1[count1][0]-1:
            apans(list1[count1][1])
            count1+=1
            yn=1
    if yn==0:
        if count2!=len(numa):
            apans(numa[count2])
            count2+=1
        elif count3!=len(numb):
            apans(numb[count3])
            count3+=1
        else:
            if i!=n*n-1:
                ansnum=1
                break
list2=[]
def countnum(num):
    return list2.count(num)
for i in range(n):
    list2=ans[:list1[i][0]]
    if countnum(list1[i][1])!=list1[i][1]:
        ansnum=1
        break
if ansnum==1:
    print("No")
else:
    print("Yes")
    print(*ans)


### FIXED CODE ###

def solve():
    n=int(input())
    x=list(map(int,input().split()))
    list1=[]
    def ap1(num):
        list1.append(num)
    for i in range(n):
        ap1([x[i],i+1])
    str1= lambda val: val[0]
    list1.sort(key=str1)
    numa=[]
    numb=[]
    for i in range(n):
        num3=list1[i][1]
        numa+=[num3]*(num3-1)
        numb+=[num3]*(n-num3)
    count1=0
    count2=0
    count3=0
    ans=[]
    ansnum=0
    def countnum(num):
        return ans.count(num)
    def apans(num):
        ans.append(num)
    for i in range(n*n):
        yn=0
        if count1!=n:
            if i==list1[count1][0]-1:
                if countnum(list1[count1][1])!=list1[count1][1]-1:
                    ansnum=1
                    break
                apans(list1[count1][1])
                count1+=1
                yn=1
        if yn==0:
            if count2!=len(numa):
                apans(numa[count2])
                count2+=1
            elif count3!=len(numb):
                apans(numb[count3])
                count3+=1
            else:
                if i!=n*n-1:
                    ansnum=1
                    break
    if ansnum==1:
        print("No")
    else:
        print("Yes")
        print(*ans)
solve()
### BUGGY CODE ###

N = int(input())
str_list = []
for i in range(N):
  str_list.append(input())
str_set = sorted(list(set(str_list)))
cnt = [0] * len(str_set)
for i, str in enumerate(str_set):
  cnt[i] = str_list.count(str)

max_cnt = max(cnt)
for i in range(len(cnt)):
  if cnt[i]==max_cnt:
    print(str_set[i])

### FIXED CODE ###

from collections import Counter

N = int(input())
cnt = Counter()
for i in range(N):
  cnt[input()] += 1

mc = cnt.most_common(1)[0][1]
ms = []
for kw, count in cnt.most_common():
  if(count<mc):
    break
  ms.append(kw)
  
ms.sort()
for s in ms:
  print(s)
### BUGGY CODE ###

a, b , x = map(int, input().split())
ans = 0
for i in range(a,b+1):
  if i % x == 0 :
    ans+=1
print(ans)

### FIXED CODE ###

a, b , x = map(int, input().split())
print(b // x - (a - 1) // x)
### BUGGY CODE ###

N = int(input())
items = []
for i in range(N):
    a = str(input())
    if a not in items:
        items.append(a)
print(len(items))

### FIXED CODE ###

N = int(input())
items = {}
for i in range(N):
    a = str(input())
    items[a] = 0
print(len(items))
### BUGGY CODE ###

INF = float('inf')
from bisect import bisect
N = int(input())
A = list(map(int,input().split()))
S = [0]*N
for i in range(N):
    S[i] = S[i-1]+A[i]

ans = INF
for i in range(2,N-1):
    j = bisect(S,S[i-1]/2)
    k = bisect(S,(S[-1]+S[i-1])/2)
    for p in {j-1,min(j,i-2)}:
        for q in {k-1,i,min(k,N-2)}:
            a,b,c,d = S[p],S[i-1]-S[p],S[q]-S[i-1],S[-1]-S[q]
            m = min(a,b,c,d)
            M = max(a,b,c,d)
            ans = min(ans,M-m)

print(ans)

### FIXED CODE ###

INF = float('inf')
from bisect import bisect
N = int(input())
A = list(map(int,input().split()))
S = [0]*N
for i in range(N):
    S[i] = S[i-1]+A[i]

ans = INF
for i in range(2,N-1):
    j = bisect(S,S[i-1]/2)
    k = bisect(S,(S[-1]+S[i-1])/2)
    for p in {j-1,min(j,i-2)}:
        for q in {k-1,i,min(k,N-2)}:
            a,b,c,d = S[p],S[i-1]-S[p],S[q]-S[i-1],S[-1]-S[q]
            m = min(a,b,c,d)
            M = max(a,b,c,d)
            ans = min(ans,M-m)

print(ans)
### BUGGY CODE ###

n = int(input())
uvw = []
for i in range(n-1):
    uvw.append(list(map(int, input().split(' '))))
result = [0]*(n+1)
result[uvw[0][1]] = uvw[0][2]
s = uvw[0][0]
del uvw[0]
n_visit = []
horyuu = []
count = n-2
while count > 0:
    for i in range(len(uvw)):
        if result[uvw[i][0]] == 0 and result[uvw[i][1]] != 0 and uvw[i][0] != s:
            result[uvw[i][0]] =  result[uvw[i][1]] + uvw[i][2]
            count -= 1
        elif result[uvw[i][0]] != 0 and result[uvw[i][1]] == 0 and uvw[i][1] != s:
            result[uvw[i][1]] =  result[uvw[i][0]] + uvw[i][2]
            count -= 1
        else:
            if uvw[i][1] != s and uvw[i][0] == s:
                result[uvw[i][1]] = uvw[i][2]
                count -= 1
            elif uvw[i][0] != s and uvw[i][1] == s:
                result[uvw[i][0]] = uvw[i][2]
                count -= 1
            else:
                horyuu.append(uvw[i])
    uvw = horyuu
    horyuu = []

for i in range(1,n+1):
    if result[i]%2 == 0:
        print(0)
    else:
        print(1)

### FIXED CODE ###

from collections import deque

n = int(input())
visit = [-1 for _ in range(n+1)]
friends = [[] for _ in range(n+1)]
for i in range(n-1):
    u, v, w = map(int, input().split())
    friends[u].append([v, w])
    friends[v].append([u, w])

q = deque([1])
visit[1] = 0
while q:
    position = q.popleft()
    for i, cost in friends[position]:
        if visit[i] < 0:
            visit[i] = visit[position] + cost
            q.append(i)

for i in visit[1:]:
    print(i%2)
### BUGGY CODE ###

K, S = map(int, input().split())
x = S if K>S else K

ans = 0
for i in range(x+1):
  x1 = S-i
  for j in range((K if x1>K else x1)+1):
    x2 = S-i-j
    for k in range((K if x2>K else x2)+1):
      if i+j+k==S:
        #print("{} {} {}".format(i,j,k))
        ans += 1
print(ans)

### FIXED CODE ###

K, S = map(int, input().split())
x = S if K>S else K

ans = 0
for i in range(x+1):
  x1 = S-i
  for j in range((K if x1>K else x1)+1):
    if S-i-j <= K:
      ans += 1

print(ans)
### BUGGY CODE ###

from heapq import *
import numpy as np
n,m,s,t=map(int,input().split())
a=[[]for i in range (n+1)]
b=[[]for i in range(n+1)]
for i in range(m):
    p,q,r,g=map(int,input().split())
    a[p].append([q,r])
    a[q].append([p,r])
    b[p].append([q,g])
    b[q].append([p,g])
def f(x,r):
    p=[float("INF")]*(n+1)
    p[x],q=0,[[0,x]]
    while q:
        y,z=heappop(q)
        for i in r[z]:
            if p[i[0]]>y+i[1]:
                p[i[0]]=y+i[1]
                heappush(q,[y+i[1],i[0]])
    return p
s1,t1=f(s,a),f(t,b)
q=np.array(s1[1:])+np.array(t1[1:])
q=q.tolist()
for i in range(n):
    print(10**15-min(q))
    q=q[1:]

### FIXED CODE ###

from heapq import heappush,heappop
n,m,s,t=map(int,input().split())
a,b=[[]for i in range (n+1)],[[]for i in range(n+1)]
for i in range(m):
    p,q,r,g=(int(i) for i in input().split())
    a[p].append((q,r))
    a[q].append((p,r))
    b[p].append((q,g))
    b[q].append((p,g))
def f(x,r):
    p=[float("inf")for i in range(n+1)]
    p[x],q=0,[[0,x]]
    while q:
        y,z=heappop(q)
        for i,j in r[z]:
            if p[i]>y+j:
                p[i]=y+j
                heappush(q,[p[i],i])
    return p
s1,t1,p=f(s,a),f(t,b),[]
for i in range(1,n+1):
    p.append((s1[i]+t1[i],i))
p,e=sorted(p),0
for i in range(n):
    while p[e][1]<=i: e+=1
    print(10**15-p[e][0])
### BUGGY CODE ###

n,m = map(int, input().split())
x = list(sorted(map(int, input().split())))
l = [0] * (m-1)
ans = 0
if n < m:
  for i in range(m-1):
    l[i] = x[i+1] - x[i]
  for _ in range(m-n):
    ans += min(l)
    l.pop(l.index(min(l)))
print(ans)

### FIXED CODE ###

n,m = map(int, input().split())
x = sorted(list(map(int, input().split())))
l = [0] * (m-1)
if n >= m:
  print(0)
  exit()
else:
  for i in range(m-1):
    l[i] = x[i+1] - x[i]
  print(sum(sorted(l)[:m-n]))
### BUGGY CODE ###

N = int(input())
L = list(map(int,input().split()))
L.append(0)

for i in range(N) :
    T = list(L)
    T.pop(i)
    d = 0
    for j in range(N-1) :
        d += abs(T[j+1]-T[j])
    d += abs(T[0])
    print(d)


### FIXED CODE ###

N = int(input())
L = list(map(int,input().split()))
L = [0]+L+[0]
All = 0
for i in range(N+1) :
    All += abs(L[i]-L[i+1])
for i in range(1,N+1) :
    ans = All + abs(L[i-1]-L[i+1]) - (abs(L[i-1]-L[i]) + abs(L[i]-L[i+1]))
    print(ans)
### BUGGY CODE ###

N = int(input())

ans = N-1

def get_steps(a, b):
    return (a-1) + (b-1)


for i in range(1, N//2+1):
    if N % i == 0:
        d = N // i
        ans = min(ans, get_steps(i, d))

print(ans)

### FIXED CODE ###

N = int(input())

ans = N-1

def get_steps(a, b):
    return (a-1) + (b-1)


for i in range(1, int(N**0.5)+1):
    if N % i == 0:
        d = N // i
        ans = min(ans, get_steps(i, d))

print(ans)
### BUGGY CODE ###




n,k = map(int,input().split())
a = [0 for _ in range(n)]
b = [0 for _ in range(n)]
c = [[0 for _ in range(n)] for _ in range(n)]

for i in range(n - 1):
	A,B = map(int,input().split())
	a[i] = A
	b[i] = B
	c[A - 1][B - 1] = 1
	c[B - 1][A - 1] = 1

pat = k
pat_arr = [0 for _ in range(n)]
pat_arr[0] = k
queue = [0]

while(queue):
	pos = queue.pop(0)
	num = k-2
	if(pos == 0):num += 1
	
	for i in range(n):
		if(c[pos][i] == 0 or pat_arr[i] != 0):continue
		queue.append(i)
		pat_arr[i] = num
		pat *= num
		num -= 1
		
		
print(pat % 1000000007)

### FIXED CODE ###

n,k = map(int,input().split())
#a = [0 for _ in range(n)]
#b = [0 for _ in range(n)]
c = [[] for _ in range(n)]

for i in range(n - 1):
	A,B = map(int,input().split())
	#a[i] = A
	#b[i] = B
	c[A - 1].append(B - 1)
	c[B - 1].append(A - 1)

pat = k
pat_arr = [0 for _ in range(n)]
pat_arr[0] = k
queue = [0]



while(queue):
	pos = queue.pop(0)
	num = k-2
	if(pos == 0):num += 1
	
	for i in c[pos]:
		if(pat_arr[i] != 0):continue
		queue.append(i)
		pat_arr[i] = num
		pat *= num
		pat %= 1000000007
		num -= 1
		
		
print(pat % 1000000007)
### BUGGY CODE ###

n = list(map(int,input().split()))
A = list(map(int,input().split()))
ans = 1
for a in A:
  ans  = ans * a

if ans > 10**18:
  print(-1)
else:
  print(ans)


### FIXED CODE ###

n = list(map(int,input().split()))
A = list(map(int,input().split()))
A.sort()
ans = 1
for a in A:
  ans  = ans * a
  if ans > 10**18:exit(print(-1))

print(ans)
### BUGGY CODE ###

s = input()
t = input()
S = (len(s)+1)
T = (len(t)+1)

dp = [[0]*T for i in range(S)]

for i in range(1, S):
   for j in range(1, T):
       dp[i][j] = max(dp[i-1][j], dp[i][j-1])
       if s[i-1] == t[j-1]:
           dp[i][j] = max(dp[i][j], dp[i-1][j-1] + 1)

# print(dp[len(s)][len(t)])

ans = ""
i = len(s)
j = len(t)
while i > 0 and j > 0:
    if dp[i][j] == dp[i-1][j]:
        i -= 1
    elif dp[i][j] == dp[i][j-1]:
        j -= 1
    else:
        ans += s[i-1]
        i -= 1
        j -= 1
    
print(ans[::-1])


### FIXED CODE ###

s = input()
t = input()
S = (len(s)+1)
T = (len(t)+1)

dp = [[0]*T for i in range(S)]

for i in range(1, S):
   for j in range(1, T):
       dp[i][j] = max(dp[i-1][j], dp[i][j-1])
       if s[i-1] == t[j-1]:
           dp[i][j] = max(dp[i][j], dp[i-1][j-1] + 1)

# print(dp[len(s)][len(t)])

ans = ""
i = len(s)
j = len(t)
while i > 0 and j > 0:
    if dp[i][j] == dp[i-1][j]:
        i -= 1
    elif dp[i][j] == dp[i][j-1]:
        j -= 1
    else:
        ans += s[i-1]
        i -= 1
        j -= 1
    
print(ans[::-1])
### BUGGY CODE ###

import bisect

N = int(input())
A = list(map(int, input().split()))
ans, d = 0, dict()

for i in range(N):
    diff = A[i] + A[0] - i 
    if d.get(diff) == None:
        d[diff] = [i]
    else:
        d[diff].append(i)

diff = 0
if d.get(0) != None:
    ans += len(d[0])

for i in range(1, N):
    diff -= A[i] - A[i-1] + 1
    dl = d.get(diff) 
    if dl != None:
        index = bisect.bisect_right(dl, i)        
        d[diff] = d[diff][index:]
        ans += len(d[diff])

print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
ans, d = 0, dict()

for i in range(N):
    key = A[i] + i
    if d.get(key) == None:
        d[key] = 1
    else:
        d[key] += 1
    
    key = i - A[i]
    if d.get(key) != None:
        ans += d[key]

print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = sorted(zip(B, A))
B, A = zip(*C)
D = sorted((a, i) for i, a in enumerate(A))
E, indices = zip(*D)
for e, b in zip(E, B):
  if e > b:
    print("No")
    exit()
S = set()
now = 0
while len(S) < n-1:
  S.add(now)
  if indices[now] in S:
    print("Yes")
    exit()
  noe = indices[now]
for i in range(n):
  if E[i+1] <= B[i]:
    print("Yes")
    exit()
print("No")

### FIXED CODE ###

import sys
input = sys.stdin.readline

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = sorted(zip(B, A))
B, A = zip(*C)
D = sorted((a, i) for i, a in enumerate(A))
E, indices = zip(*D)
for e, b in zip(E, B):
  if e > b:
    print("No")
    exit()
S = {0}
now = 0
for _ in range(n-1):
  if indices[now] in S:
    print("Yes")
    exit()
  now = indices[now]
  S.add(now)
for i in range(n-1):
  if E[i+1] <= B[i]:
    print("Yes")
    exit()
print("No")
### BUGGY CODE ###

R,G,B,N = map(int, input().split())

count = 0

for r in range(3001):
    for g in range(3001):
        redball = r*R
        greenball = g*G
        tempbull = N - (redball + greenball)
        
        if (redball >= 0) and (greenball >= 0) and (tempbull >= 0):
            if (redball + greenball + tempbull == N) and (tempbull % B == 0):
                count = count + 1

print(count)

### FIXED CODE ###

R,G,B,N = map(int, input().split())

count = 0

for r in range(3001):
    for g in range(3001):
        redball = r*R
        greenball = g*G
        tempbull = N - (redball + greenball)
        
        if (redball >= 0) and (greenball >= 0) and (tempbull >= 0):
            if (redball + greenball + tempbull == N) and (tempbull % B == 0):
                count = count + 1

print(count)