stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <string>

#include <algorithm>

#include <utility>

#include <cmath>

#include <vector>

#include <queue>

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

using namespace std;

typedef long long ll;

ll mod = 1000000007;



const int nmax = 40, abmax = 10, INF = 1000000;

int a[nmax], b[nmax], c[nmax];

int dp[nmax+1][nmax*abmax+1][nmax*abmax+1];



int main() {

    int n, ma, mb;

    cin >> n >> ma >> mb;

    rep(i, n) {

        cin >> a[i] >> b[i] >> c[i];

    }

    rep(i, n+1) {

        for(int ca = 0; ca <= nmax*abmax; ca++){

            for(int cb = 0; cb <= nmax*abmax; cb++){

                dp[i][ca][cb] = INF;

            }

        }

    }



    dp[0][0][0] = 0;

    rep(i, n) {

        for(int ca = 0; ca <= nmax*abmax; ca++) {

            for(int cb = 0; cb <= nmax*abmax; cb++) {

                if(dp[i][ca][cb] == INF) {

                    continue;

                }

                dp[i+1][ca][cb] = min( dp[i+1][ca][cb], dp[i][ca][cb] );

                dp[i+1][ca+a[i]][cb+b[i]] = min( dp[i+1][ca+a[i]][cb+b[i]], dp[i][ca][cb]+c[i] );

            }

        }

    }



    int ans = INF;

    for(int ca = 1; ca <= nmax*abmax; ca++) {

        for(int cb = 1; cb <= nmax*abmax; cb++) {

            if(ca*mb == cb*ma) {

                ans = min(ans, dp[n][ca][cb]);

            }

        }

    }

    if(ans == INF) {

        ans = -1;

    }

    

    cout << ans << endl;

    return 0;

}


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

#include <cstdio>

#include <string>

#include <algorithm>

#include <utility>

#include <cmath>

#include <vector>

#include <queue>

#include <set>

#include <map>

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

using namespace std;

typedef long long ll;

const ll mod = 1000000007;

const int INF = 10000;



int main() {

    int n, ma, mb;

    cin >> n >> ma >> mb;



    vector<int> a(n), b(n), c(n);

    int suma = 0, sumb = 0; 

    rep(i, n) {

        cin >> a[i] >> b[i] >> c[i];

        suma += a[i];

        sumb += b[i];

    }



    int dp[n+1][suma+1][sumb+1];  // dp[i+1][j][k] : i番目(iは0-index)までの薬品でAをjグラム,Bをkグラムとするときに必要な予算の最小値



    rep(i, n+1) {

        rep(j, suma+1) {

            rep(k, sumb+1) {

                dp[i][j][k] = INF;

            }

        }

    }



    dp[0][0][0] = 0;

    rep(i, n) {

        rep(j, suma+1) {

            rep(k, sumb+1) {

                if(j >= a[i] && k >= b[i]) {

                    dp[i+1][j][k] = min(dp[i][j][k], dp[i][j-a[i]][k-b[i]] + c[i]);

                }

                else {

                    dp[i+1][j][k] = dp[i][j][k];

                }

            }

        }

    }

    

    int ans = INF;

    for(int j = 1; j <= suma; j++) {

        for(int k = 1; k <= sumb; k++) {

            if(mb*j == ma*k) {

                ans = min(ans, dp[n][j][k]);

            }

        }

    }



    if(ans == INF) {

        cout << -1;

    }

    else {

        cout << ans;

    }



    cout << endl;

    return 0;

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

#include <algorithm>

#include <vector>

#include <queue>

#include <map>

#include <cmath>

using namespace std;

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

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

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;}

using ll = long long;

constexpr long long INF = 1LL << 62;

constexpr int MOD = 1e9 + 7;



ll dp[44][444][444];

ll a[44],b[44],c[44];



int main() {

    cin.tie(0); ios_base::sync_with_stdio(false);

    int n, ma, mb; cin >> n >> ma >> mb;

    REP(i,n) cin >> a[i] >> b[i] >> c[i];

    REP(i,n+1) REP(j,404) REP(k,404) dp[i][j][k] = INF;



    dp[0][0][0] = 0;

    REP(i,n) {

        REP(j,404) {

            REP(k,404) {

                chmin(dp[i+1][j+a[i]][k+b[i]], dp[i][j][k] + c[i]);

                chmin(dp[i+1][j][k], dp[i][j][k]);

            }

        }

    }



    ll ans = INF;

    rep(i,1,404) rep(j,1,404) if(i*mb == j*ma) chmin(ans, dp[n][i][j]);

    if(ans==INF) cout << -1;

    else cout << ans;

    cout << '\n';



    return 0;

}

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

#include <algorithm>

#include <vector>

#include <queue>

#include <map>

#include <cmath>

using namespace std;

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

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

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;}

constexpr int INF = 1e9;



int dp[44][444][444];

int a[44],b[44],c[44];



int main() {

    cin.tie(0); ios_base::sync_with_stdio(false);

    int n, ma, mb; cin >> n >> ma >> mb;

    REP(i,n) cin >> a[i] >> b[i] >> c[i];

    REP(i,n+1) REP(j,404) REP(k,404) dp[i][j][k] = INF;



    dp[0][0][0] = 0;

    REP(i,n) {

        REP(j,404) {

            REP(k,404) {

                chmin(dp[i+1][j+a[i]][k+b[i]], dp[i][j][k] + c[i]);

                chmin(dp[i+1][j][k], dp[i][j][k]);

            }

        }

    }



    int ans = INF;

    rep(i,1,404) rep(j,1,404) if(i*mb == j*ma) chmin(ans, dp[n][i][j]);

    if(ans==INF) cout << -1;

    else cout << ans;

    cout << '\n';



    return 0;

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

#define INF 1e9

using namespace std;



signed main()

{

    ios::sync_with_stdio(false);

    cin.tie(0);



    int n, m1, m2;

    cin >> n >> m1 >> m2;

    vector<int> a(n), b(n), c(n);

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

        cin >> a[i] >> b[i] >> c[i];

    int dp[500][500], nxt[500][500];

    for (int i = 0; i < 500; i++)

    {

        for (int j = 0; j < 500; j++)

        {

            dp[i][j] = INF;

        }

    }

    dp[0][0] = 0;

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

    {

        for (int j = 0; j < 500; j++)

        {

            for (int k = 0; k < 500; k++)

            {

                nxt[j][k] = INF;

            }

        }

        for (int j = 0; j < 500; j++)

        {

            for (int k = 0; k < 500; k++)

            {

                if (j - a[i] < 0 || k - b[i] < 0)

                    nxt[j][k] = dp[j][k];

                else

                    nxt[j][k] = min(dp[j][k], dp[j - a[i]][k - b[i]] + c[i]);

            }

        }

        for (int j = 0; j < 500; j++)

        {

            for (int k = 0; k < 500; k++)

            {

                dp[j][k] = nxt[j][k];

            }

        }

    }

    int ans = INF;

    for (int i = 1; m1 * i < 500 && m2 * i < 500; i++)

        ans = min(ans, dp[m1 * i][m2 * i]);

    if (ans == INF)

        ans = -1;

    cout << ans << endl;

}

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

#define INF 1e18

#define int long long

#define Rep(i, a, n) for (int i = (a); i < (n); i++)

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

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

using namespace std;

typedef pair<int, int> P;

typedef pair<int, P> PP;

const int mod = 1000000007;



#define MAX_N 41

#define MAX_M 401



int n, ma, mb;

vector<int> a, b, c;

int dp[MAX_N][MAX_M][MAX_M];

bool vis[MAX_N][MAX_M][MAX_M];



int solve(int N, int A, int B)

{

    if (vis[N][A][B])

        return dp[N][A][B];

    vis[N][A][B] = true;

    if (N == n)

    {

        if (A != 0 && B != 0 && ma * B == A * mb)

            return dp[N][A][B] = 0;

        else

            return dp[N][A][B] = INF;

    }

    return dp[N][A][B] = min(solve(N + 1, A, B), solve(N + 1, A + a[N], B + b[N]) + c[N]);

}



signed main()

{

    ios::sync_with_stdio(false);

    cin.tie(0);



    cin >> n >> ma >> mb;

    a.resize(n), b.resize(n), c.resize(n);

    rep(i, n) cin >> a[i] >> b[i] >> c[i];

    int ans = solve(0, 0, 0);

    if (ans >= INF)

        ans = -1;

    cout << ans << endl;

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

#include <cstring>



using namespace std;



#define rep1(i,x) for(int i=1;i<=(x);++i)



int a[100001];

int memo[100001];

int start[100001];



int main()

{

	int n, k;

	while (scanf("%d %d", &n, &k), n || k) {

		memset(a, 0, sizeof(a));

		memset(memo, 0, sizeof(memo));

		memset(start, 0, sizeof(start));



		bool f = false;



		rep1(i, k) {

			int tmp; scanf("%d", &tmp);

			if (tmp == 0) f = true;

			else a[tmp] = true;

		}



		rep1(i, n) {

			if (a[i]) {

				if (i - 1 >= 0 && a[i - 1]) {

					start[i] = start[i - 1];

					memo[start[i]]++;

				} else {

					start[i] = i;

					memo[start[i]]++;

				}

			}

		}



		int ma = 0;

		int now = -1;



		rep1(i, n) {

			if (a[i]) {

				if (now == start[i]) continue;

				if (ma < memo[start[i]]) {

					ma = memo[start[i]];

					now = start[i];

				}

			} else if (f) {

				int v;

				if (i + 1 <= n && a[i - 1] && a[i + 1]) {

					v = memo[start[i - 1]] + memo[start[i + 1]] + 1;

					if (ma < v) {

						ma = v;

						now = start[i + 1];

					}

				} else if (a[i - 1]) {

					v = memo[start[i - 1]] + 1;

					if (ma < v) {

						ma = v;

						now = start[i - 1];

					}

				} else if (i + 1 <= n && a[i + 1]) {

					v = memo[start[i + 1]] + 1;

					if (ma < v) {

						ma = v;

						now = start[i + 1];

					}

				}

			}

		}



		printf("%d\n", ma);

	}

}

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

#include <algorithm>



using namespace std;



#define rep1(i,x) for(int i=1;i<=(x);++i)



int a[100001];

int memo[100001];

int start[100001];



int main()

{

	int n, k;

	while (scanf("%d %d", &n, &k), n || k) {

        fill(a, a + n, 0);

        fill(memo, memo + n, 0);

        fill(start, start + n, 0);



		bool f = false;



		rep1(i, k) {

			int tmp; scanf("%d", &tmp);

			if (tmp == 0) f = true;

			else a[tmp] = true;

		}



		rep1(i, n) {

			if (a[i]) {

				if (a[i - 1]) {

					start[i] = start[i - 1];

					memo[start[i]]++;

				} else {

					start[i] = i;

					memo[start[i]]++;

				}

			}

		}



		int ma = 0;

		int now = -1;



		rep1(i, n) {

			int v, nnow;



			if (a[i]) {

				if (now == start[i]) continue;

				v = memo[start[i]];

				nnow = start[i];

			} else if (f) {

				if (i + 1 <= n) {

					v = memo[start[i - 1]] + memo[start[i + 1]];

					nnow = start[i + 1];

				} else {

					v = memo[start[i - 1]];

					nnow = start[i - 1];

				}

				v++;

			}



			if (ma < v) {

				ma = v;

				now = nnow;

			}

		}



		printf("%d\n", ma);

	}

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

#include <cstring>



using namespace std;



#define rep1(i,x) for(int i=1;i<=(x);++i)



int a[100001];

int memo[100001];

int start[100001];



int main()

{

    int n, k;

    while (scanf("%d %d", &n, &k), n || k) {

        memset(a, 0, sizeof(a));

        memset(memo, 0, sizeof(memo));

        memset(start, 0, sizeof(start));



        bool f = false;



        rep1(i, k) {

            int tmp; scanf("%d", &tmp);

            if (tmp == 0) f = true;

            else a[tmp] = true;

        }



        rep1(i, n) {

            if (a[i]) {

                if (i - 1 >= 0 && a[i - 1]) {

                    start[i] = start[i - 1];

                    memo[start[i]]++;

                } else {

                    start[i] = i;

                    memo[start[i]]++;

                }

            }

        }



        int ma = 0;

        int now = -1;



        rep1(i, n) {

            if (a[i]) {

                if (now == start[i]) continue;

                if (ma < memo[start[i]]) {

                    ma = memo[start[i]];

                    now = start[i];

                }

            } else if (f) {

                int v;

                if (i + 1 <= n && a[i - 1] && a[i + 1]) {

                    v = memo[start[i - 1]] + memo[start[i + 1]] + 1;

                    if (ma < v) {

                        ma = v;

                        now = start[i + 1];

                    }

                } else if (a[i - 1]) {

                    v = memo[start[i - 1]] + 1;

                    if (ma < v) {

                        ma = v;

                        now = start[i - 1];

                    }

                } else if (i + 1 <= n && a[i + 1]) {

                    v = memo[start[i + 1]] + 1;

                    if (ma < v) {

                        ma = v;

                        now = start[i + 1];

                    }

                }

            }

        }



        printf("%d\n", ma);

    }

}

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

#include <algorithm>



using namespace std;



#define rep1(i,x) for(int i=1;i<=(x);++i)

#define chmax(a,b) a=max(a,b)



int a[100001];

int memo[100001];

int start[100001];



int main()

{

	int n, k;

	while (scanf("%d %d", &n, &k), n || k) {

		fill_n(a, n, 0);

		fill_n(memo, n, 0);

		fill_n(start, n, 0);



		bool f = false;



		rep1(i, k) {

			int tmp; scanf("%d", &tmp);

			if (tmp == 0) f = true;

			else a[tmp] = true;

		}



		rep1(i, n) {

			if (a[i]) {

				if (a[i - 1]) {

					start[i] = start[i - 1];

					memo[start[i]]++;

				} else {

					start[i] = i;

					memo[start[i]]++;

				}

			}

		}



		int ma = 0;



		rep1(i, n) {

			if (a[i]) {

				chmax(ma, memo[start[i]]);

			} else if (f) {

				if (i + 1 <= n) {

					chmax(ma, memo[start[i - 1]] + memo[start[i + 1]] + 1);

				} else {

					chmax(ma, memo[start[i - 1]] + 1);

				}

			}

		}



		printf("%d\n", ma);

	}

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

#include <cstring>



using namespace std;



#define rep1(i,x) for(int i=1;i<=(x);++i)



int a[100001];

int memo[100001];

int start[100001];



int main()

{

	int n, k;

	while (scanf("%d %d", &n, &k), n || k) {

		memset(a, 0, sizeof(a));

		memset(memo, 0, sizeof(memo));

		memset(start, 0, sizeof(start));



		bool f = false;



		rep1(i, k) {

			int tmp; scanf("%d", &tmp);

			if (tmp == 0) f = true;

			else a[tmp] = true;

		}



		rep1(i, n) {

			if (a[i]) {

				if (i - 1 >= 0 && a[i - 1]) {

					start[i] = start[i - 1];

					memo[start[i]]++;

				} else {

					start[i] = i;

					memo[start[i]]++;

				}

			}

		}



		int ma = 0;

		int now = -1;



		rep1(i, n) {

			if (a[i]) {

				if (now == start[i]) continue;

				if (ma < memo[start[i]]) {

					ma = memo[start[i]];

					now = start[i];

				}

			} else if (f) {

				int v;

				if (i + 1 <= n && a[i - 1] && a[i + 1]) {

					v = memo[start[i - 1]] + memo[start[i + 1]] + 1;

					if (ma < v) {

						ma = v;

						now = start[i + 1];

					}

				} else if (a[i - 1]) {

					v = memo[start[i - 1]] + 1;

					if (ma < v) {

						ma = v;

						now = start[i - 1];

					}

				} else if (i + 1 <= n && a[i + 1]) {

					v = memo[start[i + 1]] + 1;

					if (ma < v) {

						ma = v;

						now = start[i + 1];

					}

				}

			}

		}



		printf("%d\n", ma);

	}

}

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

#include <algorithm>



using namespace std;



#define rep1(i,x) for(int i=1;i<=(x);++i)

#define chmax(a,b) a=max(a,b)



int a[100001];

int memo[100001];

int start[100001];



int main()

{

	int n, k;

	while (scanf("%d %d", &n, &k), n || k) {

		fill_n(a, n, 0);

		fill_n(memo, n, 0);

		fill_n(start, n, 0);



		bool f = false;



		rep1(i, k) {

			int tmp; scanf("%d", &tmp);

			if (tmp == 0) f = true;

			else a[tmp] = true;

		}



		rep1(i, n) {

			if (a[i]) {

				if (a[i - 1]) {

					start[i] = start[i - 1];

					memo[start[i]]++;

				} else {

					start[i] = i;

					memo[start[i]]++;

				}

			}

		}



		int ma = 0;



		rep1(i, n) {

			if (a[i]) {

				chmax(ma, memo[start[i]]);

			} else if (f) {

				if (i + 1 <= n) {

					chmax(ma, memo[start[i - 1]] + memo[start[i + 1]] + 1);

				} else {

					chmax(ma, memo[start[i - 1]] + 1);

				}

			}

		}



		printf("%d\n", ma);

	}

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

#include <cstring>



using namespace std;



#define rep1(i,x) for(int i=1;i<=(x);++i)



int a[100001];

int memo[100001];

int start[100001];



int main()

{

    int n, k;

    while (scanf("%d %d", &n, &k), n || k) {

        memset(a, 0, sizeof(a));

        memset(memo, 0, sizeof(memo));

        memset(start, 0, sizeof(start));



        bool f = false;



        rep1(i, k) {

            int tmp; scanf("%d", &tmp);

            if (tmp == 0) f = true;

            else a[tmp] = true;

        }



        rep1(i, n) {

            if (a[i]) {

                if (i - 1 >= 0 && a[i - 1]) {

                    start[i] = start[i - 1];

                    memo[start[i]]++;

                } else {

                    start[i] = i;

                    memo[start[i]]++;

                }

            }

        }



        int ma = 0;

        int now = -1;



        rep1(i, n) {

            if (a[i]) {

                if (now == start[i]) continue;

                if (ma < memo[start[i]]) {

                    ma = memo[start[i]];

                    now = start[i];

                }

            } else if (f) {

                int v;

                if (i + 1 <= n && a[i - 1] && a[i + 1]) {

                    v = memo[start[i - 1]] + memo[start[i + 1]] + 1;

                    if (ma < v) {

                        ma = v;

                        now = start[i + 1];

                    }

                } else if (a[i - 1]) {

                    v = memo[start[i - 1]] + 1;

                    if (ma < v) {

                        ma = v;

                        now = start[i - 1];

                    }

                } else if (i + 1 <= n && a[i + 1]) {

                    v = memo[start[i + 1]] + 1;

                    if (ma < v) {

                        ma = v;

                        now = start[i + 1];

                    }

                }

            }

        }



        printf("%d\n", ma);

    }

}

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

#include <algorithm>



using namespace std;



#define rep1(i,x) for(int i=1;i<=(x);++i)

#define chmax(a,b) a=max(a,b)



int a[100001];

int memo[100001];

int start[100001];



int main()

{

	int n, k;

    while (cin >> n >> k, n || k) {

		fill_n(a, n, 0);

		fill_n(memo, n, 0);

		fill_n(start, n, 0);



		bool f = false;



		rep1(i, k) {

			int tmp; cin >> tmp;

			if (tmp == 0) f = true;

			else a[tmp] = true;

		}



		rep1(i, n) {

			if (a[i]) {

				if (a[i - 1]) {

					start[i] = start[i - 1];

					memo[start[i]]++;

				} else {

					start[i] = i;

					memo[start[i]]++;

				}

			}

		}



		int ma = 0;



		rep1(i, n) {

			if (a[i]) {

				chmax(ma, memo[start[i]]);

			} else if (f) {

				if (i + 1 <= n) {

					chmax(ma, memo[start[i - 1]] + memo[start[i + 1]] + 1);

				} else {

					chmax(ma, memo[start[i - 1]] + 1);

				}

			}

		}



        cout << ma << endl;

	}

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

#include <cstring>



using namespace std;



#define rep1(i,x) for(int i=1;i<=(x);++i)



int a[100001];

int memo[100001];

int start[100001];



int main()

{

	int n, k;

	while (scanf("%d %d", &n, &k), n || k) {

		memset(a, 0, sizeof(a));

		memset(memo, 0, sizeof(memo));

		memset(start, 0, sizeof(start));



		bool f = false;



		rep1(i, k) {

			int tmp; scanf("%d", &tmp);

			if (tmp == 0) f = true;

			else a[tmp] = true;

		}



		rep1(i, n) {

			if (a[i]) {

				if (i - 1 >= 0 && a[i - 1]) {

					start[i] = start[i - 1];

					memo[start[i]]++;

				} else {

					start[i] = i;

					memo[start[i]]++;

				}

			}

		}



		int ma = 0;

		int now = -1;



		rep1(i, n) {

			if (a[i]) {

				if (now == start[i]) continue;

				if (ma < memo[start[i]]) {

					ma = memo[start[i]];

					now = start[i];

				}

			} else if (f) {

				int v;

				if (i + 1 <= n && a[i - 1] && a[i + 1]) {

					v = memo[start[i - 1]] + memo[start[i + 1]] + 1;

					if (ma < v) {

						ma = v;

						now = start[i + 1];

					}

				} else if (a[i - 1]) {

					v = memo[start[i - 1]] + 1;

					if (ma < v) {

						ma = v;

						now = start[i - 1];

					}

				} else if (i + 1 <= n && a[i + 1]) {

					v = memo[start[i + 1]] + 1;

					if (ma < v) {

						ma = v;

						now = start[i + 1];

					}

				}

			}

		}



		printf("%d\n", ma);

	}

}

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

#include <algorithm>



using namespace std;



#define rep1(i,x) for(int i=1;i<=(x);++i)

#define chmax(a,b) a=max(a,b)



int a[100001];

int memo[100001];

int start[100001];



int main()

{

	int n, k;

    while (cin >> n >> k, n || k) {

		fill_n(a, n, 0);

		fill_n(memo, n, 0);

		fill_n(start, n, 0);



		bool f = false;



		rep1(i, k) {

			int tmp; cin >> tmp;

			if (tmp == 0) f = true;

			else a[tmp] = true;

		}



		rep1(i, n) {

			if (a[i]) {

				if (a[i - 1]) {

					start[i] = start[i - 1];

					memo[start[i]]++;

				} else {

					start[i] = i;

					memo[start[i]]++;

				}

			}

		}



		int ma = 0;



		rep1(i, n) {

			if (a[i]) {

				chmax(ma, memo[start[i]]);

			} else if (f) {

				if (i + 1 <= n) {

					chmax(ma, memo[start[i - 1]] + memo[start[i + 1]] + 1);

				} else {

					chmax(ma, memo[start[i - 1]] + 1);

				}

			}

		}



        cout << ma << endl;

	}

}