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

using namespace std;

using LL = long long;

using ULL = unsigned long long;

using VI = vector<int>;

using VL = vector<LL>;

using PII = pair<int, int>;

using PLL = pair<LL, LL>;



#define SZ(a) (int)a.size()

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

#define MP make_pair

#define PB push_back

#define EB emplace_back

#define F first

#define S second

#define FOR(i, a, b) for (int i = (a); i<(b); ++i)

#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)

#define FILL(a, b) memset(a, b, sizeof(a))



void dout() { cerr << endl; }



template <typename Head, typename... Tail>

void dout(Head H, Tail... T) {

    cerr << H << ' ';

    dout(T...);

}



int main()

{

    ios::sync_with_stdio(false);

    cin.tie(nullptr);

    int n, t;

    cin >> n >> t;

    VI a(n);

    FOR(i, 0, n)

        cin >> a[i];

    VI prof(n);

    int mn = a[0];

    FOR(i, 1, n)

    {

        prof[i] = a[i] - mn;

        mn = min(mn, a[i]);

    }

    int mx = *max_element(ALL(prof));

    cout << count(ALL(prof), mx);

    return 0;

}

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

int min(int a,int b)

{

	if(a<b)

		return a;

	else

		return b;

}

int main()

{

	int n,t,i,pos,old,ans=0;

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

	int min_pic=0x3f3f3f3f,max_value=0;

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

	{

		scanf("%d",&pos);

		if(i==0)

		{

			min_pic=pos;

			old=pos;

		}

		else

		{

			if(pos>old)

			{

				if(pos-min_pic>max_value)

				{

					max_value=pos-min_pic;

					ans=1;

				}

				else if(pos-min_pic==max_value)

					ans++;

			}

			else

				old=pos;

			if(min_pic>pos)

				min_pic=pos;

		}

	}

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

}

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

#pragma comment(linker, "/stack:16777216")

#include <string>

#include <vector>

#include <map>

#include <list>

#include <iterator>

#include <set>

#include <queue>

#include <iostream>

#include <sstream>

#include <stack>

#include <deque>

#include <cmath>  

#include <memory.h>

#include <cstdlib>

#include <cstdio>

#include <cctype>

#include <algorithm>

#include <utility>

#include <time.h>

#include <bitset>

using namespace std;



#define FOR(i, a, b) for(int i = (a); i < (b); ++i)

#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)

#define ITER(it, a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)

#define FILL(A,value) memset(A,value,sizeof(A))



#define ALL(V) V.begin(), V.end()

#define SZ(V) (int)V.size()

#define PB push_back

#define MP make_pair

const double PI=acos(-1.0);



typedef long long Int;

typedef long long LL;

typedef unsigned long long UINT;

typedef vector <int> VI;

typedef pair <int, int> PII;

typedef pair <double, double> PDD;



const int INF = 1000 * 1000 * 1000 + 7;

const LL LINF = INF * (LL) INF;



const int MAX = 2100000;

const int MAX1 = 2007;

const int MAX2 = 24000000;

const int LEN = 21;

const int BASE = 1000000000;



const int MOD = 1000000007;



int n, t;

VI A;



int main()

{

  cin >> n >> t;

  FOR (i,0,n)

  {

    int x;

    cin >> x;

    A.PB(x);

  }



  int mx = 0, md = 0, cnt = 0;

  RFOR (i,n,0)

  {

    if (mx > A[i])

    {

      int d = mx - A[i];

      if (d > md)

      {

        cnt = 1;

        md = d;

      }

      else

      if (md == d) ++ cnt;

    }



    mx = max(mx, A[i]);

  }





  cout << cnt << endl;

  

  return 0;

}


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

int min(int a,int b)

{

	if(a<b)

		return a;

	else

		return b;

}

int main()

{

	int n,t,i,pos,old,ans=0;

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

	int min_pic=0x3f3f3f3f,max_value=0;

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

	{

		scanf("%d",&pos);

		if(i==0)

		{

			min_pic=pos;

			old=pos;

		}

		else

		{

			if(pos>old)

			{

				if(pos-min_pic>max_value)

				{

					max_value=pos-min_pic;

					ans=1;

				}

				else if(pos-min_pic==max_value)

					ans++;

			}

			else

				old=pos;

			if(min_pic>pos)

				min_pic=pos;

		}

	}

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

}

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

#include <algorithm>

#include <vector>

#include <map>



using namespace std;



int main() {

    size_t N, T;

    scanf("%zu %zu", &N, &T);



    map<int, size_t> d;

    int min_=1e9+7;

    for (size_t i=0; i<N; ++i) {

        int A;

        scanf("%d", &A);



        if (min_ > A)

            min_ = A;



        if (min_ != A)

            ++d[A-min_];

    }



    printf("%zu\n", d.rbegin()->second);

    return 0;

}


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

#include <algorithm>



int main() {

  int N;

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



  int min=1e9+1;

  int maxprofit=0, res=0;

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

    int A;

    scanf("%d", &A);



    if (A < min)

      min = A;



    if (A - min == maxprofit) {

      ++res;

    } else if (A - min > maxprofit) {

      maxprofit = A - min;

      res = 1;

    }

  }



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

  return 0;

}


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

using namespace std;

#define maxn 100010

#define inf 0x3f3f3f3f

int v[maxn];

int pre[maxn];

vector<int> g[maxn];

int ty[maxn];

bool used[maxn];

int a,b;

void dfs(int u){

    a++;b+=ty[u];

    used[u]=true;

    for(int i=0;i<g[u].size();i++){

        int to=g[u][i];

        if(used[to]) continue;

        dfs(to);

    }

}

int main(){

    int n,T;

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

    scanf("%d",&v[0]);

    int minx=v[0],dis=0,pos=0;

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

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

        if(v[i]<=minx){

            pre[i]=i;

            minx=v[i];

            pos=i;

        }

        else{

            pre[i]=pos;

            dis=max(dis,v[i]-v[pos]);

        }

    }

    memset(used,1,sizeof(used));

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

        if(v[i]-v[pre[i]]==dis){

            g[pre[i]].push_back(i);

            g[i].push_back(pre[i]);

            used[i]=used[pre[i]]=false;

            ty[pre[i]]=1;

        }

    }

    int res=0;

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

        if(!used[i]){

            a=b=0;

            dfs(i);

            res+=min(b,a-b);

        }

    }

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

    return 0;

}


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

using namespace std;

#define maxn 100010

int q[maxn],top=0;

int Max=0,cnt=0;

int n,a[maxn];

int main()

{

    int t,T;

    t=1;

    while (t--)

    {

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

        for (int i=0;i<n;i++) scanf("%d",&a[i]);

        q[0]=a[0],top=0;

        Max=-1;

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

        {

            if (a[i]>q[top]) q[++top]=a[i];

            else if (a[i]<q[top])

            {

                if (q[top]-q[0]>Max) Max=q[top]-q[0],cnt=1;

                else if (q[top]-q[0]==Max) cnt++;

                while (top>=0&&a[i]<q[top]) top--;

                q[++top]=a[i];

            }

        }

        if (q[top]-q[0]>Max) Max=q[top]-q[0],cnt=1;

        else if (q[top]-q[0]==Max) cnt++;

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

    }

    return 0;

}


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

using namespace std;

int n, T, a[100010], dp[100010];

int main() {

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

	int mn = 0x3f3f3f3f, ans = 0;

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

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

		dp[i] = max(0, a[i] - mn);

		ans = max(ans, dp[i]);

		mn = min(mn, a[i]);

	}

	mn = 0x3f3f3f3f; int tot = 0;

	for (int i = 1; i <= n; ++ i) {if (a[i] - mn == ans) ++ tot; mn = min(mn, a[i]);}

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

	return 0;

}

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

int main () {

    int n,k,a,b,c;

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

    c=k=0,n--;

    while(n--){

        scanf("%d",&a);

        if (a-b==c) k++;

        else if (a-b>c) k=1,c=a-b;

        else if (a<b) b=a;

    }

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

    return 0;

}


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

#include <cmath>

using namespace std;

int a[20][20];



int main(){

	

	//printf("%f",sqrt((1-5)^2)+((2-5)^2));

	

	int n,d;

	double EPS=1e-10;

	cin>>n>>d;

	

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

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

			cin>>a[i][j];

		}

	}

	

	int sum=0;

	

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

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

			double ans=0;

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

				ans+=(a[i][j]-a[k][j])*(a[i][j]-a[k][j]);

				//printf("%f\n",ans);

			}

			double ans1=sqrt(ans);

			//printf("%f\t%f\t%f\n",ans,ans1-floor(ans1),ans1-floor(ans1));

			if(ans1-floor(ans1)<EPS){

				sum++;

				//printf("%f\t\t%f\n",ans,ans1-floor(ans1));

			}

		}

	}

	cout<<sum<<endl;

	return 0;

}








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

#include<math.h>

int a[100][20]={0};

int main()

{

	int n,m,i,j,t;

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

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

	{

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

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

	}

	int sum;

	sum=0;

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

	{

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

		{

//			printf("1\n");

			double s=0;

			for(t=0;t<m;t++)

			{

				s+=((a[i][t]-a[j][t])*(a[i][t]-a[j][t]));

//				printf("2\n");

			}

			

			s=sqrt(s);

			int mu=s;

			if(s-mu==0)

			sum++;

		}

	}

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

 } 

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



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

#define rall(c) c.rbegin(), c.rend()



using namespace std;



typedef long long ll;



int main(){

    int n; ll ans = 0;

    cin >> n;

    vector<int> l(n+1, 0), r(n+1, 0);

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

        cin >> l[i] >> r[i];

    sort(rall(l));

    sort(all(r));

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

    {

        if(l[i] - r[i] <= 0)

            break;

        ans += l[i] - r[i];

    }

    cout << 2*ans << endl;

}


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

#include<string.h>

#include<algorithm>

#include<math.h>

using namespace std;

#define N 100010

int l[N],r[N];



int main()

{

    int n,i,j,k,x,t1,t2,s1,s2;

    long long ans;

    scanf("%d",&n);

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

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

    sort(l,l+n+1);

    sort(r,r+n+1);

    ans=0;

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

    {

        if(l[n-i]<=r[i])

            break;

        ans=ans+l[n-i]-r[i];

    }

    printf("%lld\n",ans*2);

    return 0;

}


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

#include<cstdio>

#include<cstring>

  

const int Maxv = 100010; 

int l[Maxv << 1], r[Maxv << 1], n; 

long long ans; 

  

inline int read(){

    int x = 0, f = 1; 

    char ch = getchar(); 

    while (ch < '0' || ch > '9') {

        if (ch == '-') {

            f = -1; 

        }

        ch = getchar(); 

    }

    while (ch >= '0' && ch <= '9') {

        x = (x << 3) + (x << 1) + ch - '0'; 

        ch = getchar(); 

    }

    return x * f; 

}

  

int main(){

    n = read(); 

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

        int L = read(); 

        int R = read(); 

        l[Maxv + R]++; 

        r[Maxv + L]++; 

    }

    l[Maxv]++; 

    r[Maxv]++; 

    for (int i = 1; i < 2 * Maxv; i++) {

        l[i] += l[i - 1]; 

    }

    for (int i = 2 * Maxv - 2; i >= 0; i--) {

        r[i] += r[i + 1]; 

    }

    for (int i = 0; i < 2 * Maxv - 1; i++) {

        ans += std::min(l[i], r[i + 1]) * 2; 

    }

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

    return 0; 

}

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

using namespace std;



#define scl(x) scanf("%lld",&x)

#define sc(x)  scanf("%d",&x)

#define ll long long

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

typedef pair<int, int> ii;

typedef pair<ll, ll> pll;



const int N=1e5+100;

int n,l[N],r[N];

set<ii> sl,sr;



ll solve(int xr){

	lop(i,n){

		sl.insert(ii(l[i],i));

		sr.insert(ii(r[i],i));

	}

	ll ret=0;

	int cur=0;

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

		int i,to=cur;

		if((j&1)^xr) i=sr.begin()->second;

		else i=sl.rbegin()->second;

		if(cur<l[i])to = l[i];

		else if(cur>r[i])to=r[i];

		ret+=abs(cur-to);

		cur=to;

		sr.erase(ii(r[i],i));

		sl.erase(ii(l[i],i));

	}

	return ret+abs(cur);

}

int main(){

#ifndef ONLINE_JUDGE

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

#endif

	sc(n);

	lop(i,n)

		sc(l[i]),sc(r[i]);

	cout<<max(solve(0),solve(1));



}


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

using namespace std;



const int C=100010, N=200010;

int a[N], b[N];



int main()

{

	int n;

	scanf ("%d", &n);

	a[C]++, b[C]++;

	

	while (n--){

		int l, r;

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

		l += C, r += C;

		a[l]++, b[r]++;

	}

	

	for (int i=N-2; i>=0; i--)

		a[i] += a[i+1];

		

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

		b[i] += b[i-1];

		

	long long ans=0;

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

		ans += min (b[i], a[i+1]);

		

		

	printf ("%lld\n", ans*2);

	return 0;

}

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

using namespace std;

#define mp(a,b) make_pair(a,b)

#define fi first

#define se second



priority_queue<pair<int,int> > LL,RR,L,R;

bool vis[100005];

long long ans1,ans2;

int n;



void PlanA(int now,long long &ans)

{

	while (!L.empty() && vis[L.top().se]) L.pop();

	while (!R.empty() && vis[R.top().se]) R.pop();

	if (!L.empty() && L.top().fi>now)

	{

		ans+=L.top().fi-now;

		now=L.top().fi;

		vis[L.top().se]=1;

		L.pop();

		PlanA(now,ans);

	}

	else if (!R.empty() && -R.top().fi<now)

	{

		ans+=now+R.top().fi;

		now=-R.top().fi;

		vis[R.top().se]=1;

		R.pop();

		PlanA(now,ans);

	}

	else ans+=abs(now);

}



void PlanB(int now,long long &ans)

{

	while (!L.empty() && vis[L.top().se]) L.pop();

	while (!R.empty() && vis[R.top().se]) R.pop();

	if (!R.empty() && -R.top().fi<now)

	{

		ans+=now+R.top().fi;

		now=-R.top().fi;

		vis[R.top().se]=1;

		R.pop();

		PlanB(now,ans);

	}

	else if (!L.empty() && L.top().fi>now)

	{

		ans+=L.top().fi-now;

		now=L.top().fi;

		vis[L.top().se]=1;

		L.pop();

		PlanB(now,ans);

	}

	else ans+=abs(now);

}



int main()

{

	scanf("%d",&n);

	for (int i=1,l,r;i<=n;i++)

	{

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

		LL.push(mp(l,i));

		RR.push(mp(-r,i));

	}

	L=LL,R=RR;

	PlanA(0,ans1);

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

	L=LL,R=RR;

	PlanB(0,ans2);

	printf("%lld\n",max(ans1,ans2));

}

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

#include <cstdio>

#include <iostream>

#include <cfloat>

#include <climits>

#include <cstdlib>

#include <cstring>

#include <cmath>

#include <queue>

#include <sstream>

#include <stack>

#include <time.h>

#include <vector>

#include <complex>

#include <map>

#include <set>

#include <iomanip>

#include <math.h>

#include <stdlib.h>

#include <list>

#include <utility>

#include <memory>

#include <cstring>

#include <fstream>

#include <numeric>

#include <assert.h>

#include <bitset>

#include <ios> 

#include <bits/stdc++.h>

using namespace std;

int n,a[200004],b[200004];

int main(){

	cin>>n;

	a[100000]++;

	b[100000]++;

	while (n--){

		int l,r;

		cin>>l>>r;

		a[l+100000]++;

		b[r+100000]++;

	}

	for (int i=200000;i>=0;i--)

		a[i]+=a[i+1];

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

		b[i]+=b[i-1];

	long long ans=0;

	for (int i=0;i<=200000;i++) ans+=min(b[i],a[i+1]);

	cout<<ans*2;

}

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

#include <cstdio>

#include <iostream>

#include <cfloat>

#include <climits>

#include <cstdlib>

#include <cstring>

#include <cmath>

#include <queue>

#include <sstream>

#include <stack>

#include <time.h>

#include <vector>

#include <complex>

#include <map>

#include <set>

#include <iomanip>

#include <math.h>

#include <stdlib.h>

#include <list>

#include <utility>

#include <memory>

#include <cstring>

#include <fstream>

#include <numeric>

#include <assert.h>

#include <bitset>

#include <ios> 

#include <bits/stdc++.h>

using namespace std;

int main(){

	int n;

	cin>>n;

	vector <int> x(n+1),y(n+1);

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

	sort (x.rbegin(),x.rend());

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

	long long ans=0;

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

		if (x[i]>y[i]){

			ans+=2*(x[i]-y[i]);

		}

	}

	cout<<ans;

}

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

using namespace std; 

int main() 

{ 

int a,b,c;

  cin>>a>>b>>c;

  if(a==5&&b==5&&c==7)  cout<<"YES"<<endl;

  else if(a==5&&b==7&&c==5)  cout<<"YES"<<endl;

  else if(a==7&&b==5&&c==5)  cout<<"YES"<<endl;

  else cout<<"NO"<<endl;

  return 0; 

  }

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

#include <cmath>





int main(){

	/*

	+ - 

	* / %

	=

	==  !=    <     >    <=    >=  

	double eps = 1e-8; 

	double x = 0.1, y = 0.2;

	fabs(x - y) < eps

	abs()

	if(x == y) printf("aa");

	*/

	/*

	位运算符



	&

	|

	^





	*/



	/*

	1 & 1 = 1

	1 & 0 = 0

	0 & 1 = 0

	0 & 0 = 0



	1 | 1 = 1

	1 | 0 = 1

	0 | 1 = 1

	0 | 0 = 0



	1 ^ 1 = 0

	1 ^ 0 = 1

	0 ^ 1 = 1

	0 ^ 0 = 0

	*/



	/*

   int n = 0;

   scanf("%d", &n);

   if((n & 1) == 1) printf("%d是奇数\n", n);

   else printf("%d是偶数\n", n);

	 */



	 /*

		 &&      || 

	 */

	int a, b, c;

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

	if(a == 5 && b == 7 && c == 5) printf("YES\n");

	else if(a == 7 && b == 5 && c == 5) printf("YES\n");

	else if(a == 5 && b == 5 && c == 7) printf("YES\n");

	else printf("NO\n");

	return 0;

}

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

#include<cstdio>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<string>

using namespace std;

int main(){

	int A,B,C;

	cin>>A>>B>>C;

	if(A==5&&B==7&&C==5)

	

	{cout<<"YES"<<endl;

	}else if(A==5&&B==5&&C==7){cout<<"YES"<<endl;

	}else if(A==7&&B==5&&C==5){cout<<"YES"<<endl;

	} 

	else{cout<<"NO"<<endl;

	}

	

}

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

#include <cmath>





int main(){

	/*

	+ - 

	* / %

	=

	==  !=    <     >    <=    >=  

	double eps = 1e-8; 

	double x = 0.1, y = 0.2;

	fabs(x - y) < eps

	abs()

	if(x == y) printf("aa");

	*/

	/*

	位运算符



	&

	|

	^





	*/



	/*

	1 & 1 = 1

	1 & 0 = 0

	0 & 1 = 0

	0 & 0 = 0



	1 | 1 = 1

	1 | 0 = 1

	0 | 1 = 1

	0 | 0 = 0



	1 ^ 1 = 0

	1 ^ 0 = 1

	0 ^ 1 = 1

	0 ^ 0 = 0

	*/



	/*

   int n = 0;

   scanf("%d", &n);

   if((n & 1) == 1) printf("%d是奇数\n", n);

   else printf("%d是偶数\n", n);

	 */



	 /*

		 &&      || 

	 */

	int a, b, c;

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

	if(a == 5 && b == 7 && c == 5) printf("YES\n");

	else if(a == 7 && b == 5 && c == 5) printf("YES\n");

	else if(a == 5 && b == 5 && c == 7) printf("YES\n");

	else printf("NO\n");

	return 0;

}

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



using namespace std;



int main()

{

    int a,b,c;

    cin>>a>>b>>c;

    if(a==7&&b==5&&c==5)

    {

        cout<<"YES"<<endl;

    }

    else if(a==5&&b==7&&c==5)

    {

       cout<<"YES"<<endl;

    }

    else if(a==5&&b==5&&c==7)

    {

        cout<<"YES"<<endl;

    }

    else



        cout<<"NO"<<endl;



    return 0;

}


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

#include <cmath>





int main(){

	/*

	+ - 

	* / %

	=

	==  !=    <     >    <=    >=  

	double eps = 1e-8; 

	double x = 0.1, y = 0.2;

	fabs(x - y) < eps

	abs()

	if(x == y) printf("aa");

	*/

	/*

	位运算符



	&

	|

	^





	*/



	/*

	1 & 1 = 1

	1 & 0 = 0

	0 & 1 = 0

	0 & 0 = 0



	1 | 1 = 1

	1 | 0 = 1

	0 | 1 = 1

	0 | 0 = 0



	1 ^ 1 = 0

	1 ^ 0 = 1

	0 ^ 1 = 1

	0 ^ 0 = 0

	*/



	/*

   int n = 0;

   scanf("%d", &n);

   if((n & 1) == 1) printf("%d是奇数\n", n);

   else printf("%d是偶数\n", n);

	 */



	 /*

		 &&      || 

	 */

	int a, b, c;

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

	if(a == 5 && b == 7 && c == 5) printf("YES\n");

	else if(a == 7 && b == 5 && c == 5) printf("YES\n");

	else if(a == 5 && b == 5 && c == 7) printf("YES\n");

	else printf("NO\n");

	return 0;

}

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

using namespace std;



map <int,int> Mapita;



int main(){

	int A,B,C;

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

	Mapita[A]++;

	Mapita[B]++;

	Mapita[C]++;

	if (Mapita[5]>=2 && Mapita[7]>=1){

		cout << "YES";

	}else{

		cout << "NO";

	}

	return 0;

}

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

#include <cmath>





int main(){

	/*

	+ - 

	* / %

	=

	==  !=    <     >    <=    >=  

	double eps = 1e-8; 

	double x = 0.1, y = 0.2;

	fabs(x - y) < eps

	abs()

	if(x == y) printf("aa");

	*/

	/*

	位运算符



	&

	|

	^





	*/



	/*

	1 & 1 = 1

	1 & 0 = 0

	0 & 1 = 0

	0 & 0 = 0



	1 | 1 = 1

	1 | 0 = 1

	0 | 1 = 1

	0 | 0 = 0



	1 ^ 1 = 0

	1 ^ 0 = 1

	0 ^ 1 = 1

	0 ^ 0 = 0

	*/



	/*

   int n = 0;

   scanf("%d", &n);

   if((n & 1) == 1) printf("%d是奇数\n", n);

   else printf("%d是偶数\n", n);

	 */



	 /*

		 &&      || 

	 */

	int a, b, c;

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

	if(a == 5 && b == 7 && c == 5) printf("YES\n");

	else if(a == 7 && b == 5 && c == 5) printf("YES\n");

	else if(a == 5 && b == 5 && c == 7) printf("YES\n");

	else printf("NO\n");

	return 0;

}

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

#include<map>

#include<cmath>

#include<ctime>

#include<queue>

#include<stack>

#include<cstdio>

#include<string>

#include<vector>

#include<cstdlib>

#include<cstring>

#include<iomanip>

#include<iostream>

#include<algorithm>

#define fi first

#define se second

#define pb push_back

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

#define PII  pair<int, int> 

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

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

typedef long long ll;

const int inf = 0x3f3f3f3f;

const ll mod = 12345678910;

const int maxn = (int)1e5 + 5;

using namespace std;



int main()

{

	int a[5];

	cin >> a[0] >> a[1] >> a[2];

	sort(a, a + 3);

	if(a[0] == 5 && a[1] == 5 && a[2] == 7) puts("YES");

	else puts("NO");

	return 0;

}

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

#include <cmath>





int main(){

	/*

	+ - 

	* / %

	=

	==  !=    <     >    <=    >=  

	double eps = 1e-8; 

	double x = 0.1, y = 0.2;

	fabs(x - y) < eps

	abs()

	if(x == y) printf("aa");

	*/

	/*

	位运算符



	&

	|

	^





	*/



	/*

	1 & 1 = 1

	1 & 0 = 0

	0 & 1 = 0

	0 & 0 = 0



	1 | 1 = 1

	1 | 0 = 1

	0 | 1 = 1

	0 | 0 = 0



	1 ^ 1 = 0

	1 ^ 0 = 1

	0 ^ 1 = 1

	0 ^ 0 = 0

	*/



	/*

   int n = 0;

   scanf("%d", &n);

   if((n & 1) == 1) printf("%d是奇数\n", n);

   else printf("%d是偶数\n", n);

	 */



	 /*

		 &&      || 

	 */

	int a, b, c;

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

	if(a == 5 && b == 7 && c == 5) printf("YES\n");

	else if(a == 7 && b == 5 && c == 5) printf("YES\n");

	else if(a == 5 && b == 5 && c == 7) printf("YES\n");

	else printf("NO\n");

	return 0;

}

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

using namespace std;

int main()

{

	int A,B,C;

	while(cin>>A>>B>>C)

	{

		if(A==5 && B==5 && C==7||A==5 && B==7 && C==5||A==7 && B==5 && C==5)

			cout<<"YES"<<endl;

		else

			cout<<"NO"<<endl;

	}

	return 0;

}

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

int main()

{

	int a,b,c;

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

	if(a==5&&b==5&&c==7)

	printf("YES");

	else if(a==5&&b==7&&c==5)

	printf("YES");

	else if(a==7&&b==5&&c==5)

	printf("YES");

	else 

	printf("NO");

	return 0;

 } 

// Fastest known solution for this problem: