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

int main()

{

    int i,j,k,l,m,n,o,a,b,sum;

    scanf("%d",&n);

    scanf("%d",&a);

    scanf("%d",&b);

    sum=0;

    for(o=0;o<=9;o++)

    {

        for(i=0;i<=9;i++)

        {

            for(j=0;j<=9;j++)

            {

                for(k=0;k<=9;k++)

                {

                    for(l=0;l<=9;l++)

                    {

                        for(m=a;m<=b&&10000*o+1000*i+100*j+10*k+l<=n;m++)

                        {

                            if(m==o+i+j+k+l)

                            {

                                sum=sum+10000*o+1000*i+100*j+10*k+l;

                                break;

                            }

                        }

                    }

                }

            }

        }

    }

    printf("%d",sum);

    return 0;

}


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

     

int main() {

    int n, a, b, sum=0;

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

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

        int c = 0, t = i;

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

          c += t % 10;

          t /= 10;

        }

		if (c >= a && c <= b) {

		sum += i;

		}

    }

      

	printf("%d",sum);

	return 0;

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

using namespace std;

#define pb push_back

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

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

#define mp make_pair

#define F first

#define S second

#define IOS ios_base::sync_with_stdio(0); cin.tie(0)

typedef long long ll;

vector<int> g[100005];

ll q,n;



int main()

{

    //IOS;

    while(cin>>n)

    {

        ll sum=0;

        ll A,B;

        cin>>A>>B;

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

        {

            ll a=i/10000,b=(i%10000)/1000,c=(i%1000)/100,d=(i%100)/10,e=i%10;

            if(a+b+c+d+e<=B&&a+b+c+d+e>=A) sum+=i;

        }

        cout<<sum<<"\n";

    }



    return 0;

}




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

     

int main() {

    int n, a, b, sum=0;

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

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

        int c = 0, t = i;

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

          c += t % 10;

          t /= 10;

        }

		if (c >= a && c <= b) {

		sum += i;

		}

    }

      

	printf("%d",sum);

	return 0;

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



using namespace std;



int main(){

    int n,a,b,ans=0,d,p=0;

    cin >> n >> a >> b;

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

        d=t,p=0;

        while(d>=1){

            p+=d%10;

            d/=10;

        }

        if(p>=a && p<=b){

            ans+=t;

        }

    }

    cout << ans << '\n';

}

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

     

int main() {

    int n, a, b, sum=0;

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

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

        int c = 0, t = i;

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

          c += t % 10;

          t /= 10;

        }

		if (c >= a && c <= b) {

		sum += i;

		}

    }

      

	printf("%d",sum);

	return 0;

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

using namespace std;

int main()



{

    int n,a,b;

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

    int i,j,x,y,s=0,hp;

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

    {

        x=0;

        y=i;

        for(j=0;;j++)

        {

            if(pow(10,j)>y)

            {

                hp=j-1;

                break;

            }

        }

        for(j=hp;j>=0;j--)

        {

            int power=pow(10,j);

            x=x+y/power;

            y=y%power;

        }







        if(x>=a&&x<=b)

        {

            s=s+i;

        }

    }

    printf("%d",s);

    return 0;

}


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



int main() {

	int a, b, c;

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

	

	int total = 0;

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

		int syarat = 0, counter = i;

		while(counter > 0) {

			syarat += counter % 10;

			counter /= 10;

		}

		if(syarat >= b && syarat <= c){

			total += i;

		}

	}

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

	

	return 0;

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

using namespace std;



int main ()



{

    int a,c,N,A,B,i,x,y,z,k,j;

    j=0;

    scanf("%d%d%d",&N,&A,&B);

    c=N;

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

        N=i;

        x=N/10000.0;

        N=N-10000*x;

        y=N/1000.0;

        N=N-1000*y;

        z=N/100.0;

        N=N-z*100;

        a=N/10.0;

        N=N-a*10;



        k=a+z+x+y+N;

        if(k>=A && k<=B){

            j=i+j;

        }





    }

    printf("%d",j);

}


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



int main() {

	int a, b, c;

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

	

	int total = 0;

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

		int syarat = 0, counter = i;

		while(counter > 0) {

			syarat += counter % 10;

			counter /= 10;

		}

		if(syarat >= b && syarat <= c){

			total += i;

		}

	}

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

	

	return 0;

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

int main()

{

    int i,j,k,l,m,n,o,a,b,sum;

    scanf("%d",&n);

    scanf("%d",&a);

    scanf("%d",&b);

    sum=0;

    for(o=0;o<=9;o++)

    {

        for(i=0;i<=9;i++)

        {

            for(j=0;j<=9;j++)

            {

                for(k=0;k<=9;k++)

                {

                    for(l=0;l<=9;l++)

                    {

                        for(m=a;m<=b&&10000*o+1000*i+100*j+10*k+l<=n;m++)

                        {

                            if(m==o+i+j+k+l)

                            {

                                sum=sum+10000*o+1000*i+100*j+10*k+l;

                                break;

                            }

                        }

                    }

                }

            }

        }

    }

    printf("%d",sum);

    return 0;

}


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



int main() {

	int a, b, c;

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

	

	int total = 0;

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

		int syarat = 0, counter = i;

		while(counter > 0) {

			syarat += counter % 10;

			counter /= 10;

		}

		if(syarat >= b && syarat <= c){

			total += i;

		}

	}

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

	

	return 0;

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

using namespace std;

#define pb push_back

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

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

#define mp make_pair

#define F first

#define S second

#define IOS ios_base::sync_with_stdio(0); cin.tie(0)

typedef long long ll;

vector<int> g[100005];

ll q,n;



int main()

{

    //IOS;

    while(cin>>n)

    {

        ll sum=0;

        ll A,B;

        cin>>A>>B;

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

        {

            ll a=i/10000,b=(i%10000)/1000,c=(i%1000)/100,d=(i%100)/10,e=i%10;

            if(a+b+c+d+e<=B&&a+b+c+d+e>=A) sum+=i;

        }

        cout<<sum<<"\n";

    }



    return 0;

}




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



int main() {

	int a, b, c;

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

	

	int total = 0;

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

		int syarat = 0, counter = i;

		while(counter > 0) {

			syarat += counter % 10;

			counter /= 10;

		}

		if(syarat >= b && syarat <= c){

			total += i;

		}

	}

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

	

	return 0;

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



using namespace std;



int main(){

    int n,a,b,ans=0,d,p=0;

    cin >> n >> a >> b;

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

        d=t,p=0;

        while(d>=1){

            p+=d%10;

            d/=10;

        }

        if(p>=a && p<=b){

            ans+=t;

        }

    }

    cout << ans << '\n';

}

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



int main() {

	int a, b, c;

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

	

	int total = 0;

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

		int syarat = 0, counter = i;

		while(counter > 0) {

			syarat += counter % 10;

			counter /= 10;

		}

		if(syarat >= b && syarat <= c){

			total += i;

		}

	}

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

	

	return 0;

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

using namespace std;

int main()



{

    int n,a,b;

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

    int i,j,x,y,s=0,hp;

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

    {

        x=0;

        y=i;

        for(j=0;;j++)

        {

            if(pow(10,j)>y)

            {

                hp=j-1;

                break;

            }

        }

        for(j=hp;j>=0;j--)

        {

            int power=pow(10,j);

            x=x+y/power;

            y=y%power;

        }







        if(x>=a&&x<=b)

        {

            s=s+i;

        }

    }

    printf("%d",s);

    return 0;

}


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



int main () {

	int n, a, b, dig1, dig2, dig3, dig4, dig5;

	int sum = 0;

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

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

		dig1 = i%10;

		dig2 = (i/10)%10;

		dig3 = (i/100)%10;

		dig4 = (i/1000)%10;

		dig5 = (i/10000)%10;

		if ((dig1+dig2+dig3+dig4+dig5) >= a && (dig1+dig2+dig3+dig4+dig5) <= b) {

			sum += i;

		}

	}

	printf("%d", sum);

	

	

	return 0;

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

using namespace std;



int main ()



{

    int a,c,N,A,B,i,x,y,z,k,j;

    j=0;

    scanf("%d%d%d",&N,&A,&B);

    c=N;

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

        N=i;

        x=N/10000.0;

        N=N-10000*x;

        y=N/1000.0;

        N=N-1000*y;

        z=N/100.0;

        N=N-z*100;

        a=N/10.0;

        N=N-a*10;



        k=a+z+x+y+N;

        if(k>=A && k<=B){

            j=i+j;

        }





    }

    printf("%d",j);

}


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



int main () {

	int n, a, b, dig1, dig2, dig3, dig4, dig5;

	int sum = 0;

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

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

		dig1 = i%10;

		dig2 = (i/10)%10;

		dig3 = (i/100)%10;

		dig4 = (i/1000)%10;

		dig5 = (i/10000)%10;

		if ((dig1+dig2+dig3+dig4+dig5) >= a && (dig1+dig2+dig3+dig4+dig5) <= b) {

			sum += i;

		}

	}

	printf("%d", sum);

	

	

	return 0;

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

int main()

{

    int i,j,k,l,m,n,o,a,b,sum;

    scanf("%d",&n);

    scanf("%d",&a);

    scanf("%d",&b);

    sum=0;

    for(o=0;o<=9;o++)

    {

        for(i=0;i<=9;i++)

        {

            for(j=0;j<=9;j++)

            {

                for(k=0;k<=9;k++)

                {

                    for(l=0;l<=9;l++)

                    {

                        for(m=a;m<=b&&10000*o+1000*i+100*j+10*k+l<=n;m++)

                        {

                            if(m==o+i+j+k+l)

                            {

                                sum=sum+10000*o+1000*i+100*j+10*k+l;

                                break;

                            }

                        }

                    }

                }

            }

        }

    }

    printf("%d",sum);

    return 0;

}


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



int main () {

	int n, a, b, dig1, dig2, dig3, dig4, dig5;

	int sum = 0;

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

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

		dig1 = i%10;

		dig2 = (i/10)%10;

		dig3 = (i/100)%10;

		dig4 = (i/1000)%10;

		dig5 = (i/10000)%10;

		if ((dig1+dig2+dig3+dig4+dig5) >= a && (dig1+dig2+dig3+dig4+dig5) <= b) {

			sum += i;

		}

	}

	printf("%d", sum);

	

	

	return 0;

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

using namespace std;

#define pb push_back

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

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

#define mp make_pair

#define F first

#define S second

#define IOS ios_base::sync_with_stdio(0); cin.tie(0)

typedef long long ll;

vector<int> g[100005];

ll q,n;



int main()

{

    //IOS;

    while(cin>>n)

    {

        ll sum=0;

        ll A,B;

        cin>>A>>B;

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

        {

            ll a=i/10000,b=(i%10000)/1000,c=(i%1000)/100,d=(i%100)/10,e=i%10;

            if(a+b+c+d+e<=B&&a+b+c+d+e>=A) sum+=i;

        }

        cout<<sum<<"\n";

    }



    return 0;

}




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



int main () {

	int n, a, b, dig1, dig2, dig3, dig4, dig5;

	int sum = 0;

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

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

		dig1 = i%10;

		dig2 = (i/10)%10;

		dig3 = (i/100)%10;

		dig4 = (i/1000)%10;

		dig5 = (i/10000)%10;

		if ((dig1+dig2+dig3+dig4+dig5) >= a && (dig1+dig2+dig3+dig4+dig5) <= b) {

			sum += i;

		}

	}

	printf("%d", sum);

	

	

	return 0;

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



using namespace std;



int main(){

    int n,a,b,ans=0,d,p=0;

    cin >> n >> a >> b;

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

        d=t,p=0;

        while(d>=1){

            p+=d%10;

            d/=10;

        }

        if(p>=a && p<=b){

            ans+=t;

        }

    }

    cout << ans << '\n';

}

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



int main () {

	int n, a, b, dig1, dig2, dig3, dig4, dig5;

	int sum = 0;

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

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

		dig1 = i%10;

		dig2 = (i/10)%10;

		dig3 = (i/100)%10;

		dig4 = (i/1000)%10;

		dig5 = (i/10000)%10;

		if ((dig1+dig2+dig3+dig4+dig5) >= a && (dig1+dig2+dig3+dig4+dig5) <= b) {

			sum += i;

		}

	}

	printf("%d", sum);

	

	

	return 0;

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

using namespace std;

int main()



{

    int n,a,b;

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

    int i,j,x,y,s=0,hp;

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

    {

        x=0;

        y=i;

        for(j=0;;j++)

        {

            if(pow(10,j)>y)

            {

                hp=j-1;

                break;

            }

        }

        for(j=hp;j>=0;j--)

        {

            int power=pow(10,j);

            x=x+y/power;

            y=y%power;

        }







        if(x>=a&&x<=b)

        {

            s=s+i;

        }

    }

    printf("%d",s);

    return 0;

}


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

int main(){

    int n, a, b;

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

    int sum = 0;

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

        int num = i;

        int temp = 0;

        while(num > 0){

            temp += num % 10;

            num /= 10;

}

        if(temp >= a && temp <= b){

        sum += i;

        }

 

    }

    printf("%d", sum);

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

using namespace std;



int main ()



{

    int a,c,N,A,B,i,x,y,z,k,j;

    j=0;

    scanf("%d%d%d",&N,&A,&B);

    c=N;

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

        N=i;

        x=N/10000.0;

        N=N-10000*x;

        y=N/1000.0;

        N=N-1000*y;

        z=N/100.0;

        N=N-z*100;

        a=N/10.0;

        N=N-a*10;



        k=a+z+x+y+N;

        if(k>=A && k<=B){

            j=i+j;

        }





    }

    printf("%d",j);

}


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

int main(){

    int n, a, b;

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

    int sum = 0;

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

        int num = i;

        int temp = 0;

        while(num > 0){

            temp += num % 10;

            num /= 10;

}

        if(temp >= a && temp <= b){

        sum += i;

        }

 

    }

    printf("%d", sum);

    return 0;}
// Slower C++ solution:
#include<stdio.h>

int main()

{

    int i,j,k,l,m,n,o,a,b,sum;

    scanf("%d",&n);

    scanf("%d",&a);

    scanf("%d",&b);

    sum=0;

    for(o=0;o<=9;o++)

    {

        for(i=0;i<=9;i++)

        {

            for(j=0;j<=9;j++)

            {

                for(k=0;k<=9;k++)

                {

                    for(l=0;l<=9;l++)

                    {

                        for(m=a;m<=b&&10000*o+1000*i+100*j+10*k+l<=n;m++)

                        {

                            if(m==o+i+j+k+l)

                            {

                                sum=sum+10000*o+1000*i+100*j+10*k+l;

                                break;

                            }

                        }

                    }

                }

            }

        }

    }

    printf("%d",sum);

    return 0;

}


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

int main(){

    int n, a, b;

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

    int sum = 0;

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

        int num = i;

        int temp = 0;

        while(num > 0){

            temp += num % 10;

            num /= 10;

}

        if(temp >= a && temp <= b){

        sum += i;

        }

 

    }

    printf("%d", sum);

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

using namespace std;

#define pb push_back

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

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

#define mp make_pair

#define F first

#define S second

#define IOS ios_base::sync_with_stdio(0); cin.tie(0)

typedef long long ll;

vector<int> g[100005];

ll q,n;



int main()

{

    //IOS;

    while(cin>>n)

    {

        ll sum=0;

        ll A,B;

        cin>>A>>B;

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

        {

            ll a=i/10000,b=(i%10000)/1000,c=(i%1000)/100,d=(i%100)/10,e=i%10;

            if(a+b+c+d+e<=B&&a+b+c+d+e>=A) sum+=i;

        }

        cout<<sum<<"\n";

    }



    return 0;

}




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

int main(){

    int n, a, b;

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

    int sum = 0;

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

        int num = i;

        int temp = 0;

        while(num > 0){

            temp += num % 10;

            num /= 10;

}

        if(temp >= a && temp <= b){

        sum += i;

        }

 

    }

    printf("%d", sum);

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



using namespace std;



int main(){

    int n,a,b,ans=0,d,p=0;

    cin >> n >> a >> b;

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

        d=t,p=0;

        while(d>=1){

            p+=d%10;

            d/=10;

        }

        if(p>=a && p<=b){

            ans+=t;

        }

    }

    cout << ans << '\n';

}

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

int main(){

    int n, a, b;

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

    int sum = 0;

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

        int num = i;

        int temp = 0;

        while(num > 0){

            temp += num % 10;

            num /= 10;

}

        if(temp >= a && temp <= b){

        sum += i;

        }

 

    }

    printf("%d", sum);

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

using namespace std;

int main()



{

    int n,a,b;

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

    int i,j,x,y,s=0,hp;

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

    {

        x=0;

        y=i;

        for(j=0;;j++)

        {

            if(pow(10,j)>y)

            {

                hp=j-1;

                break;

            }

        }

        for(j=hp;j>=0;j--)

        {

            int power=pow(10,j);

            x=x+y/power;

            y=y%power;

        }







        if(x>=a&&x<=b)

        {

            s=s+i;

        }

    }

    printf("%d",s);

    return 0;

}


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



int main() {

	int n, a, b;

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

	int sum = 0;

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

		int digitsum = 0;

		int temp = i;

		while (temp != 0){

			digitsum = digitsum + temp % 10;

			temp /= 10;

		}

		if (digitsum >= a && digitsum <= b){

			sum += i;

		}

	}

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

	return 0;

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

using namespace std;



int main ()



{

    int a,c,N,A,B,i,x,y,z,k,j;

    j=0;

    scanf("%d%d%d",&N,&A,&B);

    c=N;

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

        N=i;

        x=N/10000.0;

        N=N-10000*x;

        y=N/1000.0;

        N=N-1000*y;

        z=N/100.0;

        N=N-z*100;

        a=N/10.0;

        N=N-a*10;



        k=a+z+x+y+N;

        if(k>=A && k<=B){

            j=i+j;

        }





    }

    printf("%d",j);

}


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



int main() {

	int n, a, b;

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

	int sum = 0;

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

		int digitsum = 0;

		int temp = i;

		while (temp != 0){

			digitsum = digitsum + temp % 10;

			temp /= 10;

		}

		if (digitsum >= a && digitsum <= b){

			sum += i;

		}

	}

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

	return 0;

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

int main()

{

    int i,j,k,l,m,n,o,a,b,sum;

    scanf("%d",&n);

    scanf("%d",&a);

    scanf("%d",&b);

    sum=0;

    for(o=0;o<=9;o++)

    {

        for(i=0;i<=9;i++)

        {

            for(j=0;j<=9;j++)

            {

                for(k=0;k<=9;k++)

                {

                    for(l=0;l<=9;l++)

                    {

                        for(m=a;m<=b&&10000*o+1000*i+100*j+10*k+l<=n;m++)

                        {

                            if(m==o+i+j+k+l)

                            {

                                sum=sum+10000*o+1000*i+100*j+10*k+l;

                                break;

                            }

                        }

                    }

                }

            }

        }

    }

    printf("%d",sum);

    return 0;

}


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



int main() {

	int n, a, b;

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

	int sum = 0;

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

		int digitsum = 0;

		int temp = i;

		while (temp != 0){

			digitsum = digitsum + temp % 10;

			temp /= 10;

		}

		if (digitsum >= a && digitsum <= b){

			sum += i;

		}

	}

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

	return 0;

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

using namespace std;

#define pb push_back

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

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

#define mp make_pair

#define F first

#define S second

#define IOS ios_base::sync_with_stdio(0); cin.tie(0)

typedef long long ll;

vector<int> g[100005];

ll q,n;



int main()

{

    //IOS;

    while(cin>>n)

    {

        ll sum=0;

        ll A,B;

        cin>>A>>B;

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

        {

            ll a=i/10000,b=(i%10000)/1000,c=(i%1000)/100,d=(i%100)/10,e=i%10;

            if(a+b+c+d+e<=B&&a+b+c+d+e>=A) sum+=i;

        }

        cout<<sum<<"\n";

    }



    return 0;

}




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



int main() {

	int n, a, b;

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

	int sum = 0;

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

		int digitsum = 0;

		int temp = i;

		while (temp != 0){

			digitsum = digitsum + temp % 10;

			temp /= 10;

		}

		if (digitsum >= a && digitsum <= b){

			sum += i;

		}

	}

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

	return 0;

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



using namespace std;



int main(){

    int n,a,b,ans=0,d,p=0;

    cin >> n >> a >> b;

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

        d=t,p=0;

        while(d>=1){

            p+=d%10;

            d/=10;

        }

        if(p>=a && p<=b){

            ans+=t;

        }

    }

    cout << ans << '\n';

}

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



int main() {

	int n, a, b;

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

	int sum = 0;

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

		int digitsum = 0;

		int temp = i;

		while (temp != 0){

			digitsum = digitsum + temp % 10;

			temp /= 10;

		}

		if (digitsum >= a && digitsum <= b){

			sum += i;

		}

	}

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

	return 0;

}