stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
//Author: Suifeng0214

#include <bits/stdc++.h>

#define int long long

using namespace std;

map <char ,int> mp;

signed main()

{

	ios::sync_with_stdio(0);

	cin.tie(0);

	int n, a, b;

	cin >> n >> a >> b;

	int ans = 0;

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

		int tmp = i, nums=0;

		while(tmp>0){

			nums += tmp %10;

			tmp /= 10;

		}

		if (a <= nums && nums <= b){

			ans += i;

		}

		

	} 

	cout << ans << "\n";

} 

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



int main (){

	int x,y,z;

	int hasil = 0;

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

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

		int num=i;

		int temp = 0;

		while(num > 0){

			temp += num%10;

			num /= 10;

		}

		if(temp >= y && temp <=z){

			hasil += i;

		}

	}

	printf("%d",hasil);

	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.212603694279779x):
#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; //hrs pke variabel penampung 

		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<iostream>

#include<vector>

#include <unordered_map>  

#include <algorithm>

#include <functional>

#include <map>

#include <string>

#include <sstream>

#include <cmath>

#include <float.h>

using namespace std;





int main() {

	int n, a, b, sum, dig, num, sum2 = 0;

	cin >> n >> a >> b;

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

		num = i;

		sum = 0;

		while (num) {

			dig = num % 10;

			sum = sum + dig;

			num = num / 10;

		}

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

			sum2 += i;

		}

	}

	cout << sum2 << endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.241177771848659x):
#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; //hrs pke variabel penampung 

		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>

#define LLI long long int

#define ULTRA 2134567890

#define de(x) if(x!=0 && MODE==x)

#define MODE 1

using namespace std;



int main()

{

    int i,j;

    int N,A,B;



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

    int ans = 0;

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

    {

        int num = i;

        int sum = 0;

        while(num)

        {

            sum += num % 10;

            num /= 10;

        }

        if( A<=sum && sum<=B)

            ans += i;

    }

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





    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.177048761420587x):
#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; //hrs pke variabel penampung 

		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:
//Author: Suifeng0214

#include <bits/stdc++.h>

#define int long long

using namespace std;

map <char ,int> mp;

signed main()

{

	ios::sync_with_stdio(0);

	cin.tie(0);

	int n, a, b;

	cin >> n >> a >> b;

	int ans = 0;

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

		int tmp = i, nums=0;

		while(tmp>0){

			nums += tmp %10;

			tmp /= 10;

		}

		if (a <= nums && nums <= b){

			ans += i;

		}

		

	} 

	cout << ans << "\n";

} 

// Faster C++ solution for the same problem (measured speedup: 5.314892475483952x):
#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; //hrs pke variabel penampung 

		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;

    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.212603694279779x):
#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<iostream>

#include<vector>

#include <unordered_map>  

#include <algorithm>

#include <functional>

#include <map>

#include <string>

#include <sstream>

#include <cmath>

#include <float.h>

using namespace std;





int main() {

	int n, a, b, sum, dig, num, sum2 = 0;

	cin >> n >> a >> b;

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

		num = i;

		sum = 0;

		while (num) {

			dig = num % 10;

			sum = sum + dig;

			num = num / 10;

		}

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

			sum2 += i;

		}

	}

	cout << sum2 << endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.241177771848659x):
#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>

#define LLI long long int

#define ULTRA 2134567890

#define de(x) if(x!=0 && MODE==x)

#define MODE 1

using namespace std;



int main()

{

    int i,j;

    int N,A,B;



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

    int ans = 0;

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

    {

        int num = i;

        int sum = 0;

        while(num)

        {

            sum += num % 10;

            num /= 10;

        }

        if( A<=sum && sum<=B)

            ans += i;

    }

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





    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.177048761420587x):
#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:
//Author: Suifeng0214

#include <bits/stdc++.h>

#define int long long

using namespace std;

map <char ,int> mp;

signed main()

{

	ios::sync_with_stdio(0);

	cin.tie(0);

	int n, a, b;

	cin >> n >> a >> b;

	int ans = 0;

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

		int tmp = i, nums=0;

		while(tmp>0){

			nums += tmp %10;

			tmp /= 10;

		}

		if (a <= nums && nums <= b){

			ans += i;

		}

		

	} 

	cout << ans << "\n";

} 

// Faster C++ solution for the same problem (measured speedup: 5.314892475483952x):
#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;

    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.212603694279779x):
#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 digSum = 0;

		int temp = i;

		while (temp != 0) {

			digSum = digSum + temp % 10;

			temp /= 10;

		}

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

			sum += i;

		}

	}	

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

	return 0;

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

#include<vector>

#include <unordered_map>  

#include <algorithm>

#include <functional>

#include <map>

#include <string>

#include <sstream>

#include <cmath>

#include <float.h>

using namespace std;





int main() {

	int n, a, b, sum, dig, num, sum2 = 0;

	cin >> n >> a >> b;

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

		num = i;

		sum = 0;

		while (num) {

			dig = num % 10;

			sum = sum + dig;

			num = num / 10;

		}

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

			sum2 += i;

		}

	}

	cout << sum2 << endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.241177771848659x):
#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 digSum = 0;

		int temp = i;

		while (temp != 0) {

			digSum = digSum + temp % 10;

			temp /= 10;

		}

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

			sum += i;

		}

	}	

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

	return 0;

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

#define LLI long long int

#define ULTRA 2134567890

#define de(x) if(x!=0 && MODE==x)

#define MODE 1

using namespace std;



int main()

{

    int i,j;

    int N,A,B;



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

    int ans = 0;

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

    {

        int num = i;

        int sum = 0;

        while(num)

        {

            sum += num % 10;

            num /= 10;

        }

        if( A<=sum && sum<=B)

            ans += i;

    }

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





    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.177048761420587x):
#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 digSum = 0;

		int temp = i;

		while (temp != 0) {

			digSum = digSum + temp % 10;

			temp /= 10;

		}

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

			sum += i;

		}

	}	

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

	return 0;

}
// Slower C++ solution:
//Author: Suifeng0214

#include <bits/stdc++.h>

#define int long long

using namespace std;

map <char ,int> mp;

signed main()

{

	ios::sync_with_stdio(0);

	cin.tie(0);

	int n, a, b;

	cin >> n >> a >> b;

	int ans = 0;

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

		int tmp = i, nums=0;

		while(tmp>0){

			nums += tmp %10;

			tmp /= 10;

		}

		if (a <= nums && nums <= b){

			ans += i;

		}

		

	} 

	cout << ans << "\n";

} 

// Faster C++ solution for the same problem (measured speedup: 5.314892475483952x):
#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 digSum = 0;

		int temp = i;

		while (temp != 0) {

			digSum = digSum + temp % 10;

			temp /= 10;

		}

		if(digSum >= a && digSum <= 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;

    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.212603694279779x):
#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<iostream>

#include<vector>

#include <unordered_map>  

#include <algorithm>

#include <functional>

#include <map>

#include <string>

#include <sstream>

#include <cmath>

#include <float.h>

using namespace std;





int main() {

	int n, a, b, sum, dig, num, sum2 = 0;

	cin >> n >> a >> b;

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

		num = i;

		sum = 0;

		while (num) {

			dig = num % 10;

			sum = sum + dig;

			num = num / 10;

		}

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

			sum2 += i;

		}

	}

	cout << sum2 << endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.241177771848659x):
#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>

#define LLI long long int

#define ULTRA 2134567890

#define de(x) if(x!=0 && MODE==x)

#define MODE 1

using namespace std;



int main()

{

    int i,j;

    int N,A,B;



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

    int ans = 0;

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

    {

        int num = i;

        int sum = 0;

        while(num)

        {

            sum += num % 10;

            num /= 10;

        }

        if( A<=sum && sum<=B)

            ans += i;

    }

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





    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.177048761420587x):
#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:
//Author: Suifeng0214

#include <bits/stdc++.h>

#define int long long

using namespace std;

map <char ,int> mp;

signed main()

{

	ios::sync_with_stdio(0);

	cin.tie(0);

	int n, a, b;

	cin >> n >> a >> b;

	int ans = 0;

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

		int tmp = i, nums=0;

		while(tmp>0){

			nums += tmp %10;

			tmp /= 10;

		}

		if (a <= nums && nums <= b){

			ans += i;

		}

		

	} 

	cout << ans << "\n";

} 

// Faster C++ solution for the same problem (measured speedup: 5.314892475483952x):
#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<iostream>

#include<cmath>

#include<string>

using namespace std;



int sum(int x)

{

  int b=10,s=0,i,q,ar[5],y;

  ar[0]=0;

  q=log10(x);

  if(q==log10(x))

  {

      y=log10(x)+1;

  }

  else

  {

     y=ceil(log10(x));

  }

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

  {

      ar[i]=((x%b)-ar[i-1])/(b/10);

      s=s+ar[i];

      b=b*10;

  }

  return s;

}



int main()

{

   int a,b,n,s=0,i;

   cin >> n >> a >> b;

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

   {

       if(sum(i)>=a&&sum(i)<=b)

       {

           s=s+i;

       }



   }

   cout << s;

   return 0;

}


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

int main() {

   int n,a,b;

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

   int r = 0;

   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 (a<=c && c<=b) r+=i;

   }

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

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

#define ll long long

using namespace std;



bool sumofdigit(int x, int a, int b){

    int s=0;

    while(x){



    s+=x%10;

    x/=10;

    }

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

        return true;

    }

    else{

        return false;

    }

}





int main()

{

    ll int jogfol=0;

    int n,a,b;

    cin>>n>>a>>b;



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

        if(sumofdigit(i,a,b)){

            jogfol+=i;

        }

    }

    cout<<jogfol;

    return 0;

}


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

int main() {

   int n,a,b;

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

   int r = 0;

   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 (a<=c && c<=b) r+=i;

   }

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

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

#include <algorithm>

#include <cmath>

#include <bitset>

#include <cstring>

#include <string.h>

#include <sstream>

#include <iomanip>

#include <queue>

#include <stack>

#include <deque>

#include <map>

#include <set>

#include <unordered_set>

#include <unordered_map>

#include <vector>

#include <stdio.h>

#include <stdlib.h>

using namespace std;

 

typedef unsigned long ul;

typedef unsigned long long ull;

typedef long long ll;

typedef pair<int,int> pii;

typedef pair<ll,ll> pll;

 

const ll MOD = 1e9+7;

const double PI  = 3.14159265358;

const double EPS = 1e-8;



#define INT_MX 2147483647

#define INF ((int)1e9)

#define LLINF ((ll)1e18)

#define F first

#define S second

#define mp(x,y) make_pair(x,y)

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

#define rs(n) resize(n)

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

#define reset(v) memset((v),0,sizeof(v))

#define EB emplace_back

#define pb push_back

#define pf push_front

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

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

#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);





void solve(){

    int n, a, b, ct;

    ll ans;

    string s;

    

    ans = 0;

    

    cin >> n >> a >> b;

    rep1(i, n){

        s = to_string(i);

        ct = 0;

        for(auto i:s)

            ct += i - '0';

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

            ans += i;

    }

    cout << ans << '\n';

}



int main(){

    

    solve();

}








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

int main() {

   int n,a,b;

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

   int r = 0;

   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 (a<=c && c<=b) r+=i;

   }

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

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

using namespace std;

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

int main(void)

{

	AC;

	int T,a,n,i,b,k,t,sum=0;

	cin>>n>>a>>b;

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

		k=i;

		t=0;

		while(k!=0){

			t+=k%10;

			k/=10;

		}

		if(t>=a && b>=t) sum+=i;

	}

	cout<<sum<<"\n";

}




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

int main() {

   int n,a,b;

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

   int r = 0;

   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 (a<=c && c<=b) r+=i;

   }

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

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

using namespace std;



int sums(int n){

    int re=0;

    while(n>9){

        re+=n%10;

        n/=10;

    }

    re+=n;

    return re;

}



int main(){

    int n,a,b;

    cin>>n>>a>>b;

    int sum=0;

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

        if(sums(i)>=a && sums(i)<=b){

            sum+=i;

        }

    }

    cout<<sum;

    return 0;

}

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

int main() {

   int n,a,b;

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

   int r = 0;

   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 (a<=c && c<=b) r+=i;

   }

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

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

#define R(X) cin>>X



using namespace std;

inline int digitSum(int num){

	int out=0;

	while(num!=0){

		out+=num%10;

		num/=10;

	}

	return out;

}

int main(){

	int N;R(N);

	int a,b;R(a);R(b);

	int sum=0;

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

	    if(digitSum(i)<=b&&digitSum(i)>=a)

		    sum+=i;

	cout<<sum;

	return 0;

}

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

int main() {

   int n,a,b;

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

   int r = 0;

   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 (a<=c && c<=b) r+=i;

   }

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

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

#include<cmath>

#include<string>

using namespace std;



int sum(int x)

{

  int b=10,s=0,i,q,ar[5],y;

  ar[0]=0;

  q=log10(x);

  if(q==log10(x))

  {

      y=log10(x)+1;

  }

  else

  {

     y=ceil(log10(x));

  }

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

  {

      ar[i]=((x%b)-ar[i-1])/(b/10);

      s=s+ar[i];

      b=b*10;

  }

  return s;

}



int main()

{

   int a,b,n,s=0,i;

   cin >> n >> a >> b;

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

   {

       if(sum(i)>=a&&sum(i)<=b)

       {

           s=s+i;

       }



   }

   cout << s;

   return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.249872749034858x):
#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 c = 0;

		int temp = i;

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

			c += temp % 10;

			temp /= 10;

		}

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

			sum += i;

		}

	}

 

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

 

}