stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int a,b,c;

int z;

int main()

{

	cin>>a;

	for (int i=1;i<=a;i++)

	{

		cin>>b>>c;

		z=z+(c-b+1);

	}

	cout<<z<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

using namespace std;



int l, r, ans, n;

int main() {

	scanf("%d", &n);

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

		scanf("%d%d", &l, &r);

		ans += r - l + 1;

	}

	printf("%d", ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

inline int read()

{

    int num = 0;

    char c;

    bool flag = false;

    while ((c = getchar()) == ' ' || c == '\n' || c == '\r');

        if (c == '-') flag = true;

    else

        num = c - '0';

    while (isdigit(c = getchar()))

    num = num * 10 + c - '0';

    return (flag ? -1 : 1) * num;

}

int main()

{

	int n,a,b,sum=0;

	n=read();

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

	{

		a=read();

		b=read();

		sum+=b-a+1;

	}

	cout<<sum<<endl;

	return 0;

}




// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

using namespace std;



int l, r, ans, n;

int main() {

	scanf("%d", &n);

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

		scanf("%d%d", &l, &r);

		ans += r - l + 1;

	}

	printf("%d", ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int a,b,c,d;

int main(){

    cin>>a;

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

        cin>>b>>c;

        d+=c-b+1;

    }

    cout<<d<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

using namespace std;



int l, r, ans, n;

int main() {

	scanf("%d", &n);

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

		scanf("%d%d", &l, &r);

		ans += r - l + 1;

	}

	printf("%d", ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

	int n,cnt=0,l,r;

	scanf("%d",&n);

	while(n--){

		scanf("%d%d",&l,&r);

		cnt+=r-l+1;

	}

	cout<<cnt<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

using namespace std;



int l, r, ans, n;

int main() {

	scanf("%d", &n);

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

		scanf("%d%d", &l, &r);

		ans += r - l + 1;

	}

	printf("%d", ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

	int n,a[10002],b[10002],ans=0;

	cin>>n;

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

	{

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

	}

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

	{

		ans+=b[i]-a[i]+1;

	}

	cout<<ans;

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

using namespace std;



int l, r, ans, n;

int main() {

	scanf("%d", &n);

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

		scanf("%d%d", &l, &r);

		ans += r - l + 1;

	}

	printf("%d", ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int n,l,r,ans;

int main(){

    cin>>n;

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

        cin>>l>>r;

        ans+=r-l+1;

    }

    cout<<ans<<endl;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

using namespace std;



int l, r, ans, n;

int main() {

	scanf("%d", &n);

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

		scanf("%d%d", &l, &r);

		ans += r - l + 1;

	}

	printf("%d", ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int n,l,r,ans,i;

int main(){

	scanf("%d",&n);

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

		scanf("%d%d",&l,&r);

		ans+=r-l+1;

	}

	printf("%d",ans);

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

using namespace std;



int l, r, ans, n;

int main() {

	scanf("%d", &n);

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

		scanf("%d%d", &l, &r);

		ans += r - l + 1;

	}

	printf("%d", ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

    int n;

    int l,r,ans=0;

    cin>>n;

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

        cin>>l>>r;

        ans+=r-l+1;

    }

    cout<<ans<<endl;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

using namespace std;



int l, r, ans, n;

int main() {

	scanf("%d", &n);

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

		scanf("%d%d", &l, &r);

		ans += r - l + 1;

	}

	printf("%d", ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

	int l,r;

	int n;

	cin>>n;

	int ans=0;

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

	{

		cin>>l>>r;

		ans+=r-l+1;

	}

	cout<<ans<<endl;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

using namespace std;



int l, r, ans, n;

int main() {

	scanf("%d", &n);

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

		scanf("%d%d", &l, &r);

		ans += r - l + 1;

	}

	printf("%d", ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int n,a,b,ans;

int main()

{

    scanf("%d",&n);

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

    {

    	scanf("%d%d",&a,&b);

    	ans+=b-a+1;

	}

	cout<<ans<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

using namespace std;



int l, r, ans, n;

int main() {

	scanf("%d", &n);

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

		scanf("%d%d", &l, &r);

		ans += r - l + 1;

	}

	printf("%d", ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int n,l,r,ans;

int main()

{

	cin>>n;

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

	{

		cin>>l>>r;

		ans+=r-l+1;

	}

	cout<<ans;

	return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

using namespace std;



int l, r, ans, n;

int main() {

	scanf("%d", &n);

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

		scanf("%d%d", &l, &r);

		ans += r - l + 1;

	}

	printf("%d", ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int m,x,y,ans;

int main(){

	scanf("%d",&m);

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

		scanf("%d%d",&x,&y);

		ans+=(y-x+1);

	}

	printf("%d",ans);

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

using namespace std;



int l, r, ans, n;

int main() {

	scanf("%d", &n);

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

		scanf("%d%d", &l, &r);

		ans += r - l + 1;

	}

	printf("%d", ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

    int n,l,r,s=0;

    cin>>n;

    while(n--){

    cin>>l>>r;

    s+=r-l+1;

    }

    cout<<s<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cmath>

using namespace std;



int l, r, ans, n;

int main() {

	scanf("%d", &n);

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

		scanf("%d%d", &l, &r);

		ans += r - l + 1;

	}

	printf("%d", ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int main(){

    int n,l,r,a;

    cin>>n;

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

        cin>>l>>r;

        a+=r-l+1;

    }

    cout<<a<<endl;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int n,r,l,lhy,i;//lhy，最新防伪标识!（不是刘浩宇！！！）

int main()

{

    scanf("%d",&n);

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

    {scanf("%d%d",&l,&r);//l代表左边，r代表右边

    lhy+=r-l+1;}//加一个，头尾都有

    printf("%d\n",lhy);//回车别忘了

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int n;

int sum;

int main(){

	scanf("%d",&n);

	int l,r;

	while(n--){

		scanf("%d%d",&l,&r);

		sum+=r-l+1;

	}

	printf("%d",sum);

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int n,r,l,lhy,i;//lhy，最新防伪标识!（不是刘浩宇！！！）

int main()

{

    scanf("%d",&n);

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

    {scanf("%d%d",&l,&r);//l代表左边，r代表右边

    lhy+=r-l+1;}//加一个，头尾都有

    printf("%d\n",lhy);//回车别忘了

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n;

    int l,r,ans=0;

    cin>>n;

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

    {

        cin>>l>>r;

        ans+=r-l+1;

    }

    cout<<ans<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int n,r,l,lhy,i;//lhy，最新防伪标识!（不是刘浩宇！！！）

int main()

{

    scanf("%d",&n);

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

    {scanf("%d%d",&l,&r);//l代表左边，r代表右边

    lhy+=r-l+1;}//加一个，头尾都有

    printf("%d\n",lhy);//回车别忘了

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>



int main()

{

    int n, ans = 0;

    std::cin >> n;

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

        int l, r;

        std::cin >> l >> r;

        ans += (r - l + 1);

    }

    std::cout << ans << std::endl;

}

// Optimized solution to the same problem (faster):
#include <cstdio>



int main()

{

    int n, ans = 0;

    scanf("%d", &n);

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

        int l, r;

        scanf("%d%d", &l, &r);

        ans += (r - l + 1);

    }

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include "bits/stdc++.h"

 

typedef long long ll;

#define int ll

#define fi first

#define se second

#define SORT(a) sort(a.begin(),a.end())

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

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

#define MP(a,b) make_pair(a,b)

#define pb(a) push_back(a)

#define INF LLONG_MAX/2

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

#define debug(x) cerr<<#x<<": "<<x<<endl

#define debug_vec(v) cerr<<#v<<":";rep(i,v.size())cerr<<" "<<v[i];cerr<<endl

using namespace std;

int MOD = 1000000007;

vector<int> G[100100];



signed main(){

    string s;

    cin >> s;

    int mx = 0;

    int cnt = 0;

    rep(i,s.size()){

        if(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T'){

            cnt++;

            mx = max(mx,cnt);

        }else{

            cnt = 0;

        }

    }

    cout << mx << endl;

    

    return 0; 

}



// g++ -std=c++14 code1.cpp

// rm -r -f test;oj dl https://yahoo-procon2019-qual.contest.atcoder.jp/tasks/yahoo_procon2019_qual_d

// rm -r -f test;oj dl http://abc122.contest.atcoder.jp/tasks/abc122_a

// Optimized solution to the same problem (faster):
#include "bits/stdc++.h"

 

using namespace std;

typedef long long ll;

typedef vector<ll> vll;

#define int ll

#define fi first

#define se second

#define SORT(a) sort(a.begin(),a.end())

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

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

#define MP(a,b) make_pair(a,b)

#define pb(a) push_back(a)

#define INF LLONG_MAX/2

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

#define debug(x) cerr<<#x<<": "<<x<<endl

#define debug_vec(v) cerr<<#v<<":";rep(i,v.size())cerr<<" "<<v[i];cerr<<endl

/*----------------------------------------------------------------*/



// int MOD = 998244353;

int MOD = 1000000007;





/*----------------------------------------------------------------*/

signed main(){



    string s;

    cin >> s;

    

    int mx = 0;

    int a,b;

    for(int i = 0;i < s.size();i++){

        int cnt = 0;

        rep(j,s.size()){

            if(i+j >= s.size() || (s[i+j] != 'A' && s[i+j] != 'T' && s[i+j] != 'C' && s[i+j] != 'G'))break;

            cnt++;

        }

        mx = max(mx,cnt);

    }

    cout << mx << endl;

    



	return 0;

}

/*----------------------------------------------------------------*/



// g++ -std=c++14 code1.cpp

// sudo pip3 install --upgrade online-judge-tools

// rm -r -f test;oj dl https://code-festival-2018-quala.contest.atcoder.jp/tasks/code_festival_2018_quala_c

// rm -r -f test;oj dl https://ddcc2020-qual.contest.atcoder.jp/tasks/ddcc2020_qual_b

// rm -r -f test;oj dl https://abc122.contest.atcoder.jp/tasks/abc122_b

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <regex>



using namespace std;

int main() {

    string s;

    cin >> s;

    int len=0;

    regex re(R"([ACGT]+)");

    sregex_iterator iter(s.cbegin(), s.cend(), re);

    sregex_iterator end;

    for(;iter!=end;++iter) {

        string m = iter->str();

        if (m.length()>len) len = m.length();

    }

    cout << len << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <iostream>

using namespace std;

int main() {

    string s;

    cin >> s;

    int slen=s.length(), len=0;

    int l=0;

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

        char c = s[i];

        if (c=='A' || c=='C' || c=='G' || c=='T') {

            l++;

            if (l>len) len = l;

        } else {

            l = 0;

        }

    }

    cout << len << endl;

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<cstring>

struct vec{

	int x,nx;

}e[5000001];

int h[200001],p,cnt,co[200001];

void ae(int fr,int to){

	e[++p]=(vec){to,h[fr]};h[fr]=p; 

}

int mi[200001<<2];

int n,f[200001],q;

int Min(int p,int q){

	return p<q?p:q;

}

int Max(int p,int q){

	return p>q?p:q;

}

int ask(int i,int l,int r,int ql,int qr){

	if(r<ql||l>qr) return 2147483647;

	if(ql<=l&&r<=qr) return mi[i];

	int m=(l+r)>>1;

	return Min(ask(i<<1,l,m,ql,qr),ask(i<<1|1,m+1,r,ql,qr));

}

void upd(int i,int l,int r,int k,int pos){

	if(r<pos||l>pos) return;

	if(l==r&&r==pos){

		mi[i]=Min(mi[i],k);return;

	}

	int m=(l+r)>>1;

	upd(i<<1,l,m,k,pos);upd(i<<1|1,m+1,r,k,pos);

	mi[i]=Min(mi[i<<1],mi[i<<1|1]);

}

int main(){

	scanf("%d",&n);

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

		scanf("%d",&a);

		cnt+=!a;

		co[i]=a?1:-1;

	}

	scanf("%d",&q);

	for(int i=1,l,r;i<=q;i++){

		scanf("%d%d",&l,&r);

		ae(l,r);

	}

	memset(mi,0x3f,sizeof(mi));

	memset(f,0x3f,sizeof(f));

	f[0]=0;

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

		for(int j=h[i];j;j=e[j].nx){

			int mi=f[i-1];

			mi=Min(mi,ask(1,1,n,Max(i-1,1),e[j].x));

			if(mi<f[e[j].x]){

				f[e[j].x]=mi;

				upd(1,1,n,mi,e[j].x);

			}

		}

		f[i]=Min(f[i],f[i-1]+co[i]);

	}

	printf("%d\n",f[n]+cnt);

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#define MN 262150

using namespace std;

struct node{int x,y;}b[MN];

int t[MN<<1],a[MN];

int MQ,INF,n,m,ans,f0;



inline int read()

{

	int n=0,f=1; char c=getchar();

	while (c<'0' || c>'9') {if(c=='-')f=-1; c=getchar();}

	while (c>='0' && c<='9') {n=n*10+c-'0'; c=getchar();}

	return n*f;

}



inline void grw(int x,int y) {for (x+=MQ;x;x>>=1) if (t[x]>y) t[x]=y; else return;}

inline int gmn(int x,int y)

{

	int sm=INF;

	for (x+=MQ,y+=MQ;x<=y;x>>=1,y>>=1)

	{

		if ( x&1) sm=min(sm,t[x++]);

		if (~y&1) sm=min(sm,t[y--]);

	}

	return sm;

}

bool cmp(const node& a,const node& b) {return a.x<b.x || a.x==b.x && a.y>b.y;}



int main()

{

	register int i,j;

	n=read(); for (i=1;i<=n;++i) a[i]=read(),ans+=(a[i]==0),a[i]=a[i]?1:-1;

	m=read(); for (i=1;i<=m;++i) b[i].x=read(),b[i].y=read();

	sort(b+1,b+m+1,cmp); memset(t,100,sizeof(t)); INF=t[0]; f0=0;

	for (MQ=1;MQ<n;MQ<<=1); --MQ;

	for (i=j=1;i<=n;f0=min(f0+a[i],t[i+MQ]),++i)

		for (;j<=m&&b[j].x==i;++j)

			grw(b[j].y,min(gmn(i,b[j].y),f0));

	printf("%d",ans+f0);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <vector>

#include <stdio.h>

#include <string.h>

#include <iostream>

#include <algorithm>

#define R register

typedef long long ll;

inline int read(){

	R int x; R bool f; R char c;

	for (f=0; (c=getchar())<'0'||c>'9'; f=c=='-');

	for (x=c^'0'; (c=getchar())>='0'&&c<='9'; x=(x<<1)+(x<<3)+(c^'0'));

	return f?-x:x;

}

#define M (1<<18)

#define MN 200005

int T[M<<1],n,q,cost[MN],cnt;

std::vector<int> rang[MN];

inline void rw(int k,int v){for (k+=M; k; k>>=1) if (T[k]<=v) return; else T[k]=v;}

inline int query(int l,int r){

	R int res=0x3f3f3f3f;

	for (l+=M-1,r+=M+1; l^r^1; l>>=1,r>>=1){

		if (~l&1) res=std::min(T[l^1],res);

		if ( r&1) res=std::min(T[r^1],res);

	}return res;

}

int main(){

	n=read();for (R int i=1; i<=n; ++i)

		cost[i]=read()?1:-1,cnt+=(bool)(!(~cost[i]));

	q=read();for (R int i=1,x,y; i<=q; ++i)

		x=read(),y=read(),rang[x].push_back(y);

	memset(T,0x3f,sizeof(T));rw(0,0);

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

		for (auto j : rang[i]){

			R int res = T[i+M-1];

			res=std::min(res,query(std::max(i-1,1),j));

			rw(j,res);

		}rw(i,T[i+M-1]+cost[i]);

	}printf("%d\n",T[n+M]+cnt);

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

#define MN 262150

using namespace std;

struct node{int x,y;}b[MN];

int t[MN<<1],a[MN];

int MQ,INF,n,m,ans,f0;



inline int read()

{

	int n=0,f=1; char c=getchar();

	while (c<'0' || c>'9') {if(c=='-')f=-1; c=getchar();}

	while (c>='0' && c<='9') {n=n*10+c-'0'; c=getchar();}

	return n*f;

}



inline void grw(int x,int y) {for (x+=MQ;x;x>>=1) if (t[x]>y) t[x]=y; else return;}

inline int gmn(int x,int y)

{

	int sm=INF;

	for (x+=MQ,y+=MQ;x<=y;x>>=1,y>>=1)

	{

		if ( x&1) sm=min(sm,t[x++]);

		if (~y&1) sm=min(sm,t[y--]);

	}

	return sm;

}

bool cmp(const node& a,const node& b) {return a.x<b.x || a.x==b.x && a.y>b.y;}



int main()

{

	register int i,j;

	n=read(); for (i=1;i<=n;++i) a[i]=read(),ans+=(a[i]==0),a[i]=a[i]?1:-1;

	m=read(); for (i=1;i<=m;++i) b[i].x=read(),b[i].y=read();

	sort(b+1,b+m+1,cmp); memset(t,100,sizeof(t)); INF=t[0]; f0=0;

	for (MQ=1;MQ<n;MQ<<=1); --MQ;

	for (i=j=1;i<=n;f0=min(f0+a[i],t[i+MQ]),++i)

		for (;j<=m&&b[j].x==i;++j)

			grw(b[j].y,min(gmn(i,b[j].y),f0));

	printf("%d",ans+f0);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <vector>

#include <algorithm>

#include <cstring>



using namespace std;



const int MOD = 1000000007;



int main(){

	int N, W;

	static int dp[201][10001];

	while(cin >> N >> W){

		vector<int> w(N);

		for(int i=0;i<N;i++) cin >> w[i];

		sort(w.begin(), w.end());

		memset(dp, 0, sizeof(dp));

		dp[N][0] = 1;

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

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

				for(int k=W;k>=0;k--){

					dp[i][k] = (dp[i][k]+dp[j][k])%MOD;

					if(k+w[i]<=W) dp[j][k+w[i]] = (dp[j][k+w[i]]+dp[j][k])%MOD;

					dp[j][k] = 0;

				}

			}

		}

		int res = 0;

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

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

				if(i==N || j+w[i] > W) res = (res+dp[i][j])%MOD;

			}

		}

		cout << res << endl;

	}

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <vector>

#include <numeric>

#include <algorithm>



using namespace std;



const int MOD = 1000000007;



int solve(const vector<int>& w, int W){

    if(w.back() > W || w.size() == 1) return 1;

    int sum = accumulate(w.begin(), w.end(), 0);

    if(sum <= W) return 1;

    vector<int> dp(W+1, 0);

    dp[0] = 1;

    int res = 0;

    for(int i=0;i<w.size();i++){

        for(int j=W-w[i];j>=0;j--){

            dp[j+w[i]] += dp[j];

            dp[j+w[i]] %= MOD;

        }

        sum -= w[i];

        for(int j=max(0, W-sum-w[i]+1);j<=W-sum-(i==w.size()-1?0:w[i+1]);j++){

            res = (res + dp[j]) % MOD;

        }

    }

    return res;

}



int main(){

    int N, W;

    while(cin >> N >> W){

        vector<int> w(N);

        for(auto& t : w) cin >> t;

        sort(w.rbegin(), w.rend());

        cout << solve(w, W) << endl;

    }

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <algorithm>

#include <cstring>



using namespace std;

typedef long long ll;



const int mod=1000000007;

int N,W;

int w[201];

ll dp[2][10001][202];



int main(){



	cin>>N>>W;

	for(int i=0;i<N;i++)cin>>w[i];

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

		for(int k=0;k<=N;k++){

			if(j<=W&&(k==N||w[k]+j>W))dp[N%2][j][k]=1;

			else dp[N%2][j][k]=0;

		}

	}



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

		int cur=(i+1)%2;

		int nxt=(i)%2;

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

			for(int k=0;k<=N;k++){

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

				int nmwidx=k;

				if(k==N||w[k]>w[i])nmwidx=i;

				dp[nxt][j][k]+=dp[cur][j][nmwidx];

				if(j+w[i]<=W)dp[nxt][j][k]+=dp[cur][j+w[i]][k];

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

			}

		}

	}

	cout<<dp[0][0][N]<<endl;



	return 0;

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <algorithm>

#include <cstring>



using namespace std;

typedef long long ll;



const int mod=1000000007;

int N,W;

int w[201];

ll dp[2][10001][202];



int main(){



	cin>>N>>W;

	for(int i=0;i<N;i++)cin>>w[i];

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

		for(int k=0;k<=N;k++){

			if(j<=W&&(k==N||w[k]+j>W))dp[N%2][j][k]=1;

			else dp[N%2][j][k]=0;

		}

	}



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

		int cur=(i+1)%2;

		int nxt=(i)%2;

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

			for(int k=0;k<=N;k++){

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

				int nmwidx=k;

				if(k==N||w[k]>w[i])nmwidx=i;

				dp[nxt][j][k]+=dp[cur][j][nmwidx];

				if(j+w[i]<=W)dp[nxt][j][k]+=dp[cur][j+w[i]][k];

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

			}

		}

	}

	cout<<dp[0][0][N]<<endl;



	return 0;

}

// Fastest known solution for this problem: