Harryxun/stf_run huggingface dataset:
import statistics
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
nums = list(map(int, input().split()))
lcm = lcm_list(nums)

# print(nums, lcm)
sum =0
for num in nums:
    sum += (lcm-1)%num
print(sum)


### FIXED CODE ###

import statistics
import math
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
nums = list(map(int, input().split()))
lcm = lcm_list(nums)

# print(nums, lcm)
sum =0
for num in nums:
    sum += (lcm-1)%num
print(sum)
N,M = [int(s) for s in input().split()]
pre_lst=[]
for i in range(N):
  a,b = [int(s) for s in input().split()]
  pre_lst=lst+[[a,b,a*b]]
lst = sorted(pre_lst, lambda=x: x[0])
m=0
i=0
cost=0
while(m<M):
  m+=lst[i][1]
  cost+=lst[i][2]
  i+=1
if(m>M):
  cost-=lst[i-1][0]*(m-M)
print(cost)

### FIXED CODE ###

n, m = map(lambda x: int(x), input().split())
drinks = []
for _ in range(n):
    a, b = map(lambda x: int(x), input().split())
    drinks.append((a, b))
    
sorted_drinks = sorted(drinks, key=lambda x: x[0])

num_drinks = 0
sum_prices = 0
for price, num in sorted_drinks:
    num_drinks += num
    sum_prices += num * price
    if num_drinks > m:
        sum_prices -= (num_drinks - m) * price
        break
    elif num_drinks == m:
        break

print(sum_prices)
a=int(input())
b=int(input())
result=(a*b,2*(a+b))
print(result)

### FIXED CODE ###

a,b=list(map(int,input().split()))
print(a*b,2*(a+b))
n = int(input())
a = int(input())
n = n - 500*(n//500)
if n =< a:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n = int(input())
a = int(input())
n = n - 500*(n//500)
if n <= a:
    print('Yes')
else:
    print('No')
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

a, b, c, d = [int(x) for x in input().split()]
e = lcm(c, d)

ac = (a-1) // c
ad = (a-1) // d
ae = (a-1) // e
bc = b // c
bd = b // d
be = b // e
print((b-a+1) - ((bc + bd - be) - (ac + ad - ae)))


### FIXED CODE ###

import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

a, b, c, d = [int(x) for x in input().split()]
e = lcm(c, d)

ac = (a-1) // c
ad = (a-1) // d
ae = (a-1) // e
bc = b // c
bd = b // d
be = b // e
print((b-a+1) - ((bc + bd - be) - (ac + ad - ae)))
A=int(input())
P=int(input())
print((3*A+P)//2)

### FIXED CODE ###

A,P= map(int, input().split())
print((3*A+P)//2)
x,k,d = map(int, input().split())
mx = x + d*k
mn = x - d*k
 
if (x <= 0 and mx > 0) or (x >= 0 and mn < 0):
  if k%2 == 0:
    if x < 0:
      b = min(abs(abs(x)%(2*d)),abs(abs(x)%(2*d)-2*d))
    else:
      b = min(abs(x%(2*d)),abs(x%(2*d)-2*d))
    b = min(abs(b),abs(mx),abs(mn))
  else:
    if x > 0:
      b = min(abs(abs(x-d)%(2*d)),abs(abs(x-d)%(2*d)-2*d))
    else:
      b = min(abs(abs(x+d)%(2*d)),abs(abs(x+d)%(2*d)-2*d))
  ans = min(abs(b),abs(mx),abs(mn))
else:
  ans = min(abs(mx),abs(mn))
print (ans)

### FIXED CODE ###

s = input()

if s == 'RSR':
  print (1)
else:
  print (s.count('R'))
N,M=map(int,input().split())

x=[0 for _ in range(N)]
gp=[i for i in range(N)]

for _ in range(M):
    l,r,d=map(int,input().split())
    if(gp[l-1]==gp[r-1]):
        if(x[r-1]-x[l-1]!=d):
            print('No')
            break
    else:
        if(gp.count(gp[l-1])<gp.count(gp[r-1])):
            from_gp=gp[l-1]
            to_gp=gp[r-1]
        else:
            from_gp=gp[l-1]
            to_gp=gp[r-1]
        x=[x_+d+gp[l-1] if gp[i]==gp[r-1] else x_ for i,x_ in enumerate(x)]
        gp=[to_gp if gp_==from_gp else gp_ for gp_ in gp]
        if(max(x)>100000):
            print('No')
            break
else:
    print('Yes')

### FIXED CODE ###

import numpy as np

N=int(input())

a=[[],[]]
a[0]=list(map(int,input().split()))
a[1]=list(map(int,input().split()))

s=np.array(a)

s[1]=np.cumsum(s[1][::-1])[::-1]

s[0][-1]+=s[1][-1]

for i in range(N-2,-1,-1):
    s[0][i]+=max(s[1][i],s[0][i+1])
print(s[0][0])
n,q = (int(i) for i in input().split())
s = input()

for i in range(q):
    l,r = (int(i) for i in input().split())
    cnt =  s.count('AC',l-1,r)
    print(cnt)

### FIXED CODE ###

dic = {"A":"T","C":"G","T":"A","G":"C"}
print(dic[input()])
situation = input()

if situation == AAA or situation == BBB:
  print(No)
else:
  print(Yes)

### FIXED CODE ###

S = input()
if S[0] == S[1] and S[1] == S[2]:
  print("No")
else:
  print("Yes")
1.# -*- coding: utf-8 -*-
2."""
3.Created on Wed Dec 20 11:35:39 2017
4. 
5.@author: kotania
6."""
7. 
8.s = input()
9. 
10.print(int(s[0])+int(s[1])+int(s[2]))



### FIXED CODE ###

s = input()
 
print(int(s[0])+int(s[1])+int(s[2]))
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

R, C, K = MI()
item = {(0,0):0}

for i in range(K):
    r_, c_, v_, = MI()
    item[(r_ - 1,c_ - 1)] = v_

dp = [[[0 for _ in range(C + 2)] for _ in range(R + 2)] for _ in range(4)]

for i in range(R + 1):
    for j in range(C + 1):
        for k in range(4):
            a = dp[i][j][k]
            if (i,j) in item:
                v = item[(i,j)]
            else:
                v = 0

            if k == 3:
                dp[0][i + 1][j] = max(a, dp[0][i + 1][j])
                continue
            dp[0][i + 1][j] = max(a, a + v, dp[0][i + 1][j])
            dp[k][i][j + 1] = max(a, dp[k][i][j + 1])
            dp[k + 1][i][j + 1] = max(a + v, dp[k + 1][i][j + 1])

print(max(dp[0][R][C], dp[1][R][C], dp[2][R][C], dp[3][R][C]))


### FIXED CODE ###

import sys
import math
from collections import defaultdict
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def main():
    R, C, K = NMI()
    item = [[0] * (C + 1) for i in range(R + 1)]

    for i in range(K):
        r_, c_, v_, = NMI()
        item[r_ - 1][c_ - 1] = v_

    dp = [[[0 for _ in range(C + 2)] for _ in range(R + 2)] for _ in range(4)]

    for i in range(R + 1):
        for j in range(C + 1):
            for k in range(4):
                a = dp[k][i][j]
                v = item[i][j]

                if k == 3:
                    dp[0][i + 1][j] = max(a, dp[0][i + 1][j])
                    continue
                dp[0][i + 1][j] = max(a, a + v, dp[0][i + 1][j])
                dp[k][i][j + 1] = max(a, dp[k][i][j + 1])
                dp[k + 1][i][j + 1] = max(a + v, dp[k + 1][i][j + 1])

    print(max(dp[0][R][C], dp[1][R][C], dp[2][R][C], dp[3][R][C]))

if __name__ == "__main__":
    main()
from scipy.special import comb
import math
mod = 10**9 + 7

N, M = map(int, input().split())
if abs(N - M) > 1:
    print(0)
else:
    if abs(N - M) == 1:
        print(((math.factorial(N) % mod) * (math.factorial(M) % mod)) % mod)
    else:
        print(((math.factorial(N) % mod) * ((math.factorial(M) * 2) % mod)) % mod)

### FIXED CODE ###

from scipy.misc import comb
import math
mod = 10**9 + 7

N, M = map(int, input().split())
if abs(N - M) > 1:
    print(0)
else:
    if abs(N - M) == 1:
        print(((math.factorial(N) % mod) * (math.factorial(M) % mod)) % mod)
    else:
        print(((math.factorial(N) % mod) * ((math.factorial(M) * 2) % mod)) % mod)
a, b, c, d = map(int, input().split())
if c // b >= a // d:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s, w = map(int, input().split())
if s > w:
    print('safe')
else:
    print('unsafe')
RRRLLRLLRRRLLLLL

### FIXED CODE ###

import copy
S = input()
Slen = len(S)

Sc=[0]*Slen
for i in range(Slen):
    if S[i:i+2] == 'RL':
        for j in range(i,-1,-1):
            if S[j]=='R':
                Sc[(i-j)%2 + i] += 1
            else:
                break
        for j in range(i+1,Slen):
            if S[j] == 'L':
                Sc[(j-i)%2 +i] += 1
            else:
                break    

print(" ".join(map(str,Sc)))
x, y = map(int, input().split())

MOD = int(1.0e+9 + 7)
DP_max = 3333334

DP = []
if(2 * y - x) % 3 != 0 or (2 * x - y) % 3 != 0:
    print(0)

if(2 * y - x) < 0 or (2 * x - y) < 0:
    print(0)

X = int((2 * y - x) / 3)
Y = int((2 * x - y) / 3)

for i in range(X + 1):
    DP.append([1])

for i in range(Y + 1):
    DP[0].append(1)


for i in range(1, X + 1):
    for j in range(1, Y + 1):
        DP[i].append((DP[i][j - 1] + DP[i - 1][j]) % MOD)

print(DP[X][Y])


### FIXED CODE ###

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

MOD = int(1.0e+9 + 7)
DP_max = 3333334

DP = []

X = int((2 * y - x) / 3)
Y = int((2 * x - y) / 3)

def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 10 ** 9 + 7
N = 10 ** 6  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

if((2 * y - x) % 3 != 0 or (2 * x - y) % 3 != 0 or
   (2 * y - x) < 0 or (2 * x - y) < 0):
    print(0)
else:
    print(cmb(X + Y, Y, MOD))
S = input()
	T = input()
	if S == T[:-1]:
		print("Yes")
	else:
		print("No")

### FIXED CODE ###

S = input()
T = input()
if S == T[:-1]:
	print("Yes")
else:
	print("No")
for i in range(0,7):
 a,b=map(int,input(),split())
 print(a-b)

### FIXED CODE ###

for i in range(7):
 a,b=map(int,input().split())
 print(a-b)
n,m=map(int,input().split())
sc=[list(map(int,input().split())) for _ in range(m)]
if n==1:
    c0=sc[0][1]
    for i in range(m):
        s=sc[i][0]
        c=sc[i][1]
        if c!=c0:
            print(-1)
            exit()
    print(c0)
    exit()
else:
    ans=10**5
    for i in range(10**(n-1),10**n):
        I=str(i)
        flag=True
        for j in range(m):
            s,c=sc[j][0],sc[j][1]
            if s==1 and c==0:
                print(-1)
                exit()
            if I[s-1]!=str(c):
                flag=False
                continue
        if flag:
            ans=min(ans,i)
    if ans==10**5:
        print(-1)
    else:
        print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
sc=[list(map(int,input().split())) for _ in range(m)]
for i in range(10**n):
    ans=str(i)
    if len(ans)==n and all(ans[s-1]==str(c) for s,c in sc):
        print(ans)
        exit()
print(-1)
import fractions

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

a_re = []
b_re = []

for i in range(max(A,B)//2 +1):
    if i == 0:
        continue
    if A % i ==0:
        a_re.append(i)
    if B % i ==0:
        b_re.append(i)

result = list (set(a_re) & set( b_re))
if len(result) == 0:
    print(1)
    exit(0)

result.sort(reverse=True)
print(result[K-1])


### FIXED CODE ###

import fractions

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

a_re = []
b_re = []

for i in range(max(A,B) + 1):
    if i == 0:
        continue
    #print(i)
    if A % i ==0:
        a_re.append(i)
    if B % i ==0:
        b_re.append(i)
#print(a_re)

result = list (set(a_re) & set( b_re))

result.sort(reverse=True)
print(result[K-1])
N,X = map(int, input().split())
L_i = list(map(int, input().split()))

D=[0, 0]
count=1
for n in range(N+1):
  D[1] = D[0] + L_i[n]
  if D[1] <= X:
    count += 1
    D[0] = D[1]
  else:
    break

print(count)

### FIXED CODE ###

N,X = map(int, input().split())
L_i = list(map(int, input().split()))

D=[0, 0]
count=1
for n in range(N):
  D[1] = D[0] + L_i[n]
  if D[1] <= X:
    count += 1
    D[0] = D[1]
  else:
    break

print(count)
r=range
v=input()
l=[i+" "+str(j)for i in"SHCD" for j in r(1,14)]
for i in r(int(v):l.remove(v)
for i in l:print(i)

### FIXED CODE ###

r=range
v=input
l=[i+" "+str(j)for i in"SHCD" for j in r(1,14)]
for i in r(int(v())):l.remove(v())
for i in l:print(i)
a,b=map(int,input().split())
count = 0
for i in range(a,b):
  if i[0]==i[4] and i[1]==i[3]:
    count+=1
print(count)

### FIXED CODE ###

a,b=map(int,input().split())
count = 0
for i in range(a,b+1):
  if str(i)[0]==str(i)[4] and str(i)[1]==str(i)[3]:
    count+=1
print(count)
a=int(input())
for i in range(1,500001):
    if int(i*1.08)==a:
        print(i)
        break
else:
      print(':(')

### FIXED CODE ###

a=list(map(int,input().split()))
b=list(map(int,input().split()))
if a[0]!=b[0]:
    print('1')
else:
    print('0')
from collections import Counter
n=int(input())
v=list(map(int,input().split()))
a=Counter(v[0::2]).most_common()
b=Counter(v[1::2]).most_common()

if a[0][0]!=b[0][0]:
    print(n-(a[0][1]+b[0][1]))
else:
    print(min(n-(a[1][1]+b[0][1]),n-(a[0][1]+b[1][1])))

### FIXED CODE ###

from collections import Counter
n=int(input())
v=list(map(int,input().split()))
a=Counter(v[0::2]).most_common()
b=Counter(v[1::2]).most_common()
a.append([0,0])
b.append([0,0])
if a[0][0]!=b[0][0]:
    print(n-(a[0][1]+b[0][1]))
else:
    print(min(n-(a[1][1]+b[0][1]),n-(a[0][1]+b[1][1])))
n = int(input())
a = int(input())
b = int(input())
 
if n == 1:
    print("Hello World")
    exit()
else:
    print(a + b)
    exit()

### FIXED CODE ###

n = int(input())
if n == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a + b)  
exit()
n,k=map(int,input().split())
h=[input() for _ in range(n)]
h=sorted(h)
l=[]
for i in range(n-k+1):
  l.append(h[i+k-1]-h[i])
print(min(l))

### FIXED CODE ###

n,k=map(int,input().split())
h=[int(input()) for _ in range(n)]
h=sorted(h)
l=[]
for i in range(n-k+1):
  l.append(h[i+k-1]-h[i])
print(min(l))
S = input()
N = len(S)
ans = 0
for i in range(2 ** (N - 1)):
    signs = bin(i)[2:].zfill(N - 1).replace('0', '+').replace('1', ' ')

    tmp_s = S[0]
    for j, sign in enumerate(signs):
        tmp_s += sign + S[j + 1]

    ans += eval(tmp_s.replace(' ', ''))

print(ans)


### FIXED CODE ###

S = input()
N = len(S)

if N == 1:
    print(S)
    exit()

ans = 0
for i in range(2 ** (N - 1)):
    signs = bin(i)[2:].zfill(N - 1).replace('0', '+').replace('1', ' ')

    tmp_s = S[0]
    for j, sign in enumerate(signs):
        tmp_s += sign + S[j + 1]

    ans += eval(tmp_s.replace(' ', ''))

print(ans)
import sys

stdin = sys.stdin


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


def naa(N): return [na() for _ in range(N)]


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


N = ni()
A_array = na()

A = 0

for a in A_array:
    A = A ^ a

ans_array = [A ^ a for a in A_array]

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


### FIXED CODE ###

import sys

stdin = sys.stdin


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


def naa(N): return [na() for _ in range(N)]


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


N = ni()
A_array = na()

A = 0

for a in A_array:
    A = A ^ a

ans_array = [A ^ a for a in A_array]

print(" ".join(map(str, ans_array)))
sum = 0
while 1:
   x, y = map(int, raw_input().split())
   sum = sum + 1
   a = max(x, y)
   b = min(x, y)
   if x == '0' and y == '0':
      break
   print '%s %s' %(b, a)

### FIXED CODE ###

while 1:
   x, y = map(int, raw_input().split())
   if x == 0 and y == 0:
      break
   elif x > y:
      print '%s %s' % (y,x)
   else:
      print '%s %s' % (x,y)
h = int(input())
count = 0
def dfs(h):
    global count
    count += 1
    if h == 1:
        quit()
    else:
            dfs(h//2)
            dfs(h//2)

dfs(h)
print(count)

### FIXED CODE ###

h,a = map(int, input().split())
count = 0

while h > 0:
  h -= a
  count += 1

print(count)
N=int(input())
print((N*(N-1)//2)

### FIXED CODE ###

N=int(input())
print((N*(N-1)//2))
while True:
    try:
        l = map(int, raw_input().split())
        l1 = [int(i) for i in l]
        sum = (l1[0] + l1[1])
        import math
        print(int(math.log10(sum) + 1))
    except EOFError:
        break

### FIXED CODE ###

while True:
    try:
        a,b = map(int, input().split())
        print(len(str(a+b)))
    except EOFError:
        break
a, b = map(input())
if a == 'H':
    if b == 'H':
        print('H')
    else:
        print('D')
else:
    if b == 'H':
        print('D')
    else:
        print('H')

### FIXED CODE ###

a, b = input().split()
if a == 'H':
    if b == 'H':
        print('H')
    else:
        print('D')
else:
    if b == 'H':
        print('D')
    else:
        print('H')
a, b, c = map(int, input().split())
if a+b =< c:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b,c = map(int, input().split())
if a + b < c:
    print("No")
else:
    print("Yes")
a,b=map(int,input().split())
print(a*b,2*a+2*b);

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b,2*a+2*b);
# coding:utf-8

def comb(n, r):
    n, r = max(n, r), min(n, r)
    nume = 1
    deno = 1
    for i in range(n-r+1, n+1):
        nume *= i
    for i in range(1, r+1):
        deno *= i
    return int(nume/deno)

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

MAX = 0
n = 0
r = 0
for ni in range(0, len(a)):
    for ri in range(ni + 1, len(a)):
        buf = comb(a[ni], a[ri])
        if buf > MAX:
            MAX = buf
            n = a[ni]
            r = a[ri]

print(n, r)

### FIXED CODE ###

# coding:utf-8

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

MAX = 0
n = a.pop(0)
b = [abs(i - n / 2) for i in a]
r = a[b.index(min(b))]
print(n, r)
fig = []
h,w  = map(int,input().split())
for i in range(h):
    fig.append(list(str(input())))
    
fig_2 = []

for i in range(h):
    fig_2.append(fig[i])
    fig_2.append(fig[i])
    
for i in range(len(fig_2)):
    onetime = ''
    for j in range(fig_2[i]):
        onetime = onetime + fig_2[i][j]
    print(onetime)
    

### FIXED CODE ###

fig = []
h,w  = map(int,input().split())
for i in range(h):
    fig.append(list(str(input())))
    
fig_2 = []

for i in range(h):
    fig_2.append(fig[i])
    fig_2.append(fig[i])
    
for i in range(len(fig_2)):
    onetime = ''
    for j in range(len(fig_2[i])):
        onetime = onetime + fig_2[i][j]
    print(onetime)
N = int(input())
ts = []
for _ in range(N):
    x, l = map(int,input().split())
    t = min(x+l,10**9)
    s = max(x-l,0)
    ts.appned([t,s])

ts.sort()

tmp = 0
count = 0
for n in ts:
    if tmp<=n[1]:
        count += 1
        tmp = n[0]

print(count)


### FIXED CODE ###

n = int(input())
robotList=[]
for i in range(n):
  x,l = map(int,input().split())
  s = max(x-l,0)
  t = min(10**9,x+l)  
  robotList.append([t,s])
  
robotList.sort()

count = 0
tmp = 0
for robot in robotList:
  if robot[1] >= tmp:
    count += 1
    tmp = robot[0]

print(count)
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
tmp = 1000000
ans = 0

for i in range(n):
  c = t - h[i] * 0.006
  d = a - c
  if d < 0:
    d = -d
  if d < tmp:
    tmp = d
    ans = i + 1
print(ans)

### FIXED CODE ###

X,Y = map(int, input().split())
print(int (X + Y/2))
import re
sin = input()
match = re.findall(r'[ACTG]+',sin)
m_len = [len(m) for m in match]
print(max(m_len))

### FIXED CODE ###

import re
sin = input()
match = re.findall(r'[ACTG]+',sin)
m_len = [len(m) for m in match]
print(max(m_len if m_len else '0'))
memTime = int(input())
memLate = input().split()
memLate = [int(i) for i in memLate]
colorList = []
memColor = 0
highLate = 0
for color in memLate:
    if color // 400 >= 8:
        highLate += 1
    elif color // 400 in colorList == False
        colorList += color // 400
maxColor = len(colorList) + highLate
if maxColor > 7:
    maxColor = 7
print(str(len(colorList)) + " " + str(maxColor))

        

### FIXED CODE ###

memTime = int(input())
memLate = input().split()
memLate = [int(i) for i in memLate]
colorList = []
memColor = 0
highLate = 0
for color in range(memTime):
    member = memLate[color]
    if member // 400 >= 8:
        highLate += 1
    elif ((member // 400) in colorList) == False:
        colorList.append(member // 400)
maxColor = len(colorList) + highLate
minColor = len(colorList)
if minColor == 0:
    minColor = 1
print(str(minColor) + " " + str(maxColor))
from bisect import bisect_left
n,k = map(int,input().split( ))
a = list(map(int, input().split( )))
ans = 0
for i in range(n):
    #if a[i]%k==1:
    #    ans+=1
    a[i] -= 1
sm= 0
a_sm = [0]
for i in range(n):
    sm += a[i]
    sm%=k
    a_sm.append(sm)
#print(a_sm)
dic = {i:[] for i in range(n)}
for i in range(n+1):
    dic[a_sm[i]].append(i)
#print(dic)
for i in range(n):
    for j in range(len(dic[i])-1):
        dm = bisect_left(dic[i],dic[i][j]+k)
        #print(ans)
        #print(i,j,dm)
        ans += dm - j-1
        #print("test",ans)
       
print(ans)

### FIXED CODE ###

from bisect import bisect_left
n,k = map(int,input().split( ))
a = list(map(int, input().split( )))
ans = 0
for i in range(n):
    a[i] -= 1
sm= 0
a_sm = [0]
for i in range(n):
    sm += a[i]
    sm%=k
    a_sm.append(sm)

dic = {}
for i in range(n+1):
    if a_sm[i] in dic:
        dic[a_sm[i]].append(i)
    else:
        dic[a_sm[i]]=[i]

for t in dic:
    for j in range(len(dic[t])-1):
        dm = bisect_left(dic[t],dic[t][j]+k)
        ans += dm - j - 1

       
print(ans)
D, G = [int(n) for n in input().split()]

score_table = []
for i in range(1, D+1):
    p, c = [int(n) for n in input().split()]
    score_table.append([i*100, p, c])

min_count = sum([l[1] for l in score_table])
#print(min_count)

for bit in range(1<<D):
    score = 0
    count = 0

    for i in range(D):
        if bit & (1<<i):
            score += score_table[i][0] * score_table[i][1] + score_table[i][2]
            count += score_table[i][1]
    
    if score >= G:
        min_count = min(min_count, count)
    else:
        additional = []
        for j in range(D):
            if not bit & (1<<j):
                additional.append(score_table[j])
        
        additional_ = sorted(additional, key=lambda x:x[0], reverse=True)
        #print(additional_)
        
        for i in additional_:
            if i[1] > 1:
                add_score = i
                break

        #add_score = additional_[0]

        for k in range(add_score[1]-1):
            score += add_score[0]
            count += 1
            if score >= G:
                min_count = min(min_count, count)

print(min_count)

### FIXED CODE ###

D, G = [int(n) for n in input().split()]

score_table = []
for i in range(1, D+1):
    p, c = [int(n) for n in input().split()]
    score_table.append([i*100, p, c])

min_count = sum([l[1] for l in score_table])
#print(min_count)

for bit in range(1<<D):
    score = 0
    count = 0

    for i in range(D):
        if bit & (1<<i):
            score += score_table[i][0] * score_table[i][1] + score_table[i][2]
            count += score_table[i][1]
    
    if score >= G:
        min_count = min(min_count, count)
    else:
        additional = []
        for j in range(D):
            if not bit & (1<<j):
                additional.append(score_table[j])
        
        additional_ = sorted(additional, key=lambda x:x[0], reverse=True)
        #print(additional_)
        
        # for i in additional_:
        #     if i[1] > 1:
        #         add_score = i
        #         break

        add_score = additional_[0]

        for k in range(add_score[1]-1):
            score += add_score[0]
            count += 1
            if score >= G:
                min_count = min(min_count, count)

print(min_count)