Harryxun/stf_run huggingface dataset:
from math import sqrt
x1, y1, x2, y2 = map(int, input().split())
print(sqrt((x2-x1)**2 + (y2-y1)**2))

### FIXED CODE ###

from math import sqrt
x1, y1, x2, y2 = map(float, input().split())
print(sqrt((x2-x1)**2 + (y2-y1)**2))
N =input()
print(int(N+1)/2)

### FIXED CODE ###

N = input()
print(int((int(N)+1)/2))
weathers = [
   'Sunny',
   'Cloudy',
   'Rainy'
]

  s = str(input())

  index = 0
  next_index = 0

  for w in weathers:
    if w == s:
      next_index = (index + 1) % 3
      break
      else:
        index += 1

  print(weathers[next_index])

### FIXED CODE ###

if __name__ == '__main__':
    weathers = [
        'Sunny',
        'Cloudy',
        'Rainy'
    ]

    s = str(input())

    index = 0
    next_index = 0

    for w in weathers:
        if w == s:
            next_index = (index + 1) % 3
            break
        else:
            index += 1

    print(weathers[next_index])
n = input()
A = list(map(int,input().split()))
count = 0
while all(a % 2 == 0 for a in A):
  A = [a/2]
  count += 1
print(count)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
 
i = 0
odd = 0
while odd == 0:
    for n in range(N):
        if a[n] % 2 == 0:
            a[n] /= 2
        else:
            odd = 1
            break
    if odd == 0:
        i += 1
print(i)
import numpy as np
import sys
input = sys.stdin.readline
INF = 9223372036854775808


def calc_score(D, C, S, T):
    """
    開催日程Tを受け取ってそこまでのスコアを返す
    コンテストi 0-indexed
    d 0-indexed
    """
    score = 0
    last = [0]*26  # コンテストiを前回開催した日
    for d, t in enumerate(T):
        last[t] = d + 1
        for i in range(26):
            score -= (d + 1 - last[i]) * C[i]
        score += S[d][t]
    return score


def evaluate(D, C, S, T, k):
    """
    d日目終了時点での満足度を計算し，
    d + k日目終了時点での満足度の減少も考慮する
    """
    score = 0
    last = [0]*26
    for d, t in enumerate(T):
        last[t] = d + 1
        for i in range(26):
            score -= (d + 1 - last[i]) * C[i]
        score += S[d][t]

    for d in range(len(T), min(len(T) + k, D)):
        for i in range(26):
            score -= (d + 1 - last[i]) * C[i]
    return score


def update_score(D, C, S, T, score, ct, ci):
    """
    ct日目のコンテストをコンテストciに変更する
    スコアを差分更新する

    ct: change t 変更日 0-indexed
    ci: change i 変更コンテスト 0-indexed
    """
    last = [0]*26  # コンテストiを前回開催した日
    for d in range(ct):
        last[T[d]] = d + 1
    prei = T[ct]  # 変更前に開催する予定だったコンテストi
    score -= S[ct][prei]
    score += S[ct][ci]
    for d in range(ct, D):
        if d != ct and T[d] == prei:
            break
        score += C[prei]*(d + 1 - ct - 1)
        score -= C[prei]*(d + 1 - last[prei])
    for d in range(ct, D):
        if d != ct and T[d] == ci:
            break
        score += C[ci]*(d + 1 - last[ci])
        score -= C[ci]*(d + 1 - ct - 1)
    T[ct] = ci
    return score, T


def greedy(D, C, S):
    Ts = []
    for k in range(9, 14):
        T = []  # 0-indexed
        max_score = -INF
        for d in range(D):
            # d+k日目終了時点で満足度が一番高くなるようなコンテストiを開催する
            best_i = 0
            for i in range(26):
                T.append(i)
                score = evaluate(D, C, S, T, k)
                if max_score < score:
                    max_score = score
                    best_i = i
                T.pop()
            T.append(best_i)
        Ts.append((max_score, T))
    res = max(Ts, key=lambda pair: pair[0])[1]
    return res


if __name__ == '__main__':
    D = int(input())
    C = np.array([int(i) for i in input().split()])
    S = np.array([[int(i) for i in input().split()] for j in range(D)])
    T = greedy(D, C, S)
    for t in T:
        print(t+1)


### FIXED CODE ###

from random import randint
import sys
input = sys.stdin.readline


def main(D, C, S):
    for _ in range(D):
        print(randint(1, 26))


if __name__ == '__main__':
    D = int(input())
    C = [int(i) for i in input().split()]
    S = [[int(i) for i in input().split()] for j in range(D)]
    main(D, C, S)
import numpy as np

A = int(input())

candidates = np.arange(A // 2) + 1
candidates = candidates[A % candidates == 0]

distances = (A // candidates) - 1 + candidates - 1

print(np.min(distances))

### FIXED CODE ###

import numpy as np

A = int(input())

tmp = int(np.floor(np.sqrt(A)))
for i in range(tmp):
    if A % (tmp - i) == 0:
        base1 = tmp - i
        break
base2 = A // base1

print(base1 + base2 - 2)
N,T=map(int,input().split())
l=[]
for i in range(N):
    c,t=map(int,input().split())
    if t <= T:
        l.append(c)
if len(c) > 0:
    print(min(c))        
else:
    print("TLE")



### FIXED CODE ###

N,T=map(int,input().split())
l=[]
for i in range(N):
    c,t=map(int,input().split())
    if t <= T:
        l.append(c)
if len(l) > 0:
    print(min(l))        
else:
    print("TLE")
import sys 
while True:
	x,y = map(int,sys.stdin.inputline().split())
	if x==0 & y==0:
		break
	else:
		if x<=y:
			print(x,y)
		else:
			print(y,x)

### FIXED CODE ###

while True:
	x,y=map(int,input().split())
	if (x==0) & (y==0):
		break
	else:
		if x>y:
			print(y,x)
		else:
			print(x,y)
[N,K] = list(map(int,input().split()))
l_h = list(map(int,input().split()))

l_cost = [0]+[float("inf") for i in range(N-1)]

for i in range(N): #ノードを全土に渡り更新する
  for k in range(1,K+1):#1ノードにつきKこ先のコストを更新する
    if (k+i>N-1):
      break
    else:
      min_cost=min(abs(l_h[k+i]-l_h[i]) + l_cost[i] ,l_cost[k+i])  
      l_cost[k+i] = min_cost

print(l_cost[-1])

### FIXED CODE ###

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

l_cost = [0,abs(l_h[1]-l_h[0])]

for i in range(2,N):
  min_cost=min(abs(l_h[i]-l_h[i-1]) + l_cost[i-1] , abs(l_h[i]-l_h[i-2]) + l_cost[i-2])
  l_cost.append(min_cost) 

print(l_cost[N-1])
N, T = map(int, input().split())

c = [0 for i in range(N)]
t = [0 for i in range(N)]

for i in range(N):
    c[i], t[i] = map(int, input().split())
    
for i in range(N):
    if t[i] > T:
        del c[i]
        
c.sort()

print(c[0])

### FIXED CODE ###

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

ans = 10**9

for i in range(N):
    c, t = list(map(int, input().split()))
    if t <= T:
        if c < ans:
            ans = c

if ans == 10**9:
    print('TLE')
else:
    print(ans)
from math import log10
n = int(input())
for i in range(n):
    a = int(input())
    b = int(input())
    c = a+b
    if (log10(c) > 80):
        print("overflow")
    else:
        print(c)

### FIXED CODE ###

from sys import stdin
n = int(stdin.readline())
for i in range(n):
    c = str(int(stdin.readline().strip()) + int(stdin.readline().strip()))
    if (len(c) > 80):
        print("overflow")
    else:
        print(c)
h,w=map(int,input().split())

maze=[list(input()) for _ in range(h)]

group=[[0]*w for _ in range(h)]

group_no=0
color_cnt=[]

for y in range(h):
    for x in range(w):
        if group[y][x]==0:
            stack=[(y,x)]
            group_no+=1

            color_cnt_tmp=[0,0]

            while len(stack)>0:
                tmp=stack.pop()
                group[tmp[0]][tmp[1]]=group_no
                print(tmp)
                if maze[tmp[0]][tmp[1]]=="#":
                    color_cnt_tmp[0]+=1
                else:
                    color_cnt_tmp[1]+=1

                for (ny,nx) in [(0,1),(1,0),(-1,0),(0,-1)]:
                    my=ny+tmp[0]
                    mx=nx+tmp[1]
                    if 0<=my<h and 0<=mx<w:
                        if group[my][mx]==0:
                            if maze[tmp[0]][tmp[1]]!=maze[my][mx]:
                                stack.append((my,mx))
                                group[my][mx]=group_no
            color_cnt.append(color_cnt_tmp)

ans=0
for (b,w) in color_cnt:
    ans+=b*w

print(ans)



### FIXED CODE ###

n,m,d=map(int,input().split())

#1~nの数字
#m個
#隣り合う数字がdの個数

if d==0:
    print(1.0*(m-1)/n)
else:
    print(1.0*(m-1)*2*(n-d)/n/n)
while True:
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
        break

    for h in range(h):
        for w in range(w):
            if (h + w) % 2 == 0:
                print('#', end='')
            else:
                print('.', end='')

        print()

### FIXED CODE ###

while True:
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
        break

    for h in range(H):
        for w in range(W):
            if (h + w) % 2 == 0:
                print('#', end='')
            else:
                print('.', end='')

        print()
    print()
import numpy as np
n,k = map(int,input().split())
p = list(map(int,input().split()))
max_array = sum(p[0:k])
a = np.ceil(k)
u = max_array
for i in range(k, n):
    u = u + p[i]-p[i-k]
    max_array = max(max_array, u)
print((max_array+k) / 2)
print("test")


### FIXED CODE ###

n,k = map(int,input().split())
p = list(map(int,input().split()))
max_array = sum(p[0:k])
u = max_array
for i in range(k, n):
    u = u + p[i]-p[i-k]
    max_array = max(max_array, u)
print((max_array+k) / 2)
N = int(input())

even = N // 2
odd = N - even
print(event * odd)

### FIXED CODE ###

N = int(input())

even = N // 2
odd = N - even
print(even * odd)
N = int(input())
if N >= 100000:
  	print(90909)
else if N >= 10000:
  	print(909 + (N - 10000))
else if N >= 1000:
  	print(909)
else if N >= 100:
  	print(9 + (N - 100))
else if N >= 10:
  	print(9)
else:
  	print(N)

### FIXED CODE ###

n = int(input())
cnt = 0
for i in range(1, n + 1):
  if len(str(i)) % 2 == 1:
    cnt +=1
print(cnt)
import re
n=int(input())
s=str(input())
q=int(input())
 
for i in range(q):
 x,y=map(str, input().split())
 s=re.sub(x,y,s)
 ans=0 
 s_list=list(s.split())
 for j in range(q+1):
  ans+=int(s_list[j])
 print(ans)

### FIXED CODE ###

n=int(input())
a_list=list(map(int,input().split()))
cnt = [0] * int(1e5 + 10)
sum=0
for i in a_list:
 cnt[i] +=1
 sum+=i
  
q=int(input())
ans=0
 
for j in range(q):
 x,y=map(int,input().split())
 sum+=(y-x)*cnt[x]
 cnt[y]+=cnt[x]
 cnt[x]=0
 print(sum)
a, b: int = map(int, input().split())

print(a * b)


### FIXED CODE ###

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

print(a * b)
n = int(input())
i = 1

while True:
    x = i
    if  x % 3 == 0 or x % 10 ==3 or x / 10 == 0:
        print(" " + i)
    i+=1
    if i > n:
        print()
        break


### FIXED CODE ###

#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


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


def main():

    N = int(input())
    ans = 0
    A = int(math.ceil(N**0.5)+1)
    explist = []
    flag = False
    if N >= 3:
        for L in range(2, A):
            if N < L:
                break
            d = L
            cnt = 0
            while(True):
                if N % d == 0:
                    N /= d
                    cnt += 1
                    flag = True
                else:
                    break
            explist.append([d, cnt])
        for i in explist:
            c = i[1]
            for j in range(1, A):
                if c >= j:
                    ans += 1
                    c -= j
                    print(c[0])
                else:
                    break
        if flag:
            print(ans)
            return
        else:
            print(1)
            return
    elif N == 2:
        print(1)
        return
    else:
        print(0)
        return


if __name__ == '__main__':
    main()


### FIXED CODE ###

import math
import decimal


def main():

    N = int(input())
    ans = 0
    A = int(math.ceil(N**0.5)+1)
    explist = []
    flag = False
    if N >= 3:
        for L in range(2, A):
            if N < L:
                break
            d = L
            cnt = 0
            while(True):
                if N % d == 0:
                    N /= d
                    cnt += 1
                    flag = True
                else:
                    break
            explist.append([d, cnt])
        for i in explist:
            c = i[1]
            for j in range(1, A):
                if c >= j:
                    ans += 1
                    c -= j
                else:
                    break
        if N >= A:
            ans += 1
        if flag:
            print(ans)
            return
        else:
            print(1)
            return
    elif N == 2:
        print(1)
        return
    else:
        print(0)
        return


if __name__ == '__main__':
    main()
#

import sys
from math import ceil
input=sys.stdin.readline

def main():
    t=[int(input()) for i in range(5)]
    tp10=[t[i]%10 for i in range(5) if t[i]%10!=0]
    ans=0
    for i in range(5):
        ans+=ceil(t[i]/10)*10
    print(ans-10+min(tp10))
    
if __name__=="__main__":
    main()


### FIXED CODE ###

#

import sys
from math import ceil
input=sys.stdin.readline

def main():
    t=[int(input()) for i in range(5)]
    tp10=[t[i]%10 for i in range(5) if t[i]%10!=0]
    ans=0
    for i in range(5):
        ans+=ceil(t[i]/10)*10
    if len(tp10)>0:
      	print(ans-10+min(tp10))
    else:
      	print(ans)
    
if __name__=="__main__":
    main()
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=input()
	if n==-1:break
	e=0
	#for i in range(n):
	#	a=ref[int(raw_input())]
	#	print "{:07b}".format(a^e)
	#	e=a

### FIXED CODE ###

ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass
N = int(input())
S = input()
min = N
if S.find('#') == -1 or S.find('.') == -1:
    min = 0
else:
    for i in range(S.find('#'),S.rfind('#')+1):
        if S[i] == '.' and S[i+1] == '#':
            left = S.count('#',0,i)
            right = S.count('.',i+1)
        elif S[i] == '#' and S[i+1] =='.':
            left = S.count('#',0,i)
            right = S.count('.',i)
        if left + right < min:
            min = left + right
print(min)

### FIXED CODE ###

N = int(input())
S = input()
min = N
clm_sum = [0]
for s in S:
    if s == '#':
        clm_sum.append(clm_sum[-1] + 1)
    else:
        clm_sum.append(clm_sum[-1])
for i in range(1,len(clm_sum)):
    if clm_sum[i-1] + ((N - i) - (clm_sum[-1] - clm_sum[i])) < min:
        min = clm_sum[i-1] + ((N - i) - (clm_sum[-1] - clm_sum[i]))
print(min)
n,m = map(int,input().split())
s = list(input())
t = list(input())
ans = n
while ans % m != 0:
    ans += n
l = ['0'] * ans
j = 0
for i in range(n):
    z = j * (ans // n)
    l[z] = s[i]
    j += 1
j = 0
for i in range(m):
    z = j * (ans // m)
    if l[z] == '0' or l[z] == t[i]:
        l[z] = s[i]
        j += 1
    else:
        print(-1)
        exit(0)
print(ans)

### FIXED CODE ###

from math import gcd
n,m = map(int,input().split())
z = n * m // gcd(n,m)
s = input()
t = input()
n = z // n
m = z // m
x = 0
y = 0
i = 0
j = 0
while x < z and y < z:
    if x > y:
        y += m
        j += 1
    elif x < y:
        x += n
        i += 1
    else:
        if s[i] != t[j]:
            print(-1)
            exit(0)
        x += n
        y += m
        i += 1
        j += 1
print(z)
S,W = map(int,input().split())

if s <= w:
  print('unsafe')
else:
  print('safe')

### FIXED CODE ###

S,W = map(int,input().split())
 
if S <= W:
  print('unsafe')
else:
  print('safe')
n = int(input())
hs = map(int, input().strip().split())

# print(hs)
max = 0
ans = 0
for i in range(n):
    if hs[i] >= max:
        ans +=1
        max = hs[i]

print(ans)

### FIXED CODE ###

n = int(input())
hs = [int(h) for h in input().strip().split()]

# print(hs)
max = 0
ans = 0
for i in range(n):
    if hs[i] >= max:
        ans +=1
        max = hs[i]

print(ans)
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

d = abs(A-B)
v = V - W
if d/v <= T:
    print('YES')
else:
    print('NO')



### FIXED CODE ###

import sys

A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if V <= W:
    print('NO')
    sys.exit()

d = abs(A-B)
v = V - W
if d/v <= T:
    print('YES')
else:
    print('NO')
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
else:
    s=int(n/(a+b))
    absum=(a+b)*s
    m=n%(absum)#余り
    if m<a:
        print(s*a+m)
    else:
        print((s+1)*a)

### FIXED CODE ###

#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
else:
    s=int(n/(a+b))
    if s==0:
        m=n
    else:
        absum=(a+b)*s
        m=n%(absum)#余り
    if m<a:
        print(s*a+m)
    else:
        print((s+1)*a)
スコード
Copy
### coding: UTF-8
 
#import math
#import random as rd
#import numpy as np
 
 
n=int(input())
line=list(map(int,input().split( )))
 
line=sorted(line)
 
#print(line)
 
s=sum([line[-(i+1)] for i in range(n) if i%2==0])-sum([line[-(i+1)] for i in range(n) if i%2!=0])
 
print(s)
 

### FIXED CODE ###

### coding: UTF-8
 
#import math
#import random as rd
#import numpy as np
 
 
n=int(input())
line=list(map(int,input().split( )))
 
line=sorted(line)
 
#print(line)
 
s=sum([line[-(i+1)] for i in range(n) if i%2==0])-sum([line[-(i+1)] for i in range(n) if i%2!=0])
 
print(s)
import sys

n,k=map(int,input().split())
#s=list(map(int,input().split()))
s=input()

lcnt=-1
rcnt=-1

rr=[0]*n
ll=[0]*n
sim=""
for si in s:
#    print(si)
    if si=="R" and sim=="R":
        rr[rcnt]+=1
    elif si=="R" and sim!="R":
        rcnt+=1
        rr[rcnt]=1
    if si=="L" and sim=="L":
        ll[lcnt]+=1
    elif si=="L" and sim!="L":
        lcnt+=1
        ll[lcnt]=1
    sim=si
        

ll=[i for i in ll if i!=0]
rr=[i for i in rr if i!=0]
#print(ll)
#print(rr)

maxlen=max(len(ll),len(rr))
if maxlen<=k:
    print(n-1)
    sys.exit()
    
for i in range(k):
    ll[i]+=rr[i]
    rr[i]=0
#print(lr)
for i in range(maxlen-1):
    if ll[i]!=0 and rr[i]==0 :
        ll[i+1]+=ll[i]
        ll[i]=0
#print(lr)

icnt=0
for i in range(maxlen):
    icnt+=max(ll[i]-1,0)+max(rr[i]-1,0)
    
print(icnt)


### FIXED CODE ###

import sys

n,k=map(int,input().split())
s=input()

lcnt=-1
rcnt=-1

rr=[0]*n
ll=[0]*n
sim=""
for si in s:
    if si=="R" and sim=="R":
        rr[rcnt]+=1
    elif si=="R" and sim!="R":
        rcnt+=1
        rr[rcnt]=1
    if si=="L" and sim=="L":
        ll[lcnt]+=1
    elif si=="L" and sim!="L":
        lcnt+=1
        ll[lcnt]=1
    sim=si
        
ll=[i for i in ll if i!=0]
rr=[i for i in rr if i!=0]
#print(ll)
#print(rr)

minlen=min(len(ll),len(rr))
if minlen<=k:
    print(n-1)
    sys.exit()
    
for i in range(k):
    ll[i]+=rr[i]
    rr[i]=0

for i in range(len(ll)-1):
    if i<len(rr) and ll[i]!=0 and rr[i]==0 :
        ll[i+1]+=ll[i]
        ll[i]=0

icnt=0
for i in range(len(ll)):
    icnt+=max(ll[i]-1,0)
for i in range(len(rr)):
    icnt+=max(rr[i]-1,0)
    
print(icnt)
import collections
N=int(input())
A=collections.Counter(list(map(int,input().split())))
if N%2==0:
  for i in range(0,N,2):
    if i%2==0 and A[i]==0:
      pass
    elif i%2==a and A[i]==2:
      pass
    else:
        print(0);exit(0)
else:
  for i in range(N):
    if i==0 and A[i]==1:
      continue
    if i%2==0 and A[i]==2:
      pass
    elif i%2==1 and A[i]==0:
      pass
    else:
      print(0);exit(0)
print(pow(2,N//2,10**9+7 ))

### FIXED CODE ###

import collections
N=int(input())
A=collections.Counter(list(map(int,input().split())))
if N%2==0:
  for i in range(0,N,2):
    if i%2==0 and A[i]==0:
      pass
    elif i%2==1 and A[i]==2:
      pass
    else:
        print(0);exit(0)
else:
  for i in range(N):
    if i==0 and A[i]==1:
      continue
    if i%2==0 and A[i]==2:
      pass
    elif i%2==1 and A[i]==0:
      pass
    else:
      print(0);exit(0)
print(pow(2,N//2,10**9+7 ))
s = input()
a = len(s)-2
print(s[0]+a+s[-1])

### FIXED CODE ###

s = input()
print(s[0]+str(len(s)-2)+s[-1])
N, X = map(int, input().split())
L = list(map(int, input().split()))
z = 0
cnt = 0

while z<=X:
    z += L[cnt]
    cnt += 1

print(min(cnt, N+1))

### FIXED CODE ###

N, X = map(int, input().split())
L = list(map(int, input().split()))
cnt = 1
D = 0

for i in L:
    D += i
    if D<=X:
        cnt += 1

print(min(N+1, cnt))
from collections import Counter

N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)
two = []
four = []

for i, cnt in Counter(A).items():
    if cnt >= 4:
        four.append(i)
    if cnt >= 2:
        two.append(i)
    if len(two) >= 2:
        break

print(max(two[0] * two[1], four[0] * four[0]))

### FIXED CODE ###

from collections import Counter

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

for i, cnt in Counter(A).items():
    if cnt >= 2 and i > w:
        if i > h:
            if cnt >= 4:
                h = i
                w = i
            else:
                w = h
                h = i
        else:
            w = i
            
print(w * h)
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect, string, copy
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7
ans = inf
count = 0; pro = 1

d, g = map(int, input().split())
g //= 100
dp=[[inf]*(10**5+1010) for i in range(11)]
dp[0][0]=0
for i in range(d):
    p,c=map(int,input().split());c//=100
    for j in range(10**5*2):
        if dp[i][j]!=inf:
            dp[i+1][j]=min(dp[i+1][j],dp[i][j])
            for k in range(1,p):
                dp[i+1][j+(i+1)*k]=min(dp[i+1][j+(i+1)*k],dp[i][j]+k)
            dp[i+1][j+(i+1)*p+c] = min(dp[i+1][j+(i+1)*p+c],dp[i][j]+p)
for i in range(g,10**5+10):
    ans=min(ans,dp[d][i])
print(ans)




# for i in range(1, d+1):
#     p, c = map(int, input().split())
#     c //= 100
#     # for key, value in tuple(D.items()):
#     #     print(D[key],p)
#     #     D[key+i*p+c//100] = min(D[key+i*p+c//100], D[key]+p)
#     S = D.copy()
#     for key, value in S.items():
#         for k in range(1, p):
#             # print(D[key+i])
#             D[key+i*k] = min(D[key+i*k], S[key]+k)
#         D[key+i*p+c] = min(D[key+i*p+c], S[key]+p)
# ans = inf
# for key, value in D.items():
#     # print(key,value)
#     if key >= g:
#         ans = min(ans, value)
# print(ans)


### FIXED CODE ###

#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect, string, copy
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7
ans = count = 0; pro = 1

d,g=map(int,input().split());g//=100
D=collections.defaultdict(lambda: inf )
D[0]=0
for i in range(1,d+1):
    p,c=map(int,input().split());c//=100
    # for key, value in tuple(D.items()):
    #     print(D[key],p)
    #     D[key+i*p+c//100] = min(D[key+i*p+c//100], D[key]+p)
    S=D.copy()
    for key,value in S.items():
        for k in range(1,p):    
        # print(D[key+i])
            D[key+i*k] = min(D[key+i*k],S[key]+k)
        D[key+i*p+c] = min(D[key+i*p+c],S[key]+p)
ans=inf
for key,value in D.items():
    # print(key,value)
    if key>=g:
        ans=min(ans,value)
print(ans)