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



using namespace std;



const int MAXN=555;

int n;

char str[MAXN][22];

int vis[255][255];

int in[255];

queue<int> q;



bool topsort()

{

    while(!q.empty())   q.pop();

    for(int i=0;i<255;i++)  if(in[i]==0)   q.push(i);

    int num=0;

    while(!q.empty())

    {

        int u=q.front();q.pop();num++;

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

            if(vis[u][i]==1)

            {

                in[i]--;

                if(in[i]==0)   q.push(i);

            }

    }

    return num==255;

}



bool check()

{

    memset(vis,0,sizeof vis);memset(in,0,sizeof in);

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

    {

        for(int j=0;str[i][j] || str[i-1][j];j++)

        {

            if(str[i][j]==str[i-1][j])  continue;

            if(!str[i][j])    return false;

            int x=(int)(str[i-1][j]);

            int y=(int)(str[i][j]);

            if(vis[y][x])   return false;

            if(!vis[x][y])

            {

                vis[x][y]=1;

                in[y]++;

            }

            break;

        }

    }

    return topsort();

}





int main()

{

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

    while(cin>>n && n)

    {

        memset(str,0,sizeof str);

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

            scanf("%s",str[i]);

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

//        {

//            int len=strlen(str[i]);

//            for(int j=0;j<len;j++)

//                if(str[i][j]>= 'a' && str[i][j]<='z')

//                    continue;

//                else

//                    while(1){}

//        }

        if(check())

            puts("yes");

        else

            puts("no");

    }

    return 0;

}

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

using namespace std;

set<int> G[26];

typedef set<int>::iterator it;

int n;

string s[505];

bool flag;

bool vis[26];

int in[26];

int main()

{

	while(~scanf("%d",&n)&&n)

	{

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

			cin>>s[i];

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

			G[i].clear(),vis[i] = 0,in[i] = 0;

		flag = true;

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

			for(int y=0;y<x;y++)

		    {

			    int len1 = s[y].size();

			    int len2 = s[x].size();

			    bool flag1 = true;

			    for(int i=0;i<min(len1,len2);i++)

				    if(s[y][i]!=s[x][i])

			        {

			    	    flag1 = false;

			    	    G[s[y][i]-'a'].insert(s[x][i]-'a');

			    	    break;

			        }

			    if(flag1&&len1>len2)

				    flag = false;

		    }

		int cnt = 0;

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

			for(it p = G[i].begin();p!=G[i].end();p++)

			    in[*p]++,cnt++;

		while(1)

		{

			bool flag1 = true;

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

				if(in[i]==0&&!vis[i])

				{

					flag1 = false;

					vis[i] = 1;

				    for(it p = G[i].begin();p != G[i].end();p++)

			        {

			        	int v = *p;

			        	cnt--;

			        	in[v]--;

			        }

				}

			if(flag1) break;

		}

		if(cnt!=0) flag = false;

		puts(flag?"yes":"no");

	}

	return 0;

}

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

#include<algorithm>

#include<vector>



using namespace std;



const int MAX=1<<17;



vector<int> G[MAX];

int root;

int V;



int vs[MAX*2-1];

int depth[MAX*2-1];

int id[MAX];



int n;

int dat[MAX*4-1];//0-indexed



void rmq_init(int V)

{

	n=1;

	while(n<V)n<<=1;

	for(int i=0;i<2*n-1;i++)dat[i]=-1;

	return;

}



void update(int k,int a)

{

	k+=n-1;

	dat[k]=a;

	while(k>0)

	{

		k=(k-1)/2;

		int b1=dat[k*2+1],b2=dat[k*2+2];

		if(b1!=-1&&b2!=-1)dat[k]=(depth[b1]<=depth[b2]?b1:b2);

		else if(b2!=-1)dat[k]=b2;

		else dat[k]=b1;

	}

	return;

}



int getmin(int a,int b,int k,int l,int r)//[a,b),vertex-number(0),k's range[l,r)

{

	if(r<=a||b<=l)return -1;

	

	if(a<=l&&r<=b)return dat[k];

	else

	{

		int vl=getmin(a,b,k*2+1,l,(l+r)/2);

		int vr=getmin(a,b,k*2+2,(l+r)/2,r);

		if(vl!=-1&&vr!=-1)return (depth[vl]<=depth[vr]?vl:vr);

		else if(vr!=-1)return vr;

		else return vl;

	}

}



void dfs(int v,int p,int d,int &k)

{

	id[v]=k;

	vs[k]=v;

	depth[k]=d;

	k++;

	for(int i=0;i<G[v].size();i++)

	{

		if(G[v][i]!=p)

		{

			dfs(G[v][i],v,d+1,k);

			vs[k]=v;

			depth[k]=d;

			k++;

		}

	}

	return;

}



void init()

{

	int k=0;

	root=0;

	dfs(root,-1,0,k);

	rmq_init(V*2-1);

	for(int i=0;i<V*2-1;i++)update(i,i);

	return;

}



int lca(int u,int v)

{

	if(id[u]>id[v])swap(u,v);

	return vs[getmin(id[u],id[v]+1,0,0,n)];

}



int main()

{

	cin>>V;

	int k,c;

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

	{

		cin>>k;

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

		{

			cin>>c;

			G[i].push_back(c);

			G[c].push_back(i);

		}

	}

	init();

	int q;

	cin>>q;

	int u,v;

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

	{

		cin>>u>>v;

		cout<<lca(u,v)<<endl;

	}

	return 0;

}

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

#include<algorithm>

#include<vector>

using namespace std;

const int MAX=100000;

const int logMAX=17;//2^17>=100000(=MAX)



int V;

vector<int> G[MAX];

int root;

int parent[logMAX][MAX];

int depth[MAX];



void dfs(int v,int p,int d)

{

	parent[0][v]=p;

	depth[v]=d;

	for(int i=0;i<G[v].size();i++)

	{

		if(G[v][i]!=p)dfs(G[v][i],v,d+1);

	}

	return;

}



void init()

{

	dfs(root,-1,0);

	for(int k=0;k+1<logMAX;k++)

	{

		for(int v=0;v<V;v++)

		{

			if(parent[k][v]<0)parent[k+1][v]=-1;

			else parent[k+1][v]=parent[k][parent[k][v]];

		}

	}

	return;

}



int lca(int u,int v)

{

	if(depth[u]>depth[v])swap(u,v);

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

	{

		if((depth[v]-depth[u])>>k&1)

		{

			v=parent[k][v];

		}

	}

	if(u==v)return u;

	for(int k=logMAX-1;k>=0;k--)

	{

		if(parent[k][u]!=parent[k][v])

		{

			u=parent[k][u];

			v=parent[k][v];

		}

	}

	return parent[0][u];

}



int main()

{

	cin>>V;

	root=0;

	int k,c;

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

	{

		cin>>k;

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

		{

			cin>>c;

			G[i].push_back(c);

			G[c].push_back(i);

		}

	}

	init();

	int q;

	cin>>q;

	int u,v;

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

	{

		cin>>u>>v;

		cout<<lca(u,v)<<endl;

	}

	return 0;

}

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

using namespace std;

typedef long long ll;

const int N = 1<<17;// = 131072

const ll INF = (1e9)+10;



/*dat???????????????N?????????*/



class RMQ{

public:

  ll n,dat[2*N-1];



  //?????????

  RMQ(){

    n=N;

    for(int i=0;i<2*n-1;i++) dat[i]=INF;

  }

  

  //k???????????????a????????´

  void update(int k,ll a){

    k+=n-1;

    dat[k]=a;

    while(k>0){

      k=(k-1)/2;

      dat[k]=min(dat[k*2+1],dat[k*2+2]);

    }

  }

  

  //[a,b)???????°????????±??????? query(a,b,0,0,n)

  ll query(int a,int b,int k=0,int l=0,int r=N){

    if(r<=a||b<=l)return INF;

    if(a<=l&&r<=b)return dat[k];



    ll vl=query(a,b,k*2+1,l,(l+r)/2);

    ll vr=query(a,b,k*2+2,(l+r)/2,r);

    return min(vl,vr);

  }

};





ll n,A[N];

vector<int>Idx;

ll L[N],R[N];





void calc(ll arr[]){

  RMQ rmq;

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

    int idx = lower_bound(Idx.begin(),Idx.end(),A[i]) - Idx.begin();

    ll val = -rmq.query(0,idx); //A[i]???????°???????????????§?????§???index?????????

    if(val == -INF) val = -1;



    arr[i] = i - val - 1;

    rmq.update(idx,-i);

  }

}



int main(){

  cin>>n;

  Idx.resize(n);

  for(int i=0;i<n;i++)cin>>A[i],Idx[i] = A[i];

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

  Idx.erase(unique(Idx.begin(),Idx.end()),Idx.end());

  

  calc(L);

  reverse(A,A+n);

  calc(R);

  reverse(A,A+n);



  ll ans=0;

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

    ll w = L[i]+R[n-1-i]+1;

    ans = max(ans,w*A[i]);

  }

  cout<<ans<<endl;

  return 0;

}

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

#define int long long

#define N 200000

using namespace std;

int n;

struct dat{int h,i;};



int calc(int A[]){

  stack <dat> S;

  int res = 0;

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

    int h = A[i];

    if(S.empty() || S.top().h < h) S.push((dat){h,i});

    else if(S.top().h > h){

      int ni = i;

      while(!S.empty() && S.top().h > h){

        dat t = S.top(); S.pop();

        ni = t.i;

        int area = (i - t.i) * t.h;

        res = max(res,area);

      }

      res = max(res,(i-ni)*h);

      S.push((dat){h,ni});

    }

  }

  return res;

}



int A[N];

signed main(){

  cin>>n;

  for(int i=0;i<n;i++)cin>>A[i];

  cout<<calc(A)<<endl;

  return 0;

}

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

#define int long long

#define N 100010

using namespace std;

typedef pair<int,int> P;

int n,A[N];





signed main(){

  

  P Idx[N];

  cin>>n;

  for(int i=0;i<n;i++)cin>>A[i],Idx[i] = P(A[i],i);

  sort(Idx,Idx+n);

  Idx[n] = P(-1,-1);  



  set<int> S;

  S.insert(-1);

  S.insert(n);



  int ans = 0;

  vector<int> ls;

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

    int h = Idx[i].first;

    int idx = Idx[i].second;

    int l =idx-(*(--S.upper_bound(idx)))-1;

    int r =(*S.upper_bound(idx)) -idx-1;

    ans=max(ans,(r+l+1)*h);

    ls.push_back(idx);

    if(Idx[i+1].first!=h){

      for(int j:ls)S.insert(j);

      ls.clear();

    }

  }

  cout<<ans<<endl;

  return 0;

}

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

#define int long long

#define N 200000

using namespace std;

int n;

struct dat{int h,i;};



int calc(int A[]){

  stack <dat> S;

  int res = 0;

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

    int h = A[i];

    if(S.empty() || S.top().h < h) S.push((dat){h,i});

    else if(S.top().h > h){

      int ni = i;

      while(!S.empty() && S.top().h > h){

        dat t = S.top(); S.pop();

        ni = t.i;

        int area = (i - t.i) * t.h;

        res = max(res,area);

      }

      res = max(res,(i-ni)*h);

      S.push((dat){h,ni});

    }

  }

  return res;

}



int A[N];

signed main(){

  cin>>n;

  for(int i=0;i<n;i++)cin>>A[i];

  cout<<calc(A)<<endl;

  return 0;

}

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

#define FLASH ios_base::sync_with_stdio(0);

#define ll long long

#define debt(x,y)cout<<"#x = "<<(x)<<" and "<<"#y = "<<(y)<<endl;

#define deb(x)cout<<"#x = "<<(x)<<endl;

#define pb push_back

#define mp make_pair

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

#define endl "\n"

#define arr(a,n) for(ll i=1;i<=n;i++) cout<<a[i]<<" "; cout << "\n";

#define vecc(a,n) for(ll i=0;i<n;i++) cout<<a[i]<<" "; cout << "\n";





using namespace std;



ll n,r;



int main(){

FLASH;

cin>>n>>r;

if(n<10)cout<<r+(100*(10-n))<<endl;

else cout<<r<<endl;













return 0;

} 


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



int main()

{

	int c, dr; 

	scanf("%d %d", &c, &dr);

	

	if(c >=10)

{

	printf("%d" , dr);

}

    else

{

	printf("%d", dr+100*(10-c));

}

    return 0;

}








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

using namespace std;



int a,b;

int main() {

cin>>a>>b;

if(a<10){

	cout<<b+(100*(10-a));

}else{

	cout<<b;

}

}

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



int main()

{

	int c, dr; 

	scanf("%d %d", &c, &dr);

	

	if(c >=10)

{

	printf("%d" , dr);

}

    else

{

	printf("%d", dr+100*(10-c));

}

    return 0;

}








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

using namespace std;

int main ()

{

    int N,R,S,A;

    cin>>N>>R;

    if(N<10)

    {

    S=100*(10-N);

    A=R+S;

    cout<<A<<endl;

    }

    else

        cout<<R<<endl;

    return 0;



}

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



int main()

{

	int c, dr; 

	scanf("%d %d", &c, &dr);

	

	if(c >=10)

{

	printf("%d" , dr);

}

    else

{

	printf("%d", dr+100*(10-c));

}

    return 0;

}








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

using namespace std;

//zakha



int N,R;



int main () {

    cin >> N >> R;

    if (N >= 10) {

        cout << R << endl;

    } else {

        cout << R + 100*(10-N) << endl;

    

    }

}




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



int main()

{

	int c, dr; 

	scanf("%d %d", &c, &dr);

	

	if(c >=10)

{

	printf("%d" , dr);

}

    else

{

	printf("%d", dr+100*(10-c));

}

    return 0;

}








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

using namespace std;



// Caleb Faith Adnaka XI105

int main() {



    int N,R;

    cin >> N;

    cin >> R;



    if (N >= 10){

        cout << R << "\n";

    }

    else{

        cout << R + (100 * (10-N)) << "\n";

    }



}

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



int main()

{

	int c, dr; 

	scanf("%d %d", &c, &dr);

	

	if(c >=10)

{

	printf("%d" , dr);

}

    else

{

	printf("%d", dr+100*(10-c));

}

    return 0;

}








// Fastest known solution for this problem:
// Original C++ solution (slower):
// Author: Amey Bhavsar

// IDE: Geany/Ubuntu

// Platform: *



#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



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

#define repD(i,a,b) for(auto i=a;i>=b;i--)

#define pb push_back

#define mp make_pair

#define ff first

#define ss second



// to be used with algorithms that processes a container Eg: find(all(c),42)

#define all(x) (x).begin(), (x).end() //Forward traversal

#define rall(x) (x).rbegin, (x).rend() //reverse traversal

// traversal function to avoid long template definition

#define tr(c,i) for(__typeof__((c)).begin() i = (c).begin(); i != (c).end(); i++)

//find version works for all containers. This is present in std namespace.

#define cpresent(c,x) (find(all(c),x) != (c).end())

// ll fe (ll x, ll y) {

	// ll ans = 1;

	// while (y>0) {

		// if (y&1) {

			// ans = (x*ans) % MOD;

		// }

		// y /= 2;

		// x = (x*x) % MOD;

	// }

	// return (ans % MOD);

// }



// ll modmul(ll a, ll b) {

    // return ((a%MOD) * (b%MOD)) % MOD;

// }



// ll modadd(ll a , ll b){

    // return((a%MOD)+(b%MOD)+MOD)%MOD;

// }



// ll modsub(ll a , ll b){

    // return((a%MOD) - (b%MOD) + MOD)%MOD;

// }

#define MOD 1000000007

// int n;

// vector<int> a;

// void solution() {

	// cin >> n;

	// a.resize(n);

	// for (auto& e:a) {

		// cin >> e;

	// }

// }



int main() {

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

	int a,b;

	cin >> a >> b;

	if (a >= 10) {

		cout << b;

	} else {

		cout << 100*(10-a) + b;

	}

	return 0;

}


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



int main()

{

	int c, dr; 

	scanf("%d %d", &c, &dr);

	

	if(c >=10)

{

	printf("%d" , dr);

}

    else

{

	printf("%d", dr+100*(10-c));

}

    return 0;

}








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

using namespace std;



int n, r;



int main (){

    cin>>n>>r;

    if (n<10){

        cout<<r+100*(10-n);

    }else {

        cout<<r;

    }



}

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

int main()

{

	int N,R,A;

	scanf("%d %d", &N, &R);

	A =100*(10-N);

	if(N>=10){

		printf("%d", R);

	}

	else{

		printf("%d", R + A);

	}

return 0;

}

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

using namespace std;



int N, R;



int main () {

	cin >> N >> R;

	if (N<10){

		cout << R + (100*(10-N));

	} else {

		cout << R;

	}

}


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

int main()

{

	int N,R,A;

	scanf("%d %d", &N, &R);

	A =100*(10-N);

	if(N>=10){

		printf("%d", R);

	}

	else{

		printf("%d", R + A);

	}

return 0;

}

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

#include <iostream>

using namespace std;



int N,R, inner;

int main(){

	cin >> N >> R;

	if (N<10){

		inner = R+ 100*(10-N);	

		cout << inner;

	}else {

		cout << R;

	}

}


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

int main()

{

	int N,R,A;

	scanf("%d %d", &N, &R);

	A =100*(10-N);

	if(N>=10){

		printf("%d", R);

	}

	else{

		printf("%d", R + A);

	}

return 0;

}

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

using namespace std;



int N, R;



int main () {

    cin >> N >> R;

    if (N >= 10) {

        cout << R << endl;

    } else {

       cout << R + 100*(10-N) << endl;

    }

}

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

int main()

{

	int N,R,A;

	scanf("%d %d", &N, &R);

	A =100*(10-N);

	if(N>=10){

		printf("%d", R);

	}

	else{

		printf("%d", R + A);

	}

return 0;

}

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

using namespace std;



int N, R;



int main() {

    cin >> N >> R;

    if (N >= 10)

        cout << R << endl;

        else { 

            cout << R + 100 *(10-N) << endl;

        }



}

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

int main()

{

	int N,R,A;

	scanf("%d %d", &N, &R);

	A =100*(10-N);

	if(N>=10){

		printf("%d", R);

	}

	else{

		printf("%d", R + A);

	}

return 0;

}

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

using namespace std;



int N,R;

int main(){

    cin>>N>>R;

    if(N>=10)

    cout<<R<<endl;

    else

    cout<<R+100*(10-N)<<endl;

}

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

int main()

{

	int N,R,A;

	scanf("%d %d", &N, &R);

	A =100*(10-N);

	if(N>=10){

		printf("%d", R);

	}

	else{

		printf("%d", R + A);

	}

return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):


#include <bits/stdc++.h>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<cstdlib>

#include<string.h>

using namespace std;

#define pb push_back

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

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

#define per(i,n,v) for(i=n;i>v;i--)

#define ff first 

#define ss second 

#define pp pair<ll,ll>

#define ll  long long

#define endl '\n'

void solve()

{

  ll n, a,m=0,b=1, c,k=0, i, j,l=1e9+7;

  string s, r, y;

  cin>>n>>a;

  if(n>=10) cout<<a;

  else

  cout<<a+(100*(10-n));

}

int main()

{

 ios_base::sync_with_stdio(false);

  cin. tie(0);cout. tie(0);

    ll t=1;

   //cin>>t;

    while(t--)

    {

      solve();

    }

    return 0;

}

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

int main()

{

	int N,R,A;

	scanf("%d %d", &N, &R);

	A =100*(10-N);

	if(N>=10){

		printf("%d", R);

	}

	else{

		printf("%d", R + A);

	}

return 0;

}

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

using namespace std;

int n,r,ans;

int main()

{

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

    if(n<10){

        ans=r+100*(10-n);

        printf("%d",ans);

    }else{

        ans=r;

        printf("%d",ans);

    }

    return 0;

}


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

int main()

{

	int N,R,A;

	scanf("%d %d", &N, &R);

	A =100*(10-N);

	if(N>=10){

		printf("%d", R);

	}

	else{

		printf("%d", R + A);

	}

return 0;

}

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



using namespace std;



int main(){

    int n, r;

    cin>>n>>r;



    if(n<10){

        cout<<r+100*(10-n);

    }else{

        cout<<r;

    }



    return 0;

}


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

int main()

{

	int N,R,A;

	scanf("%d %d", &N, &R);

	A =100*(10-N);

	if(N>=10){

		printf("%d", R);

	}

	else{

		printf("%d", R + A);

	}

return 0;

}

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

using namespace std;

int main()

{

	int n,r;

	cin>>n>>r;

	int m;

	if(n<10)

	{

		m=r+100*(10-n);

	}

	else{

		m=r;

	}

	cout<<m<<endl;

	return 0;

}

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



int main () {

	int N, R;

	scanf("%d %d", &N, &R);

	

	if (N < 10) {

		printf("%d", R+(100*(10-N)));

	}

	else {

		printf("%d", R);

	}

	return 0;

}

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

using namespace std;

int main()

{

    int a,b;

    cin>>a>>b;

    if(a<10)

    {

        a=(100*(10-a));

        b+=a;

        cout<<b<<endl;

    }

    else

    {

        cout<<b<<endl;

    }

    return 0;

}


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



int main () {

	int N, R;

	scanf("%d %d", &N, &R);

	

	if (N < 10) {

		printf("%d", R+(100*(10-N)));

	}

	else {

		printf("%d", R);

	}

	return 0;

}

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

using namespace std;







int main()

{

int n,r;

cin >> n >> r;

if (n >= 10){

    cout << r;

}

else {

   int  x= r+(100*(10-n));

    cout << x;

}

}




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



int main () {

	int N, R;

	scanf("%d %d", &N, &R);

	

	if (N < 10) {

		printf("%d", R+(100*(10-N)));

	}

	else {

		printf("%d", R);

	}

	return 0;

}

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

using namespace std;

int N,R;

int main () {

	cin >> N >> R;

if(N>=10)

	cout << R << endl;

else {

	cout << R + 100*(10-N) << endl;

}

}


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



int main () {

	int N, R;

	scanf("%d %d", &N, &R);

	

	if (N < 10) {

		printf("%d", R+(100*(10-N)));

	}

	else {

		printf("%d", R);

	}

	return 0;

}

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

using namespace std;



int N,R;



int main () {

        cin >> N >> R;

    if (N >= 10) {

        cout << R << endl;

    } else {

        cout << R + 100*(10-N) << endl;

    }

}

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



int main () {

	int N, R;

	scanf("%d %d", &N, &R);

	

	if (N < 10) {

		printf("%d", R+(100*(10-N)));

	}

	else {

		printf("%d", R);

	}

	return 0;

}

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

using namespace std;



#define ll long long



int main() {

    ll n,r;

    cin>>n>>r;

    if(n>=10)

    {

        cout<<r;

    }

    else {

        cout<<r+100*(10-n)<<"\n";

    }

        

    

    return 0;

}

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



int main () {

	int N, R;

	scanf("%d %d", &N, &R);

	

	if (N < 10) {

		printf("%d", R+(100*(10-N)));

	}

	else {

		printf("%d", R);

	}

	return 0;

}

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

using namespace std;

const int maxn=1e5+233;



int t,n,r;

int main(){

    cin>>n>>r;

    if(n<10)cout<<(10-n)*100+r<<endl;

    else cout<<r<<endl;

    return 0;

}

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



int main () {

	int N, R;

	scanf("%d %d", &N, &R);

	

	if (N < 10) {

		printf("%d", R+(100*(10-N)));

	}

	else {

		printf("%d", R);

	}

	return 0;

}

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

using namespace std;

int main(){

	int n,r;

	cin>>n>>r;

	if(n>=10)cout<<r;

	else{

		cout<<(10-n)*100+r;

	}

}

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



int main () {

	int N, R;

	scanf("%d %d", &N, &R);

	

	if (N < 10) {

		printf("%d", R+(100*(10-N)));

	}

	else {

		printf("%d", R);

	}

	return 0;

}

// Fastest known solution for this problem: