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

#define mp make_pair

#define X first

#define Y second

#define pii pair<ll,ll>

#define x1 dlfjl

#define x2 dkfj

#define x3 dflgkg

#define y1 dskgj

#define y2 dskfj

#define y3 dfhgdh

#define SQ 320

#define PI 3.14159265359

#define MOD 1000000007

typedef int ll;

using namespace std;

int  n,i,j,k,z,m,q,r,timer,v,tot,x,y,xx, yy,INF, sz;

int a[100500], cnt[100500];

int main() {

    //freopen("input.txt","r",stdin);

    cin >> n >> k;

    int lst = 0;

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

    {

    	cin >> x;

    	if (i == 0)

		{

			lst = x;

			continue;

		}

    	if (lst + x >= k) {

            cout << "Possible" << endl;

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

                cout << j << endl;

            for (int j = n-1; j > i; j--)

                cout << j << endl;

            cout << i << endl;

            return 0;

        }

        lst = x;

	}

        

    cout << "Impossible" << endl;

    return 0;

}

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

#include<cstring>

using namespace std;

#define MAXN 100000

long long n,l;

long long fl=0;

long long a[MAXN+5];

long long read()

{

	long long x=0,f=1;

	char c=getchar();

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

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

	return x*f;

}

int main()

{

	n=read(),l=read();

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

	a[i]=read();

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

	{

		if(a[i]+a[i+1]>=l)

		{

			fl=i;

			break;

		}

	}

	if(!fl)

	{

		printf("Impossible\n");

	}

	else 

	{

		printf("Possible\n");

		for(int i=1;i<=fl-1;i++)

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

		for(int i=n-1;i>=fl;i--)

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

	}

}

//
// Slower C++ solution:
//By Don4ick 

//#define _GLIBCXX_DEBUG



#include <bits/stdc++.h>



typedef long long ll;

typedef long double ld;

typedef unsigned int ui;



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

#define pb push_back

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

#define y1 qewr1234



const double PI = acos(-1.0);

const int DIR = 4;

const int X[] = {1, 0, -1, 0};

const int Y[] = {0, 1, 0, -1};



const int N = (int)1e5 + 228;



using namespace std;



int n, k, a[N];

ll pref[N];



int main()

{

	//ios_base::sync_with_stdio(false);

	//cin.tie();

	//cout.tie();		



	//freopen(".in", "r", stdin);

	//freopen(".out", "w", stdout);



	//~read

	scanf("%d%d", &n, &k);

	forn(i, n)

		scanf("%d", &a[i]);

	//~solve

	forn(i, n - 1)

	{

		if (a[i] + a[i + 1] >= k)

		{

			cout << "Possible" << endl;

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

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

			for (int j = n - 1; j >= i + 1; j--)

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

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

			return 0;

		}

	}

	cout << "Impossible" << endl;

	return 0;

}




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

#include<cstring>

using namespace std;

#define MAXN 100000

long long n,l;

long long fl=0;

long long a[MAXN+5];

long long read()

{

	long long x=0,f=1;

	char c=getchar();

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

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

	return x*f;

}

int main()

{

	n=read(),l=read();

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

	a[i]=read();

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

	{

		if(a[i]+a[i+1]>=l)

		{

			fl=i;

			break;

		}

	}

	if(!fl)

	{

		printf("Impossible\n");

	}

	else 

	{

		printf("Possible\n");

		for(int i=1;i<=fl-1;i++)

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

		for(int i=n-1;i>=fl;i--)

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

	}

}

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

#include <cstdio>



using namespace std;



const int Maxn = 100010;



int n , l;

int a[Maxn];



int main() {

	

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

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

		scanf("%d",&a[i]);

	

	register int tmp = -1;

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

		if(a[i] + a[i+1] >= l) {

			tmp = i;

			break;

		}

	}

	

	if(tmp == -1) {

		puts("Impossible");

		return 0;

	}

	

	puts("Possible");

	

	for(register int i=1; i<=tmp-1; i++)

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

	for(register int i=n-1; i>=tmp+1; i--)

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

	

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

	

	return 0;

	

}

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



const int Maxn = 100010;



int n , l;

int a[Maxn];



int main() {

	

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

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

		scanf("%d",&a[i]);

	

	register int tmp = -1;

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

		if(a[i] + a[i+1] >= l) {

			tmp = i;

			break;

		}

	}

	

	if(tmp == -1)	return !puts("Impossible");

	

	puts("Possible");

	

	for(register int i=1; i<=tmp-1; i++)

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

	for(register int i=n-1; i>=tmp+1; i--)

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

	

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

	

	return 0;

	

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

using namespace std;

int sum(int n)

{

    int x=0;

    while(n)

    {

        x+=n%10;n/=10;

    }

    return x;

}

int main()

{

    int n,a,b,x; long long int cnt=0;

    cin >> n >> a >> b;

    n++;

    while(n--)

    {

        x= sum(n);

        if(x>=a&&x<=b)cnt+=n;

    }

    cout << cnt << endl;

    return 0;

}


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



int main () {

	int N, A, B;

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

	int ans = 0;

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

		int temp = i;

		int jumlah = 0;

		

		while (temp > 0) {

			jumlah += temp % 10;

			temp /= 10;

		}

		

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

			ans += i;

		}

	}

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

	return 0;

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

//#include<tr1/unordered_map>

#include<iostream>

#include<string>

#pragma GCC optimize ("Ofast")

#define ll long long

#define pll pair<long long,long long>

#define pii pair<int,int>

#define mp make_pair

#define pb push_back

#define F first

#define S second

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

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



using namespace std;



/*#include <ext/pb_ds/tree_policy.hpp>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> rbtree;*/



int sum_of_digits(int x)

{

    int ret = 0;

    while(x)

    {

        ret += x%10;

        x/=10;

    }

    return ret;

}



int main()

{

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

    int n, a, b;

    cin >> n >> a >> b;

    int ans = 0;

    Forn(i, n)

    {

        int temp = sum_of_digits(i);

        if(a<=temp && temp<=b) ans += i;

    }

    cout << ans << endl;

}


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



int main () {

	int N, A, B;

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

	int ans = 0;

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

		int temp = i;

		int jumlah = 0;

		

		while (temp > 0) {

			jumlah += temp % 10;

			temp /= 10;

		}

		

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

			ans += i;

		}

	}

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

	return 0;

}
// Slower C++ solution:
/*

--------------              |   /

      |                     |  /

      |                     | /

      |             *       |/          |    |         ------            *

      |                     |           |    |        /      \

      |             |       |\          |    |       |       |\          |

   \  |             |       | \         |    |       |       | \         |

    \ |             |       |  \        |    |        \     /   \        |

     V              |       |   \        \__/|         -----     \       |

*/

#include <bits/stdc++.h>

using namespace std;



#define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(NULL);

#define endl '\n'

#define mem(i,j) memset(i,j,sizeof i);

#define F first

#define S second

#define pb push_back

#define mp make_pair

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

#define bit(s,i) (((s)>>(i))&1LL)

#define lowbit(x) (x&-x)

#define siz(v) (long long)v.size()

typedef long long ll;

typedef unsigned long long ull;

typedef pair<int,int> pii;

typedef pair<ll, ll> pll;

const double EPS  = 1e-8;

const int INF     = 0x3F3F3F3F;

const ll LINF     = 4611686018427387903;

const int MOD     = 1e9+7;

const int MAXN    = 2e5+9;

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



string toInt(int a) {

    string s, c;

    while(a>0) {

        s.pb(a%10+'0');

        a/=10;

    }

    for(int i = s.size()-1; i>=0; i--) c.pb(s[i]);

    return c;

}



int main() {

    EmiliaMyWife



    int n, a, b;

    cin >> n >> a >> b;

    if(a>b) swap(a, b);

    ll ans =0;

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

        string s = toInt(i);

        //cout << s << endl;

        int cur=0;

        for(auto x: s) {

            cur+=(x-'0');

        }

        if(a<=cur && cur<=b) ans+=i;

    }

    cout << ans;



	return 0;

}


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



int main () {

	int N, A, B;

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

	int ans = 0;

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

		int temp = i;

		int jumlah = 0;

		

		while (temp > 0) {

			jumlah += temp % 10;

			temp /= 10;

		}

		

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

			ans += i;

		}

	}

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

	return 0;

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

using namespace std;

int change(int a){

    int re = 0;

    while(a>0){

        re += a%10;

        a/=10;

    }

    return re;

}

int main(){

    int n,a,b;

    cin >> n>> a >> b;

    long long int ans = 0;

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

        int re = change(i);

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

            ans += i;

//            cout << i <<endl;

        }

    }

    cout << ans <<endl;

    return 0;

}


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



int main () {

	int N, A, B;

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

	int ans = 0;

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

		int temp = i;

		int jumlah = 0;

		

		while (temp > 0) {

			jumlah += temp % 10;

			temp /= 10;

		}

		

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

			ans += i;

		}

	}

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

	return 0;

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

using namespace std;

int sum(int n)

{

    int x=0;

    while(n)

    {

        x+=n%10;n/=10;

    }

    return x;

}

int main()

{

    int n,a,b,x; long long int cnt=0;

    cin >> n >> a >> b;

    n++;

    while(n--)

    {

        x= sum(n);

        if(x>=a&&x<=b)cnt+=n;

    }

    cout << cnt << endl;

    return 0;

}


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



int main(){

    int n, a, b, ii, temp=0;

    long long int sum=0;

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

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

        ii=i;

        temp=0;

        while(ii>0){

            temp+=ii%10;

            ii/=10;

        }

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

            sum+=i;

        }

    }

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

    return 0;

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

//#include<tr1/unordered_map>

#include<iostream>

#include<string>

#pragma GCC optimize ("Ofast")

#define ll long long

#define pll pair<long long,long long>

#define pii pair<int,int>

#define mp make_pair

#define pb push_back

#define F first

#define S second

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

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



using namespace std;



/*#include <ext/pb_ds/tree_policy.hpp>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> rbtree;*/



int sum_of_digits(int x)

{

    int ret = 0;

    while(x)

    {

        ret += x%10;

        x/=10;

    }

    return ret;

}



int main()

{

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

    int n, a, b;

    cin >> n >> a >> b;

    int ans = 0;

    Forn(i, n)

    {

        int temp = sum_of_digits(i);

        if(a<=temp && temp<=b) ans += i;

    }

    cout << ans << endl;

}


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



int main(){

    int n, a, b, ii, temp=0;

    long long int sum=0;

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

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

        ii=i;

        temp=0;

        while(ii>0){

            temp+=ii%10;

            ii/=10;

        }

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

            sum+=i;

        }

    }

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

    return 0;

}
// Slower C++ solution:
/*

--------------              |   /

      |                     |  /

      |                     | /

      |             *       |/          |    |         ------            *

      |                     |           |    |        /      \

      |             |       |\          |    |       |       |\          |

   \  |             |       | \         |    |       |       | \         |

    \ |             |       |  \        |    |        \     /   \        |

     V              |       |   \        \__/|         -----     \       |

*/

#include <bits/stdc++.h>

using namespace std;



#define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(NULL);

#define endl '\n'

#define mem(i,j) memset(i,j,sizeof i);

#define F first

#define S second

#define pb push_back

#define mp make_pair

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

#define bit(s,i) (((s)>>(i))&1LL)

#define lowbit(x) (x&-x)

#define siz(v) (long long)v.size()

typedef long long ll;

typedef unsigned long long ull;

typedef pair<int,int> pii;

typedef pair<ll, ll> pll;

const double EPS  = 1e-8;

const int INF     = 0x3F3F3F3F;

const ll LINF     = 4611686018427387903;

const int MOD     = 1e9+7;

const int MAXN    = 2e5+9;

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



string toInt(int a) {

    string s, c;

    while(a>0) {

        s.pb(a%10+'0');

        a/=10;

    }

    for(int i = s.size()-1; i>=0; i--) c.pb(s[i]);

    return c;

}



int main() {

    EmiliaMyWife



    int n, a, b;

    cin >> n >> a >> b;

    if(a>b) swap(a, b);

    ll ans =0;

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

        string s = toInt(i);

        //cout << s << endl;

        int cur=0;

        for(auto x: s) {

            cur+=(x-'0');

        }

        if(a<=cur && cur<=b) ans+=i;

    }

    cout << ans;



	return 0;

}


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



int main(){

    int n, a, b, ii, temp=0;

    long long int sum=0;

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

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

        ii=i;

        temp=0;

        while(ii>0){

            temp+=ii%10;

            ii/=10;

        }

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

            sum+=i;

        }

    }

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

    return 0;

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

using namespace std;

int change(int a){

    int re = 0;

    while(a>0){

        re += a%10;

        a/=10;

    }

    return re;

}

int main(){

    int n,a,b;

    cin >> n>> a >> b;

    long long int ans = 0;

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

        int re = change(i);

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

            ans += i;

//            cout << i <<endl;

        }

    }

    cout << ans <<endl;

    return 0;

}


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



int main(){

    int n, a, b, ii, temp=0;

    long long int sum=0;

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

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

        ii=i;

        temp=0;

        while(ii>0){

            temp+=ii%10;

            ii/=10;

        }

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

            sum+=i;

        }

    }

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

    return 0;

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

using namespace std;

int sum(int n)

{

    int x=0;

    while(n)

    {

        x+=n%10;n/=10;

    }

    return x;

}

int main()

{

    int n,a,b,x; long long int cnt=0;

    cin >> n >> a >> b;

    n++;

    while(n--)

    {

        x= sum(n);

        if(x>=a&&x<=b)cnt+=n;

    }

    cout << cnt << endl;

    return 0;

}


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

int main(){

int a,b,c;

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

int ans=0;

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

	int temp = i;

	int total = 0;

	while (temp>0){

		total += temp %10;

		temp /=10;

	}

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

		ans +=i;

	}

}



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

return 0;

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

//#include<tr1/unordered_map>

#include<iostream>

#include<string>

#pragma GCC optimize ("Ofast")

#define ll long long

#define pll pair<long long,long long>

#define pii pair<int,int>

#define mp make_pair

#define pb push_back

#define F first

#define S second

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

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



using namespace std;



/*#include <ext/pb_ds/tree_policy.hpp>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> rbtree;*/



int sum_of_digits(int x)

{

    int ret = 0;

    while(x)

    {

        ret += x%10;

        x/=10;

    }

    return ret;

}



int main()

{

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

    int n, a, b;

    cin >> n >> a >> b;

    int ans = 0;

    Forn(i, n)

    {

        int temp = sum_of_digits(i);

        if(a<=temp && temp<=b) ans += i;

    }

    cout << ans << endl;

}


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

int main(){

int a,b,c;

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

int ans=0;

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

	int temp = i;

	int total = 0;

	while (temp>0){

		total += temp %10;

		temp /=10;

	}

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

		ans +=i;

	}

}



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

return 0;

}
// Slower C++ solution:
/*

--------------              |   /

      |                     |  /

      |                     | /

      |             *       |/          |    |         ------            *

      |                     |           |    |        /      \

      |             |       |\          |    |       |       |\          |

   \  |             |       | \         |    |       |       | \         |

    \ |             |       |  \        |    |        \     /   \        |

     V              |       |   \        \__/|         -----     \       |

*/

#include <bits/stdc++.h>

using namespace std;



#define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(NULL);

#define endl '\n'

#define mem(i,j) memset(i,j,sizeof i);

#define F first

#define S second

#define pb push_back

#define mp make_pair

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

#define bit(s,i) (((s)>>(i))&1LL)

#define lowbit(x) (x&-x)

#define siz(v) (long long)v.size()

typedef long long ll;

typedef unsigned long long ull;

typedef pair<int,int> pii;

typedef pair<ll, ll> pll;

const double EPS  = 1e-8;

const int INF     = 0x3F3F3F3F;

const ll LINF     = 4611686018427387903;

const int MOD     = 1e9+7;

const int MAXN    = 2e5+9;

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



string toInt(int a) {

    string s, c;

    while(a>0) {

        s.pb(a%10+'0');

        a/=10;

    }

    for(int i = s.size()-1; i>=0; i--) c.pb(s[i]);

    return c;

}



int main() {

    EmiliaMyWife



    int n, a, b;

    cin >> n >> a >> b;

    if(a>b) swap(a, b);

    ll ans =0;

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

        string s = toInt(i);

        //cout << s << endl;

        int cur=0;

        for(auto x: s) {

            cur+=(x-'0');

        }

        if(a<=cur && cur<=b) ans+=i;

    }

    cout << ans;



	return 0;

}


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

int main(){

int a,b,c;

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

int ans=0;

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

	int temp = i;

	int total = 0;

	while (temp>0){

		total += temp %10;

		temp /=10;

	}

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

		ans +=i;

	}

}



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

return 0;

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

using namespace std;

int change(int a){

    int re = 0;

    while(a>0){

        re += a%10;

        a/=10;

    }

    return re;

}

int main(){

    int n,a,b;

    cin >> n>> a >> b;

    long long int ans = 0;

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

        int re = change(i);

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

            ans += i;

//            cout << i <<endl;

        }

    }

    cout << ans <<endl;

    return 0;

}


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

int main(){

int a,b,c;

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

int ans=0;

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

	int temp = i;

	int total = 0;

	while (temp>0){

		total += temp %10;

		temp /=10;

	}

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

		ans +=i;

	}

}



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

return 0;

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

using namespace std;

int sum(int n)

{

    int x=0;

    while(n)

    {

        x+=n%10;n/=10;

    }

    return x;

}

int main()

{

    int n,a,b,x; long long int cnt=0;

    cin >> n >> a >> b;

    n++;

    while(n--)

    {

        x= sum(n);

        if(x>=a&&x<=b)cnt+=n;

    }

    cout << cnt << endl;

    return 0;

}


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

 

int main(){

    

    int N,A,B;

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

    

    int count = 0;

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

        int num = i;

        int sum = 0;

        while(num != 0){

            sum += num % 10;

            num /= 10;

        }

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

            count+= i;

        }

    }

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

    

    return 0;

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

//#include<tr1/unordered_map>

#include<iostream>

#include<string>

#pragma GCC optimize ("Ofast")

#define ll long long

#define pll pair<long long,long long>

#define pii pair<int,int>

#define mp make_pair

#define pb push_back

#define F first

#define S second

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

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



using namespace std;



/*#include <ext/pb_ds/tree_policy.hpp>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> rbtree;*/



int sum_of_digits(int x)

{

    int ret = 0;

    while(x)

    {

        ret += x%10;

        x/=10;

    }

    return ret;

}



int main()

{

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

    int n, a, b;

    cin >> n >> a >> b;

    int ans = 0;

    Forn(i, n)

    {

        int temp = sum_of_digits(i);

        if(a<=temp && temp<=b) ans += i;

    }

    cout << ans << endl;

}


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

 

int main(){

    

    int N,A,B;

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

    

    int count = 0;

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

        int num = i;

        int sum = 0;

        while(num != 0){

            sum += num % 10;

            num /= 10;

        }

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

            count+= i;

        }

    }

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

    

    return 0;

}