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

#define ll long long

#define L long

#define endl "\n"

#define _START_ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

#define _END_ return 0;

using namespace std;



int main()

{   

    _START_



    int n;

    cin >> n;

    while (n != 0)

    {

        if (n % 10 == 7)

        {

            cout<< "Yes";

            return 0;

        }

        n /= 10;

    }

    cout<< "No";



    _END_

}

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



int main () {

    int n;

    scanf("%d", &n);



    int first = n / 100;

    int second = (n / 10) % 10;

    int third = n % 10;



    while ( n > 0) {

        if ( first == 7) {

            puts("Yes");

            break;

        }

        else if ( second == 7) {

            puts("Yes");

            break;

        }

        else if ( third == 7) {

            puts("Yes");

            break;

        }

        else {

            puts("No");

            break;

        }

    } 

    return 0;

}

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

using namespace std;

int main()

{

int N,a,b,c,d;

cin>>N;

c=N%10;

a=N/100;

d=N/10;

b=d%10;

if(a==7||b==7||c==7)

{

cout<<"Yes"<<endl;

}

else

{

cout<<"No"<<endl;

}

return 0;







}

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



int main()



{

   int a;



   scanf("%d",&a);



   if((a/100==7)||(a/10)%10==7||(a%10)==7)

   {

      printf("Yes\n");

   }



   else

   {

      printf("No\n");

   }

}


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

#include<string>

using namespace std;

int main()

{

    string s;

    cin>>s;

        if(s[0]=='7'||s[1]=='7'||s[2]=='7') cout<<"Yes\n"; 

        else cout<<"No\n";

}

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

char c[5];

int main(){

	scanf("%s",c);

	if(c[0]=='7'||c[1]=='7'||c[2]=='7')	puts("Yes");

	else puts("No");

	return 0;

}

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

#include<cstdio>

#include<iomanip>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<vector>

#include<map>

using namespace std;

string s[10005];

int main() 

{

	int n;

    cin>>n;

    int flag=0;

    while (n!=0)

    {

        int m=n%10;

        if (m==7)

        {

            flag=1;

            break;

        }

        n=n/10;

    }

    if (flag)

    cout<<"Yes"<<endl;

    else

    cout<<"No"<<endl;

    return 0;

}




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



int main () {

	char arr[4];

	scanf("%s", &arr);

	

	if (arr[0] == '7' || arr[1] == '7' || arr[2] == '7') {

		printf("Yes");

	}

	else {

		printf("No");

	}

	

	

	return 0;

}

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

using namespace std;

int main()

{

	int n;

	cin>>n;

	if(n/100!=7&&n%10!=7&&(n%100)/10!=7)

		cout<<"No"<<endl;

	else cout<<"Yes"<<endl;

	

	return 0; 

}

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



int main () {

	char arr[4];

	scanf("%s", &arr);

	

	if (arr[0] == '7' || arr[1] == '7' || arr[2] == '7') {

		printf("Yes");

	}

	else {

		printf("No");

	}

	

	

	return 0;

}

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

using namespace std;

int  main(){

	int n,flag=0;

	cin>>n;

	while(n){

		int x=n%10;

		n/=10;

		if(x==7){

			flag=1;

			break;

		}

	}

	if(flag==1)cout<<"Yes"<<endl;

	else cout<<"No"<<endl;

}

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



int main () {

	char arr[4];

	scanf("%s", &arr);

	

	if (arr[0] == '7' || arr[1] == '7' || arr[2] == '7') {

		printf("Yes");

	}

	else {

		printf("No");

	}

	

	

	return 0;

}

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

using namespace std;

int main()

{

    int t;

    scanf("%d",&t);

    while(t>0)

    {

        int x=t%10;

        t/=10;

        if(x==7)

        {

            cout<<"Yes"<<endl;

            return 0;

        }

    }

    cout<<"No"<<endl;

}


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



int main () {

	char arr[4];

	scanf("%s", &arr);

	

	if (arr[0] == '7' || arr[1] == '7' || arr[2] == '7') {

		printf("Yes");

	}

	else {

		printf("No");

	}

	

	

	return 0;

}

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

using namespace std;

int main(){

   int n;

   cin>>n;

   if(n%10==7)

      cout<<"Yes";

   else{

      n/=10;

      if(n%10==7)

      cout<<"Yes";

      else{

         n/=10;

         if(n==7)

            cout<<"Yes";

         else cout<<"No";

      }

   }

}


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



int main () {

	char arr[4];

	scanf("%s", &arr);

	

	if (arr[0] == '7' || arr[1] == '7' || arr[2] == '7') {

		printf("Yes");

	}

	else {

		printf("No");

	}

	

	

	return 0;

}

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

using namespace std;

int main(){

  string st;

  cin>>st;

  if(st[0]=='7' || st[1]=='7' || st[2]=='7'){

    cout<<"Yes"<<endl;

  }else{

    cout<<"No"<<endl;

  }

  

  return 0;

}

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



int main () {

	char arr[4];

	scanf("%s", &arr);

	

	if (arr[0] == '7' || arr[1] == '7' || arr[2] == '7') {

		printf("Yes");

	}

	else {

		printf("No");

	}

	

	

	return 0;

}

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

using namespace std;







int main()

{

    int N,digit,temp=0;

    cin >> N;

    while (N != 0)

    {

        digit = N % 10;

        if (digit == 7)

        {

            temp=1;

            break;

        }

        N = N / 10;

    }

    if (temp == 1)

    {

        cout << "Yes\n";

    }

    else

    {

        cout << "No\n";

    }

}


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



int main () {

	char arr[4];

	scanf("%s", &arr);

	

	if (arr[0] == '7' || arr[1] == '7' || arr[2] == '7') {

		printf("Yes");

	}

	else {

		printf("No");

	}

	

	

	return 0;

}

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

#define ll long long

#define nl "\n"

#define pi acos(-1)

#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)

#define pcase printf("Case %d:\n",ca)

int ca=1;

using namespace std;

int main(){

    string a;

    cin>>a;

    bool ans = false;

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

        if(a[i]-'0'==7){

            ans = true;

        }

    }

    if(ans == true){

        cout<<"Yes"<<nl;

    }else{

    cout<<"No"<<nl;}

}


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



int main () {

	char arr[4];

	scanf("%s", &arr);

	

	if (arr[0] == '7' || arr[1] == '7' || arr[2] == '7') {

		printf("Yes");

	}

	else {

		printf("No");

	}

	

	

	return 0;

}

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

using namespace std;

int main()

{

    string s;

    int i;

    cin >> s;



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

    {

        if(s[i]=='7')

        {



            cout<<"Yes";

            return 0;

        }



    }

    cout<<"No";

}


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



int main () {

	char arr[4];

	scanf("%s", &arr);

	

	if (arr[0] == '7' || arr[1] == '7' || arr[2] == '7') {

		printf("Yes");

	}

	else {

		printf("No");

	}

	

	

	return 0;

}

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

using namespace std;



#define ll long long

#define fast_io ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);



int main()

{

    fast_io;

    int n;

    cin >> n;

    int a,cnt=0;

    while( n != 0)

    {

        a = n % 10;

        n = n / 10;

        if(a == 7)

        {

            cnt++;

            break;

        }

    }

    if(cnt > 0)

    {

        cout << "Yes\n";

    }

    else

    {

        cout << "No\n";

    }

}


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



int main () {

	char arr[4];

	scanf("%s", &arr);

	

	if (arr[0] == '7' || arr[1] == '7' || arr[2] == '7') {

		printf("Yes");

	}

	else {

		printf("No");

	}

	

	

	return 0;

}

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

using namespace std;

int main()

{

    int n;

    cin>>n;

    while(n)

    {

        if(n%10==7){cout<<"Yes"<<endl;return 0;}n/=10;

    }cout<<"No";

}


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



int main(){

    char arr[4];

    scanf ("%[^\n]", arr);

    for (int i = 0; arr[i] != '\0'; i++)

        if (arr[i] == '7') return puts ("Yes"), 0;

    puts ("No");

}


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

using namespace std;

string n;

int k;

int main(){

	cin>>n;

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

		k=n[i]-'0';

		if (k==7){

			cout<<"Yes"<<endl;

			return 0;

		}

	}

	cout<<"No"<<endl;

	return 0;

}

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



int main(){

    char arr[4];

    scanf ("%[^\n]", arr);

    for (int i = 0; arr[i] != '\0'; i++)

        if (arr[i] == '7') return puts ("Yes"), 0;

    puts ("No");

}


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

using namespace std;



int main(){

    int n;

    cin>>n;



   int cnt=0;

   while(n>0){

    int x=n%10;

    if(x ==7)cnt++;

    n/=10;

   }

   if(cnt>0)cout<<"Yes\n" ;

   else

    cout<<"No\n" ;









return 0;



}


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



int main(){

    char arr[4];

    scanf ("%[^\n]", arr);

    for (int i = 0; arr[i] != '\0'; i++)

        if (arr[i] == '7') return puts ("Yes"), 0;

    puts ("No");

}


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

using namespace std;

#define ll long long int



int main(){

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

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

    int N;

    cin >> N;

    

    bool possible = false;

    while(N!=0){

        if(N%10==7){

            possible = true;

            break;

        }

        N/=10;

        

    }

    

    if(possible) cout << "Yes";

    else cout << "No";

}

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



int main(){

    char arr[4];

    scanf ("%[^\n]", arr);

    for (int i = 0; arr[i] != '\0'; i++)

        if (arr[i] == '7') return puts ("Yes"), 0;

    puts ("No");

}


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

#include<iostream>

//#include<map>

//#include<vector>

//#include<algorithm>

#define ll long long

#define endl "\n"

using namespace std;

//map<int,int>m;

/*

bool isprime[500+5];

vector<int>pf;

vector<int>arr;



void sieve()   // O(N lg lg N)

{

    int n=500; //sqrt of 2^31

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

    {

        isprime[i] = true;

    }

    isprime[0] = isprime[1] = false;

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

    {

        if(isprime[i] == true)

        {

            for(int j = i * i; j <= n; j += i)

            {

                isprime[j] = false;

            }

        }

    }

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

    {

        if(isprime[i])

        {

            pf.push_back(i); //store the prime numbers upto 10^8

        }

    }

} */

bool check(int n)

{

    int r;

    while(n>0)

    {

        r=n%10;

        if(r==7)

        {

            return true;

        }



        n=n/10;

    }

    return false;

}



int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    cout.tie(0);//NULL;

    // sieve();

    int t;

    cin>>t;

    if(check(t))

 {

     cout<<"Yes"<<endl;

 }

 else

 {

     cout<<"No"<<endl;

 }







}






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



int main(){

    char arr[4];

    scanf ("%[^\n]", arr);

    for (int i = 0; arr[i] != '\0'; i++)

        if (arr[i] == '7') return puts ("Yes"), 0;

    puts ("No");

}


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

#define ll long long

using namespace std;



int main()

{

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

	//freopen("output.txt", "w", stdout);

	ios_base::sync_with_stdio(false);

	cin.tie(0);

	cout.tie(0);

	string str;

	cin >> str;

	for (int i = 0; i < str.length(); i++)

	{

		if (str[i] == '7')

		{

			cout << "Yes" << "\n";

			return 0;

		}

	}

	cout << "No" << "\n";

	return 0;

}

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



int main(){

    char arr[4];

    scanf ("%[^\n]", arr);

    for (int i = 0; arr[i] != '\0'; i++)

        if (arr[i] == '7') return puts ("Yes"), 0;

    puts ("No");

}


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

using namespace std;

int main()

{

    int n,res=0;

    scanf("%d",&n);

    while(1)

    {

    res=n%10;

    if(res-7==0){

        cout << "Yes" << "\n";

        break;

    }

    n=n/10;

    res=n%10;

    if(res-7==0){

        cout << "Yes" << "\n";

        break;

    }

    n=n/10;

    res=n%10;

    if(res-7==0){

        cout << "Yes" << "\n";

        break;

    }

        else{

        cout << "No" << "\n";

        return 0;

        }

    }

    return 0;

}


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



int main(){

    char arr[4];

    scanf ("%[^\n]", arr);

    for (int i = 0; arr[i] != '\0'; i++)

        if (arr[i] == '7') return puts ("Yes"), 0;

    puts ("No");

}


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



using namespace std;



int main(){

  int N=0;

  cin>>N;

  string str=to_string(N);

  if(str.find("7")!=string::npos)

    cout<<"Yes"<<endl;

  else

    cout<<"No"<<endl;

}

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



int main(){

  int N=0;

  scanf("%d",&N);

  int a=static_cast<int>(N/100);

  int b=static_cast<int>(N%100/10);

  int c=N%10;



  if(a==7 or b==7 or c==7)

    printf("Yes\n");

  else

    printf("No\n");

}

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



using namespace std;





int main(){

  int N=0;

  ios_base::sync_with_stdio(false);

  cin.tie(NULL);

  cin>>N;

  string str=to_string(N);

  if(str.find("7")!=string::npos)

    cout<<"Yes"<<endl;

  else

    cout<<"No"<<endl;

}

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



int main(){

  int N=0;

  scanf("%d",&N);

  int a=static_cast<int>(N/100);

  int b=static_cast<int>(N%100/10);

  int c=N%10;



  if(a==7 or b==7 or c==7)

    printf("Yes\n");

  else

    printf("No\n");

}

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

#define INF 1000000000

#define LINF 1000000000000000000

#define MOD 1000000007

#define mod 1000007

#define INF63 1061109567

#define INF127 9187201950435737471

#define UINF 18446744073709551615

#define F first

#define S second

#define ll long long

#define N 200010

using namespace std;

int n,a[N],b[N],dxa[N],dxb[N],enr[4*N],ext[4*N];

int main(){

	int i,j,cnt=0;

	cin>>n;

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

	{

		cin>>a[i];

	}

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

	{

		cin>>b[i];

	}

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

	{

		dxa[i]=a[i]^a[(i+1)%n];

	}

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

	{

		dxb[i]=b[i]^b[(i+1)%n];

	}

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

	{

		enr[cnt++]=dxb[i];

	}

	enr[cnt++]=-INF;

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

	{

		enr[cnt++]=dxa[i];

	}

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

	{

		enr[cnt++]=dxa[i];

	}

	memset(ext,0,sizeof(ext));

	ext[0]=3*n+1;

	cnt=0;

	for(i=1;i<=3*n;)

	{

		while(i+cnt<=3*n)

		{

			if(enr[cnt]!=enr[i+cnt])

			{

				break;

			}

			cnt++;

		}

		ext[i]=cnt;

		j=1;

		if(cnt<=0)

		{

			i++;

			continue;

		}

		else

		{

			while(i+j<=3*n)

			{

				if(j+ext[j]>=cnt)

				{

					break;

				}

				ext[i+j]=ext[j];

				j++;

			}

		}

		i+=j;

		cnt-=j;

	}

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

	{

		if(ext[i]==n)

		{

			cout<<i-n-1<<" "<<(a[i-n-1]^b[0])<<endl;

		}

	}

	return 0;

}

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

#define INF 1000000000

#define LINF 1000000000000000000

#define MOD 1000000007

#define mod 1000007

#define INF63 1061109567

#define INF127 9187201950435737471

#define UINF 18446744073709551615

#define F first

#define S second

#define ll long long

#define N 200010

#define HASH 813234241

using namespace std;

ll n,a[N],b[N],dxa[N],dxb[N],phs=0,ehs=0,pres;

ll ksm(ll x,ll y)

{

	if(y==0)

	{

		return 1;

	}

	if(y==1)

	{

		return x;

	}

	ll ret=ksm(x,y/2);

	if(y%2==1)

	{

		return (((ret*ret)%MOD)*x)%MOD;

	}

	return (ret*ret)%MOD;

}

int main(){

	ll i,j,cnt=0;

	cin>>n;

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

	{

		cin>>a[i];

	}

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

	{

		cin>>b[i];

	}

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

	{

		dxa[i]=a[i]^a[(i+1)%n];

		phs=(phs*HASH+dxa[i])%MOD;

	}

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

	{

		dxb[i]=b[i]^b[(i+1)%n];

		ehs=(ehs*HASH+dxb[i])%MOD;

	}

	pres=ksm(HASH,n-1);

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

	{

		if(phs==ehs)

		{

			cout<<i<<" "<<(a[0]^b[(n-i)%n])<<endl;

		}

		phs=(((phs-(pres*dxa[i])%MOD)%MOD)+MOD)%MOD;//减去多余的前缀 

		phs=(phs*HASH+dxa[i])%MOD;//加上第i个 

	}

	return 0;

}

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

#include <vector>

#include <iostream>

#include <algorithm>

using namespace std;

struct edge { int to, id; };

int n, vc, a[200009], b[200009], c[200009]; long long sd, ans[200009], s[200009], dist[200009]; vector<edge> g[200009];

void dfs(int pos, int pre) {

	c[pos] = 1;

	for (edge e : g[pos]) {

		if (e.to != pre) {

			dfs(e.to, pos);

			c[pos] += c[e.to];

			// e.to -> pos, increased nodes = c[e.to], decreased nodes = n - c[e.to]

			if (n - c[e.to] * 2 != 0) {

				ans[e.id] = (s[e.to] - s[pos]) / (n - c[e.to] * 2);

			}

		}

	}

}

void dfs2(int pos, int pre, int flag) {

	if (flag) vc++; sd += dist[pos];

	for (edge e : g[pos]) {

		if (e.to != pre) {

			dist[e.to] = dist[pos];

			if (ans[e.id] != -1) dist[e.to] += ans[e.id];

			dfs2(e.to, pos, (flag | (ans[e.id] == -1 ? 1 : 0)));

		}

	}

}

int main() {

	cin >> n;

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

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

		g[a[i]].push_back(edge{ b[i], i });

		g[b[i]].push_back(edge{ a[i], i });

	}

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

	fill(ans, ans + n - 1, -1);

	dfs(0, -1);

	int zp = -1;

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

		if (ans[i] == -1) zp = i;

	}

	if (zp != -1) {

		dfs2(0, -1, 0);

		ans[zp] = (s[0] - sd) / vc;

	}

	for (int i = 0; i < n - 1; i++) cout << ans[i] << endl;

	return 0;

}

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

#include <iostream>

using namespace std;

struct edge {

	int to, id;

	edge() : to(-1), id(-1) {};

	edge(int to_, int id_) : to(to_), id(id_) {};

};

int n, eid = -1; vector<int> a, b, c; vector<long long> s, t; vector<vector<edge> > g;

void dfs(int pos, int pre) {

	c[pos] = 1;

	for (edge e : g[pos]) {

		if (e.to != pre) {

			dfs(e.to, pos);

			c[pos] += c[e.to];

			if (c[e.to] * 2 != n) {

				t[e.id] = (s[e.to] - s[pos]) / (n - 2 * c[e.to]);

			}

			else eid = e.id;

		}

	}

}

long long calc(int pos, int pre, long long cumdist) {

	long long ret = cumdist;

	for (edge e : g[pos]) {

		if (e.to != pre) {

			ret += calc(e.to, pos, cumdist + t[e.id]);

		}

	}

	return ret;

}

int main() {

	cin.tie(0);

	cin >> n;

	a = vector<int>(n - 1);

	b = vector<int>(n - 1);

	s = vector<long long>(n);

	g = vector<vector<edge> >(n);

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

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

		g[a[i]].push_back(edge(b[i], i));

		g[b[i]].push_back(edge(a[i], i));

	}

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

		cin >> s[i];

	}

	c = vector<int>(n);

	t = vector<long long>(n - 1);

	dfs(0, -1);

	if (eid != -1) {

		long long cur = calc(a[eid], -1, 0);

		t[eid] = (s[a[eid]] - cur) / (n / 2);

	}

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

		cout << t[i] << '\n';

	}

	return 0;

}

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

using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;

const int INF = 1e9;

const ll LINF = 1e16;



/*

<url:https://abc087.contest.atcoder.jp/tasks/abc087_b>

問題文============================================================

 あなたは、500 円玉を A 枚、100 円玉を B 枚、50 円玉を C 枚持っています。

 これらの硬貨の中から何枚かを選び、合計金額をちょうど X 円にする方法は何通りありますか。

 

 同じ種類の硬貨どうしは区別できません。

 2 通りの硬貨の選び方は、ある種類の硬貨についてその硬貨を選ぶ枚数が異なるとき区別されます。

=================================================================



解説=============================================================

全探索

================================================================

*/

int main(void) {

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

    ll A,B,C,X; cin >> A >> B >> C >> X;

    

 //   ll cntA = X/A, cntB = X/B, cntC = X/C;

    

    ll ans = 0;

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

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

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

                if(500*i + 100*j + 50*k == X){

                    ans++;

                }

            }

        }

    }

    

    cout << ans << endl;

    

	return 0;

}


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

using namespace std;

int A, B, C;

int X;

int solve(){

int result = 0;

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

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

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

int tmp = i * 500 + j * 100 + k * 50;

if(tmp == X) result++;

}

}

}

return result;

}

int main(){

scanf("%d%d%d%d", &A, &B, &C, &X);

int result = solve();

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

return 0;

}

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

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <algorithm>

#include <math.h>

#include <time.h>

#include <vector>

#include <map>

#include <set>

using namespace std;



int main()

{

	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

	int x,a,b,c;

	cin>>a>>b>>c>>x;

	int tot=0;

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

	{

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

		

		{

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

			{

				if(500*i+100*j+50*k==x)

				{

					tot++;

				}

			}

		}

	}

	cout<<tot;

	return 0;

}


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

using namespace std;

int A, B, C;

int X;

int solve(){

int result = 0;

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

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

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

int tmp = i * 500 + j * 100 + k * 50;

if(tmp == X) result++;

}

}

}

return result;

}

int main(){

scanf("%d%d%d%d", &A, &B, &C, &X);

int result = solve();

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

return 0;

}

// Fastest known solution for this problem: