stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef vector<int> vi;

typedef pair<int,int> pii;

#define pb push_back

#define mp make_pair

#define fi first

#define se second

#define sz(a) int(a.size())

const int N=50;



int gi() {

	int x=0,o=1;char ch=getchar();

	while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();

	if(ch=='-') o=-1,ch=getchar();

	while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();

	return x*o;

}



int n;

ll f[N][N][N];

char s[N][N];



int main() {

	cin>>n;n<<=1;

	for(int i=1;i<=n;i++) scanf("%s",s[i]+1),f[i][i][i]=1;

	for(int len=3;len<=n;len+=2)

		for(int l=1;l<=n-len+1;l++) {

			int r=l+len-1;

			for(int t=l+1;t<r;t++)

				for(int a=l;a<r;a+=2)

					for(int b=r;b>t;b-=2)

						for(int x=l;x<=a;x++)

							for(int y=b;y<=r;y++)

								if(s[x][y]=='1') f[l][r][t]+=f[l][a][x]*f[b][r][y]*f[a+1][b-1][t];

		}

	ll ans=0;

	for(int i=2;i<=n;i++) if(s[1][i]=='1') ans+=f[2][n][i];

	cout<<ans;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.1678140402511032x):
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef vector<int> vi;

typedef pair<int,int> pii;

#define pb push_back

#define mp make_pair

#define fi first

#define se second

#define sz(a) int(a.size())

const int N=50;



int gi() {

	int x=0,o=1;char ch=getchar();

	while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();

	if(ch=='-') o=-1,ch=getchar();

	while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();

	return x*o;

}



int n;

ll f[N][N][N];

char s[N][N];



int main() {

	cin>>n;n<<=1;

	for(int i=1;i<=n;i++) scanf("%s",s[i]+1),f[i][i][i]=1;

	for(int len=3;len<=n;len+=2)

		for(int l=1;l<=n-len+1;l++) {

			int r=l+len-1;

			for(int a=l;a<r;a+=2)

				for(int b=r;b>a;b-=2) {

					ll sum=0;

					for(int x=l;x<=a;x++)

						for(int y=b;y<=r;y++) if(s[x][y]=='1') sum+=f[l][a][x]*f[b][r][y];

					for(int t=a+1;t<b;t++) f[l][r][t]+=f[a+1][b-1][t]*sum;

				}

		}

	ll ans=0;

	for(int i=2;i<=n;i++) if(s[1][i]=='1') ans+=f[2][n][i];

	cout<<ans;

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int N=42;

typedef long long ll;



int gi() {

	int x=0,o=1;char ch=getchar();

	while(!isdigit(ch)&&ch!='-') ch=getchar();

	if(ch=='-') o=-1,ch=getchar();

	while(isdigit(ch)) x=x*10+ch-'0',ch=getchar();

	return x*o;

}



int n;

char s[N][N];

ll f[N][N][N];



ll dp(int l,int r,int m) {

	if(~f[l][r][m]) return f[l][r][m];

	if(l==r) return 1;

	if(l==m||r==m) return 0;

	ll &ret=f[l][r][m];ret=0;

	for(int i=l;i<m;i++)

		for(int j=m+1;j<=r;j++)

			if(s[i][j]=='1')

				for(int u=i;u<m;u++)

					for(int v=m+1;v<=j;v++) ret+=dp(l,u,i)*dp(u+1,v-1,m)*dp(v,r,j);

	return ret;

}



int main() {

	n=gi();

	for(int i=1;i<=n+n;i++) scanf("%s",s[i]+1);

	memset(f,-1,sizeof(f));

	ll ans=0;

	for(int i=2;i<=n+n;i++) if(s[1][i]=='1') ans+=dp(2,n+n,i);

	cout<<ans;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.7713711433013168x):
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef vector<int> vi;

typedef pair<int,int> pii;

#define pb push_back

#define mp make_pair

#define fi first

#define se second

#define sz(a) int(a.size())

const int N=50;



int gi() {

	int x=0,o=1;char ch=getchar();

	while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();

	if(ch=='-') o=-1,ch=getchar();

	while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();

	return x*o;

}



int n;

ll f[N][N][N],g[N][N][N];

char s[N][N];



int main() {

	cin>>n;n<<=1;

	for(int i=1;i<=n;i++) {

		scanf("%s",s[i]+1),f[i][i][i]=1;

		for(int x=1;x<i;x++) if(s[x][i]=='1') g[i][i][x]=1;

	}

	for(int len=3;len<=n;len+=2)

		for(int l=1;l<=n-len+1;l++) {

			int r=l+len-1;

			for(int a=l;a<r;a+=2)

				for(int b=r;b>a;b-=2) {

					ll sum=0;

					for(int x=l;x<=a;x++) sum+=f[l][a][x]*g[b][r][x];

					for(int t=a+1;t<b;t++) f[l][r][t]+=f[a+1][b-1][t]*sum;

				}

			for(int x=1;x<l;x++)

				for(int y=l;y<=r;y++) if(s[x][y]=='1') g[l][r][x]+=f[l][r][y];

		}

	ll ans=0;

	for(int i=2;i<=n;i++) if(s[1][i]=='1') ans+=f[2][n][i];

	cout<<ans;

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef vector<int> vi;

typedef pair<int,int> pii;

#define pb push_back

#define mp make_pair

#define fi first

#define se second

#define sz(a) int(a.size())

const int N=50;



int gi() {

	int x=0,o=1;char ch=getchar();

	while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();

	if(ch=='-') o=-1,ch=getchar();

	while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();

	return x*o;

}



int n;

ll f[N][N][N];

char s[N][N];



int main() {

	cin>>n;n<<=1;

	for(int i=1;i<=n;i++) scanf("%s",s[i]+1),f[i][i][i]=1;

	for(int len=3;len<=n;len+=2)

		for(int l=1;l<=n-len+1;l++) {

			int r=l+len-1;

			for(int t=l+1;t<r;t++)

				for(int a=l;a<r;a+=2)

					for(int b=r;b>t;b-=2)

						for(int x=l;x<=a;x++)

							for(int y=b;y<=r;y++)

								if(s[x][y]=='1') f[l][r][t]+=f[l][a][x]*f[b][r][y]*f[a+1][b-1][t];

		}

	ll ans=0;

	for(int i=2;i<=n;i++) if(s[1][i]=='1') ans+=f[2][n][i];

	cout<<ans;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.1756273913753865x):
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef vector<int> vi;

typedef pair<int,int> pii;

#define pb push_back

#define mp make_pair

#define fi first

#define se second

#define sz(a) int(a.size())

const int N=50;



int gi() {

	int x=0,o=1;char ch=getchar();

	while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();

	if(ch=='-') o=-1,ch=getchar();

	while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();

	return x*o;

}



int n;

ll f[N][N][N],g[N][N][N];

char s[N][N];



int main() {

	cin>>n;n<<=1;

	for(int i=1;i<=n;i++) {

		scanf("%s",s[i]+1),f[i][i][i]=1;

		for(int x=1;x<i;x++) if(s[x][i]=='1') g[i][i][x]=1;

	}

	for(int len=3;len<=n;len+=2)

		for(int l=1;l<=n-len+1;l++) {

			int r=l+len-1;

			for(int a=l;a<r;a+=2)

				for(int b=r;b>a;b-=2) {

					ll sum=0;

					for(int x=l;x<=a;x++) sum+=f[l][a][x]*g[b][r][x];

					for(int t=a+1;t<b;t++) f[l][r][t]+=f[a+1][b-1][t]*sum;

				}

			for(int x=1;x<l;x++)

				for(int y=l;y<=r;y++) if(s[x][y]=='1') g[l][r][x]+=f[l][r][y];

		}

	ll ans=0;

	for(int i=2;i<=n;i++) if(s[1][i]=='1') ans+=f[2][n][i];

	cout<<ans;

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll mem[45][45][45];

int G[45][45];

ll dp(int s, int t, int u){

    if (s == u) return 1;

    else if (s == t || t == u) return 0;

    if (mem[s][t][u] != -1) return mem[s][t][u];

    //printf("%d %d %d\n",s,t,u);

    ll ans = 0;

    for (int p1 = s; p1 < t; p1++){

        for (int p2 = t+1; p2 <= u; p2++){

            //printf("can take %d-%d\n",p1,p2);

            for (int r1 = s; r1 <= p1; r1++){

                for (int r2 = p2; r2 <= u; r2++){

                    if (G[r1][r2] == 0) continue;

                    //printf("+%lld*%lld*%lld\n",dp(s,r1,p1),dp(p1+1,t,p2-1),dp(p2,r2,u));

                    ll num = dp(s,r1,p1)*dp(p1+1,t,p2-1)*dp(p2,r2,u);

                    //printf("if take %d-%d: add %lld\n",r1,r2,num);

                    ans += num;

                }

            }

        }

    }

    //printf("%d %d %d: %lld\n",s,t,u,ans);

    return mem[s][t][u] = ans;

}

int main(){

	int n;

	scanf("%d",&n);

	for (int i = 0; i < 2*n; i++){

        for (int j = 0; j < 2*n; j++){

            char x;

            scanf(" %c",&x);

            G[i][j] = x-'0';

        }

	}

	memset(mem,-1,sizeof(mem));

	ll ans = 0;

	for (int i = 1; i <= 2*n-1; i++){

        if (G[0][i]){

            ans += dp(1,i,2*n-1);

            //printf("if take 0-%d, %lld\n",i,dp(1,i,2*n-1));

        }

	}

	printf("%lld",ans);

}


// Faster C++ solution for the same problem (measured speedup: 1.6787634156469584x):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll dp[41][41][41];

int G[41][41];

int main(){

	int n;

	scanf("%d",&n);

	n *= 2;

	for (int i = 0; i < n; i++){

        for (int j = 0; j < n; j++){

            char x;

            scanf(" %c",&x);

            G[i][j] = x-'0';

        }

	}

	for (int i = 1; i < n; i++) dp[i][i][i] = 1;

	for (int l = 1; l < n; l++){

        for (int s = 1; s+l < n; s++){

            int u = s+l;

            for (int t = s+1; t < u; t++){

                for (int p1 = s; p1 < t; p1++){

                    for (int p2 = t+1; p2 <= u; p2++){

                        for (int r1 = s; r1 <= p1; r1++){

                            for (int r2 = p2; r2 <= u; r2++){

                                if (G[r1][r2] == 0) continue;

                                dp[s][t][u] += dp[s][r1][p1]*dp[p1+1][t][p2-1]*dp[p2][r2][u];

                            }

                        }

                    }

                }

            }

        }

	}

	ll ans = 0;

	for (int i = 1; i <= n-1; i++){

        if (G[0][i]){

            ans += dp[1][i][n-1];

            //printf("if take 0-%d, %lld\n",i,dp(1,i,2*n-1));

        }

	}

	printf("%lld",ans);

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define fo(i,a,b)for(int i=a,_e=b;i<=_e;++i)

#define ll long long

using namespace std;

const int N=50;

int n;

char a[N][N];

ll f[N][N][N],ans;

ll calc(int l,int i,int r){

	if(l==r)return 1;

	if(l==i||i==r)return 0;

	if(f[l][i][r]!=-1)return f[l][i][r];

	ll tot=0;

	fo(j,l,i-1)

		fo(p,j,i-1)

			fo(q,i+1,r)

				fo(k,q,r)

					if(a[j][k]=='1')

						tot+=calc(l,j,p)*calc(q,k,r)*calc(p+1,i,q-1);

	return f[l][i][r]=tot;

}

int main(){

	scanf("%d",&n);n*=2;

	fo(i,1,n)scanf("\n%s",a[i]+1);

	memset(f,255,sizeof f);

	fo(i,2,n)if(a[1][i]=='1')ans+=calc(2,i,n);

	cout<<ans;

}

// Faster C++ solution for the same problem (measured speedup: 2.1759389964079556x):
#include<bits/stdc++.h>

#define fo(i,a,b)for(int i=a,_e=b;i<=_e;++i)

#define ll long long

using namespace std;

const int N=50;

int n;

char a[N][N];

ll f[N][N][N],s[N][N],ss,ans;

int main(){

	scanf("%d",&n);n*=2;

	fo(i,1,n)scanf("\n%s",a[i]+1),f[i][i][i]=1;

	for(int len=2;len<=n-2;len+=2)

		fo(l,2,n-len){

			int r=l+len;

			fo(j,l,r)fo(k,j,r)s[j][k]=0;

			fo(j,l,r){

				fo(q,j+1,r){

					ss=0;

					fo(k,q,r)if(a[j][k]=='1')ss+=f[q][r][k];

					fo(p,j,q)s[p][q]+=ss*f[l][p][j];

				}

			}

			fo(p,l,r)fo(q,p,r)

				fo(i,p+1,q-1)f[l][r][i]+=s[p][q]*f[p+1][q-1][i];

		}

	fo(i,2,n)if(a[1][i]=='1')ans+=f[2][n][i];

	cout<<ans;

}
// Slower C++ solution:
#include <cstdio>

#include <cassert>

#include <cstring>

#include <algorithm>

#define meow(args...) fprintf(stderr, args)

template<class T1, class T2> inline bool cmin(T1 &a, const T2 &b) {return b<a?(a=b, true):false;}

template<class T1, class T2> inline bool cmax(T1 &a, const T2 &b) {return a<b?(a=b, true):false;}

template<class Type> Type read() {

	Type a;

	bool b;

	unsigned char c;

	while(c=getchar()-'0', (c>9)&(c!=253));

	for(a=(b=c==253)?0:c; (c=getchar()-'0')<=9; a=a*10+c);

	return b?-a:a;

}

int (*rd)()=read<int>;

int n;

char a[40][41];

long long f[40][40][40];

int main() {

	assert(scanf("%d", &n)==1);

	for(int i=0; i<2*n; ++i) assert(scanf("%s", a[i])==1);

	for(int i=1; i<2*n; ++i) f[i][i][i]=1;

	for(int len=3; len<2*n; len+=2)

		for(int i=1, k=len; k<2*n; ++i, ++k)

			for(int j=i+1; j<k; ++j)

				for(int p=i; p<j; ++p)

					for(int r=j; r<k; ++r) {

						long long s=0;

						for(int l=p+1; l<=j; ++l) s+=f[i][p][l-1]*f[l][j][r];

						for(int q=r; q<=k; ++q) if(a[p][q]=='1') f[i][j][k]+=s*f[r+1][q][k];

					}

	long long ans=0;

	for(int i=1; i<2*n; ++i) if(a[0][i]=='1') ans+=f[1][i][2*n-1];

	printf("%lld\n", ans);

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.185057660256464x):
#include <cstdio>

#include <cassert>

#include <cstring>

#include <algorithm>

#define meow(args...) fprintf(stderr, args)

template<class T1, class T2> inline bool cmin(T1 &a, const T2 &b) {return b<a?(a=b, true):false;}

template<class T1, class T2> inline bool cmax(T1 &a, const T2 &b) {return a<b?(a=b, true):false;}

template<class Type> Type read() {

	Type a;

	bool b;

	unsigned char c;

	while(c=getchar()-'0', (c>9)&(c!=253));

	for(a=(b=c==253)?0:c; (c=getchar()-'0')<=9; a=a*10+c);

	return b?-a:a;

}

int (*rd)()=read<int>;

int n;

char a[40][41];

long long f[40][40][40], g[40][40][40];

int main() {

	assert(scanf("%d", &n)==1);

	for(int i=0; i<2*n; ++i) assert(scanf("%s", a[i])==1);

	for(int i=2*n; --i; ) {

		f[i][i][i]=1;

		for(int j=1; j<2*n; ++j) if(a[i][j]=='1') g[i][i][j]=1;

		for(int j=i+2; j<2*n; j+=2) {

			for(int l=i; l<=j; ++l)

				for(int r=l+2; r<=j; ++r) {

					long long s=0;

					for(int q=r; q<=j; ++q) s+=g[i][l][q]*f[r][j][q];

					for(int k=l; k<=r; ++k) f[i][j][k]+=f[l+1][r-1][k]*s;

				}

			for(int k=i+1; k<j; ++k) {

				for(int q=0; q<i; ++q) if(a[k][q]=='1') g[i][j][q]+=f[i][j][k];

				for(int q=2*n; q-->j; ) if(a[k][q]=='1') g[i][j][q]+=f[i][j][k];

			}

		}

	}

	long long ans=0;

	for(int i=1; i<2*n; ++i) if(a[0][i]=='1') ans+=f[1][2*n-1][i];

	printf("%lld\n", ans);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define rep(i, n) for (int i=0; i<(int)(n); i++)

#define all(v) v.begin(), v.end()

using namespace std;

using ll = long long;

using Graph = vector<vector<int>>;

const ll MOD = 1000000007;

const ll INF = 9999999999;

template<class T> inline bool chmin(T& a, T b){if (a>b){a = b; return true;}return false;}

template<class T> inline bool chmax(T& a, T b){if (a<b){a = b; return true;}return false;}

template<class T> inline T powerM(T a,T b){if (b==0) return 1;

  T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }





vector<vector<ll>> dp(11, vector<ll>(1001, -1));

// dp[i][j]...i問目までをj問解いて得られる最大の点数



int main() {

  int d; cin >>d;

  ll g; cin >>g;

  vector<ll> p(d), c(d);

  rep(i, d) cin >>p.at(i) >>c.at(i);



  dp.at(0).at(0) = 0;



  for (int i=0; i<d; i++){

    for (int j=0; j<=1000; j++){

      if (dp.at(i).at(j) == -1) continue;

      for (int k=0; k<=p.at(i); k++){

        if (k == p.at(i)) chmax(dp.at(i+1).at(j+k), dp.at(i).at(j) + k * 100 * (i+1) + c.at(i));

        else chmax(dp.at(i+1).at(j+k), dp.at(i).at(j) + k * 100 * (i+1));

      }

    }

  }



  int res = MOD;

  for (int i=0; i<=d; i++){

    for (int j=0; j<=1000; j++){

      if (dp.at(i).at(j) >= g) chmin(res, j);

    }

  }

  cout <<res <<endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.1368233015320113x):
#include <bits/stdc++.h>

#define rep(i, n) for (int i=0; i<(int)(n); i++)

#define all(v) v.begin(), v.end()

using namespace std;

using ll = long long;

using Graph = vector<vector<int>>;

const ll MOD = 1000000007;

const ll INF = 9999999999;

template<class T> inline bool chmin(T& a, T b){if (a>b){a = b; return true;}return false;}

template<class T> inline bool chmax(T& a, T b){if (a<b){a = b; return true;}return false;}

template<class T> inline T powerM(T a,T b){if (b==0) return 1;

  T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }





int D; ll G;

vector<int> p;

vector<ll> c;



int main() {

  // 入力

  cin >>D >>G;

  p.assign(D, 0);

  c.assign(D, 0);

  rep(i, D) cin >>p.at(i) >>c.at(i);

  int res = 10 * 100+1;



  // 完全に解き切る100i点の問題を全探索

  for (int bit=0; bit<(1<<D); bit++){

    ll score = 0;

    int pros = 0;

    bool ok = true;

    for (int i=0; i<D; i++){

      if (bit & (1<<i)) score += 100 * (i+1) * p.at(i) + c.at(i), pros += p.at(i);

    }

    if (score < G){

      for (int i=D-1; i>=0; i--){

        if (bit & (1<<i)) continue;

        int onepro = 100 * (i+1);

        int buf = (G - score + onepro - 1) / onepro;

        if (buf > p.at(i)) ok = false;

        pros += buf;

        break;

      }

    }

    if (ok) res = min(res, pros);

  }



  cout <<res <<endl;

}
// Slower C++ solution:
#include<iostream>

#include<vector>

#include<algorithm>

#include<string>

#include<map>

#include<math.h>

#include<queue>

#include<deque>

#include<stack>

#include<cstdio>

#include<utility>

#include<set>

#include<list>

#include<cmath>

using namespace std;

using ll = long long;

using pii = pair<int, int>;

const int INF = 1e9;

ll D;

ll G;

ll dp[12][1201] = {};//iの問題まで解いた時の最大点数

int main() {

	cin >> D >> G;

	int p[11], c[11];

	for (int i = 1; i <= D; ++i) {

		cin >> p[i] >> c[i];

	}

	for (int i = 1; i <= D; ++i) {

		for (int j = 0; j < 1010; ++j) {

			for (int k = 0; k <= p[i]; ++k) {

				if (k == p[i]) {

					dp[i][j+k] = max(dp[i][j+k], dp[i-1][j] + 100 *i*k + c[i]);

				}

				else {

					dp[i][j + k] = max(dp[i][j + k], dp[i - 1][j] + 100 * i*k);

				}

			}

		}

	}

	for (int i = 0; i < 1010; ++i) {

		if (dp[D][i] >= G) {

			cout << i << endl;

			break;

		}

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.3804457532221168x):
#include<iostream>

#include<vector>

#include<algorithm>

#include<string>

#include<map>

#include<math.h>

#include<queue>

#include<deque>

#include<stack>

#include<cstdio>

#include<utility>

#include<set>

#include<list>

#include<cmath>

#include<stdio.h>

#include<string.h>

#include<cstdio>

#include<iomanip>

using namespace std;

using ll = long long;

using pii = pair<int, int>;

using piii = pair<pii, pii>;

const int INF = 1e9 + 7;

int D;

ll G;

vector<ll>p, c;

int main() {

	cin >> D >> G;

	p.resize(D); c.resize(D);

	for (int i = 0; i < D; ++i) {

		cin >> p[i] >> c[i];

	}

	ll res = 1 << 29;//全完する難易度帯を2^D通り固め打ちする

	for (int bit = 0; bit < (1 << D); ++bit) {

		ll sum = 0;

		ll num = 0;

		for (int i = 0; i < D; ++i) {

			if (bit & (1 << i)) {

				sum += c[i] + p[i] * 100 * (i + 1), num += p[i];

			}

		}

		if (sum >= G)res = min(res, num);

		else {

			for (int i = D - 1; i >= 0; --i) {

				if (bit&(1 << i))continue;

				for (int j = 0; j < p[i]; ++j) {

					if (sum >= G)break;

					sum += 100 * (i + 1);

					++num;

				}

			}

			res = min(res, num);

		}

	}

	cout << res << endl;

	return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<cstdlib>

#include<algorithm>

#include<iostream>

#include<queue>

#include<vector>

using namespace std;

#define MAX 1000000

typedef long long ll;





int main(){

  int D,G;

  cin>>D>>G;

  int p[200];

  ll c[200];

  for(int i=0;i<D;i++){

    cin>>p[i]>>c[i];

  }

  ll dp[20][2000]={0};

  for(int i=0;i<D;i++){

    for(int j=0;j<=i*100;j++){

      for(int k=0;k<=p[i];k++){

        ll score=(i+1)*100*k;

        if(k==p[i]) score+=c[i];

        dp[i+1][j+k]=max(dp[i+1][j+k],dp[i][j]+score);

      }

    }

  }

  int ans;

  for(int i=0;i<2000;i++){

    if(dp[D][i]>=G){

      ans=i;

      break;

    } 

  }

  cout<<ans<<endl;





}


// Faster C++ solution for the same problem (measured speedup: 1.3831655508088914x):
#include<cstdio>

#include<cstdlib>

#include<algorithm>

#include<iostream>

#include<queue>

#include<vector>

#include <bitset>

#include<math.h>

using namespace std;

#define INF 110000000000

#define MOD 1000000007

typedef long long ll;

typedef pair<ll,int> P;



int D,G,p[11],c[11];



int main(){

  cin>>D>>G;



  for(int i=0;i<D;i++){

    cin>>p[i]>>c[i];

  }



  int ans=1e9;



  for(int bit=0;bit< (1<<D); bit++){

    int s=0,num=0,rest_max=-1;

    for(int i=0;i<D;i++){

      if(bit>>i & 1){

        s+=100*(i+1)*p[i]+c[i];

        num+=p[i];

      }else{

        rest_max=i;

      }

    }

    if(s<G){

      int s1=100*(rest_max+1);

      int need=(G-s+s1-1)/s1;

      if(need>=p[rest_max]) continue;

      else{

        num+=need;

        //cout<<num<<" "<<s<<endl;

        

      }

    }

    ans=min(ans,num);

  }

  cout<<ans<<endl;

}
// Slower C++ solution:
#include <iostream>

#include <iomanip>

#include <vector>



#define REP(i, n) for (int i = 0; i < (n); i++)



using namespace std;



// dp[i][j] :=

// i個目までみていて,j問解いた時のスコアの最大値

int dp[20][1200];



int main()

{

  int D, G;

  cin >> D >> G;

  vector<int> p(D);

  vector<int> c(D);

  REP(i, D) {

    cin >> p[i] >> c[i];

  }



  REP(i,20)REP(j,1200)dp[i][j] = -1;

  REP(j, 1200)dp[0][j] = 0;



  REP(i, D) {

    REP(j, 1001) {

      if (dp[i][j] == -1) continue;

      for (int k = 0; k < p[i]; k++) {

        dp[i + 1][j + k] = max(dp[i + 1][j + k], dp[i][j] + 100*(i + 1)*k);

      }

      dp[i + 1][j + p[i]] = max(dp[i + 1][j + p[i]], dp[i][j] + 100*(i + 1)*p[i] + c[i]);

    }

  }



  int ans;

  REP(i, 1001) {

    if (dp[D][i] >= G) {

      ans = i;

      break;

    }

  }

  cout << ans << endl;



  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.3023813383868814x):
#include <iostream>

#include <vector>

#define REP(i, n) for(int i = 0; i < n; i++)



using namespace std;



int D, G;

int p[15], c[15];



void showBit(int num)

{

  REP(i, D) {

    if ((num >> i) & 1) cout << '1';

    else cout << '0';

  }

}



int dfs(int d, int used)

{

  if (d == D) {

    int score = 0;

    int ret = 0;

    REP(i, D) {

      if ((used >> i) & 1) {

        score += 100*(i+1)*p[i] + c[i];

        ret += p[i];

      }

    }

    if (score >= G) return ret;



    int k = D - 1;

    while ((used >> k) & 1) k--;

    REP(i, p[k]) {

      score += 100*(k+1);

      ret++;

      if (score >= G) return ret;

    }

    return 1100000000;

  }

  return min(dfs(d + 1, used | (1 << d)), dfs(d + 1, used));

}



int main()

{

  cin >> D >> G;

  REP(i, D) cin >> p[i] >> c[i];



  cout << dfs(0, 0) << endl;



  return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef pair<int,int> P;

typedef long long ll;

typedef long double ld;

const int inf=1e9+7;

const ll longinf=1LL<<60;

#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )

#define rep(i,n) REP(i,0,n)

#define F first

#define S second



const int mx=100010;

const ll mod=1e9+7;



int main(){

  int d,g;

  cin >> d >> g;

  vector<ll> p(d),c(d);

  rep(i,d){ cin >> p[i] >> c[i]; }

  vector<ll> dp(mx,0);

  

  rep(i,d)for(int k=1000; k>=1; k--)for(int j=1; j<=p[i]&&j<=k; j++){

    dp[k]=max(dp[k], dp[k-j]+(i+1)*100*j+(j==p[i]?c[i]:0));

  }

  rep(i,1001)if(dp[i]>=g){ cout<<i<<endl; return 0;}

  

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.594950709226053x):
#include <bits/stdc++.h>

using namespace std;

typedef pair<int,int> P;

typedef long long ll;

typedef long double ld;

const int inf=1e9+7;

const ll longinf=1LL<<60;

#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )

#define rep(i,n) REP(i,0,n)

#define F first

#define S second

 

const int mx=100010;

const ll mod=1e9+7;





int main(){

  int d,g;

  cin >> d >> g;

  vector<ll> p(d), c(d);

  rep(i,d){

    cin >> p[i] >> c[i];

  }

  vector<ll> dp(1010,0);

  rep(i,d)for(int j=1000; j>=1; j--) for(int k=1; k<=p[i]&&k<=j; k++){

    dp[j] = max(dp[j], dp[j-k] + (i+1)*100*k + (k==p[i]?c[i]:0));

  }

  rep(i,1001)if(dp[i]>=g){

    cout << i << endl; break;

  }

  return 0;

}