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

#include <iostream>

#include <algorithm>

#include <cstring>

#include <queue>

#define MN 301000

#define MM 1601000



typedef std::pair<int, int> P;

int h[MN], nxt[MM], to[MM], cost[MM], K = 0;

std::vector<P> v[101000];

int d[MN], n, m;

std::deque<int> q;



void ins(int u, int v, int c) {nxt[++K] = h[u]; h[u] = K; to[K] = v; cost[K] = c;}



int bfs()

{

	q.push_back(1);

	memset(d, 0x3f, sizeof(d)); d[1] = 0;

	while(!q.empty())

	{

		int u = q.front(); q.pop_front();

		for(int i = h[u]; i; i = nxt[i])

		{

			if(d[to[i]] > d[u] + cost[i])

			{

				d[to[i]] = d[u] + cost[i];

				if(cost[i]) q.push_back(to[i]);

				else q.push_front(to[i]);

			}

		}

	}

	if(d[n] > 1e9) return -1;

	return d[n];

}



int main()

{

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

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

	{

		int p, q, c; scanf("%d%d%d", &p, &q, &c);

		v[p].push_back(P(c, i));

		v[q].push_back(P(c, i));

		ins(p, n + i, 1); ins(n + i, p, 0);

		ins(q, n + i, 1); ins(n + i, q, 0);

	}

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

	{

		std::sort(v[i].begin(), v[i].end());

		int S = v[i].size();

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

		{

			if(v[i][j].first == v[i][j - 1].first)

			{

				ins(v[i][j].second + n, v[i][j - 1].second + n, 0);

				ins(v[i][j - 1].second + n, v[i][j].second + n, 0); 

			}

		}

	}

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

}

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

#include <algorithm>

#include <map>

#include <iostream> 

#include <queue>

#include <cstring>

#define INF 0x3f3f3f3f



const int MAXN = 1e5 + 1, MAXM = 2e5 + 1;



int n, m;



struct Edge { int ver, nxt, val; } edge[MAXM << 3];

int head[MAXN << 3], tot = 0;

inline void Ins(int x, int y, int z) { edge[++tot].ver = y, edge[tot].val = z, edge[tot].nxt = head[x], head[x] = tot; }



std :: map<std :: pair<int, int>, int> ex;

int cnt;

#define mp std :: make_pair

inline int id(int x, int num) { return ex[mp(x, num)] ? ex[mp(x, num)] : ex[mp(x, num)] = ++cnt; }



std :: deque<int> q; int d[MAXN << 3];

void BFS() {

    memset(d, 0x3f, sizeof d);

    d[1] = 0; q.push_front(1);

    while (q.size()) {

        int x = q.front(); q.pop_front();

        for (int i = head[x]; i; i = edge[i].nxt) {

            int y = edge[i].ver, z = edge[i].val;

            if (d[y] > d[x] + z) {

                d[y] = d[x] + z;

                !z ? q.push_front(y) : q.push_back(y);

            }

        }

    }

}



int main() {

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

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

        int u, v, w; scanf("%d%d%d", &u, &v, &w);

        int p = id(u, w), q = id(v, w);

        Ins(u, p, 1), Ins(q, v, 1), Ins(p, q, 0);

        Ins(p, u, 1), Ins(v, q, 1), Ins(q, p, 0);

    }

    BFS();

    printf("%d\n", d[n] == INF ? -1 : d[n] >> 1);

    return 0;

}

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

#include <cstring>

#include <queue>

#include <set>

#include <algorithm>

using namespace std;

const int inf=1<<29;

const int maxn=1e5+10;

const int maxm=2e5+10;

int n,m,cnt;

int head[maxn];

struct Edge

{

    int v,c,nx;

}edge[maxm<<1];

struct Node

{

    int v,w;

    bool operator <(const Node&n1) const {

        return w==n1.w?v<n1.v:w<n1.w;

    }

};

int dis[maxn];

bool vis[maxn];

set<int> col[maxn];



void _init() {

    cnt=0;

    memset(head,-1,sizeof(head));

}



inline void add(int u,int v,int c) {

    edge[cnt].v=v; edge[cnt].c=c;

    edge[cnt].nx=head[u];

    head[u]=cnt++;

    edge[cnt].v=u; edge[cnt].c=c;

    edge[cnt].nx=head[v];

    head[v]=cnt++;

}



void bfs() {

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

    for (int i=1;i<=n;i++) col[i].clear();

    for (int i=1;i<=n;i++) dis[i]=inf;

    dis[1]=0;

    priority_queue<Node> q;

    q.push(Node{1,0});

    while (!q.empty()) {

        Node t=q.top(); q.pop();

        int u=t.v;

        if (vis[u]) continue;

        vis[u]=1;

        for (int i=head[u];i!=-1;i=edge[i].nx) {

            int v=edge[i].v;

            int w=col[u].count(edge[i].c)?0:1;

            if (dis[v]>dis[u]+w) {

                dis[v]=dis[u]+w;

                col[v].clear();

                col[v].insert(edge[i].c);

                q.push(Node{v,-dis[v]});

            } else if (dis[v]==dis[u]+w) {

                col[v].insert(edge[i].c);

            }

        }

    }

}



int main() {

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

        _init();

        int u,v,c;

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

            scanf("%d%d%d",&u,&v,&c);

            add(u,v,c);

        }

        bfs();

        printf("%d\n", dis[n]==inf?-1:dis[n]);

    }

    return 0;

}


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

#include <string.h>

#include <map>

#include <queue>

#define MN 100000

#define MM 200000

int n,m,vn;

int hd[MN*5+5],to[MM*6+5],nxt[MM*6+5],val[MM*6+5];

int dis[MN*5+5];

bool vis[MN*5+5];

void add(int u,int v,int w){

	static int rn=0;

	to[rn]=v,nxt[rn]=hd[u],val[rn]=w;

	hd[u]=rn++;

}

int gid(int u,int c){

	static std::map<int,int> tb[MN+5];

	if(tb[u].find(c)==tb[u].end()){

		tb[u][c]=(++vn);

		add(u,tb[u][c],1);

		add(tb[u][c],u,0);

	}

	return tb[u][c];

}

void bfs01(){

	static std::deque<int> q;

	memset(dis,0x3f,sizeof(dis));

	dis[1]=0; q.push_front(1);

	while(!q.empty()){

		int u=q.front(); q.pop_front();

		if(vis[u]) continue; vis[u]=true;

		for(int i=hd[u];~i;i=nxt[i]){

			if(vis[to[i]]) continue;

			if(dis[u]+val[i]<dis[to[i]]){

				dis[to[i]]=dis[u]+val[i];

				if(val[i]==0)

					q.push_front(to[i]);

				else

					q.push_back(to[i]);

			}

		}

	}

}

int main(){

	memset(hd,0xff,sizeof(hd));

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

	vn=n;

	for(int i=1,u,v,c;i<=m;i++){

		scanf("%d%d%d",&u,&v,&c);

		u=gid(u,c),v=gid(v,c);

		add(u,v,0),add(v,u,0);

	}

	bfs01();

	if(dis[n]==0x3f3f3f3f) puts("-1");

	else printf("%d\n",dis[n]);

}

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

#include <cstdio>

#include <algorithm>

#include <queue>

#include <cstring>

#define N 100002

using namespace std;

struct node{

	int u,v,w;

}e[200002];

struct node1{

	int x,d;

	node1(int _x,int _d){

		x=_x,d=_d;

	}

};

vector<int> id[N];

int head[2000002],ver[2000002],nxt[2000002],edge[2000002],l;

int n,m,i,j,cnt[N],now[N],dis[2000002],num;

bool vis[2000002];

int read()

{

	char c=getchar();

	int w=0;

	while(c<'0'||c>'9') c=getchar();

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

		w=w*10+c-'0';

		c=getchar();

	}

	return w;

}

int my_comp(const node &x,const node &y)

{

	return x.w<y.w;

}

void insert(int x,int y,double z)

{

	l++;

	ver[l]=y;

	edge[l]=z;

	nxt[l]=head[x];

	head[x]=l;

}

int bfs(int s)

{

	deque<node1> q;

	q.push_front(node1(s,0));

	vis[s]=1;

	while(!q.empty()){

		int x=q.front().x,d=q.front().d;

		q.pop_front();

		for(int i=head[x];i;i=nxt[i]){

			int y=ver[i];

			if(!vis[y]){

				vis[y]=1;

				if(y==num+n) return d+edge[i];

				if(edge[i]==1) q.push_back(node1(y,d+1));

				else q.push_front(node1(y,d));

			}

		}

	}

	return -1;

}

int main()

{

	n=read(),m=read();

	for(i=1;i<=m;i++) e[i].u=read(),e[i].v=read(),e[i].w=read();

	sort(e+1,e+m+1,my_comp);

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

		int u=e[i].u,v=e[i].v,w=e[i].w;

		if(now[u]!=w) cnt[u]++,now[u]=w,id[u].push_back(++num);

		if(now[v]!=w) cnt[v]++,now[v]=w,id[v].push_back(++num);

		insert(id[u][cnt[u]-1],id[v][cnt[v]-1],0);

		insert(id[v][cnt[v]-1],id[u][cnt[u]-1],0);

	}

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

		for(j=0;j<cnt[i];j++){

			insert(num+i,id[i][j],1);

			insert(id[i][j],num+i,1);

		}

	}

	int ans=bfs(num+1);

	if(ans==-1) cout<<ans<<endl;

	else cout<<ans/2<<endl;

	return 0;

}


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

using namespace std;

int n,m,num,dis[500010],Link[500010],t=0;

bool vis[500010];

map < pair< int,int >,int> mp;

struct dsa

{

	int v,nex,w;

}e[1200010];

void Insert(int xx,int yy,int zz) 

{

	e[++t].nex=Link[xx];e[t].v=yy;e[t].w=zz;Link[xx]=t;

	e[++t].nex=Link[yy];e[t].v=xx;e[t].w=zz;Link[yy]=t;

}

void Dijkstra()

{

	priority_queue < pair<int,int> > q;

	memset(dis,10,sizeof(dis));

	dis[1]=0;

	q.push(make_pair(0,1));

	while (q.size()) {

		int x=q.top().second;

		q.pop();

		if (vis[x]) continue;

		vis[x]=true;

		for (int i=Link[x];i;i=e[i].nex) 

		  if (dis[x]+e[i].w<dis[e[i].v]) {

		  	  dis[e[i].v]=dis[x]+e[i].w;

		  	  q.push(make_pair(-dis[e[i].v],e[i].v));

		  }

	}

}

int main()

{

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

	num=n;

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

		int xx,yy,zz;

		scanf("%d%d%d",&xx,&yy,&zz);

		if (mp.find(make_pair(xx,zz))==mp.end()) mp[make_pair(xx,zz)]=++num;

		if (mp.find(make_pair(yy,zz))==mp.end()) mp[make_pair(yy,zz)]=++num;

		Insert(mp[make_pair(xx,zz)],mp[make_pair(yy,zz)],0);

		Insert(mp[make_pair(xx,zz)],xx,1);

		Insert(mp[make_pair(yy,zz)],yy,1);

	}

	Dijkstra();

	if (dis[n]==dis[0]) cout<<"-1"<<endl;else cout<<dis[n]/2;

	return 0;

}

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

using namespace std;

int main(){

	int n , cont = 0;

	cin >> n;

	int arreglo[n];

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

		cin >> arreglo[i];

	}

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

		bool cuenta = true;

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

			if(arreglo[j] > arreglo[i]){

			   cuenta = false;

			}

		}

		if(cuenta) cont++;

	}

	cout << cont << endl;

	return 0;

}

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

#include <cmath>

using namespace std;

const int N=205;

int n;

int a[N];

int ans,chk;

int main()

{

	scanf("%d",&n);

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

	{

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

		chk=1;

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

			chk&=(a[j]<=a[i]);

		ans+=chk;

	}

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

	return 0;

}

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

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

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

#define prnt(a) cout << a << endl



typedef long long int ll;



using namespace std;



int main() {

	int n; cin >> n;

	

	int h[n];

	fore(i,0,n) cin >> h[i];

	

	int ans = 0;

	fore(i,0,n) {

		bool s = true;

		

		fore(j,0,i) if (h[j] > h[i]) {

				s = false;

				break;

			}

		

		if (s == true) ans++;

	}

	

	prnt(ans);



	return 0;

}


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

#include <cmath>

using namespace std;

const int N=205;

int n;

int a[N];

int ans,chk;

int main()

{

	scanf("%d",&n);

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

	{

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

		chk=1;

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

			chk&=(a[j]<=a[i]);

		ans+=chk;

	}

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

	return 0;

}

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

#include<algorithm>

#include<iostream>

typedef long long LL;

using namespace std;

int main()

{

	int n,ans,h[200];

	cin>>n;ans=n;

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

	cin>>h[i];

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

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

	{

		if(h[j]>h[i])

		{

			ans--;break;

		}

	}

	cout<<ans;

}


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

#include <cmath>

using namespace std;

const int N=205;

int n;

int a[N];

int ans,chk;

int main()

{

	scanf("%d",&n);

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

	{

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

		chk=1;

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

			chk&=(a[j]<=a[i]);

		ans+=chk;

	}

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

	return 0;

}

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

#include <iostream>

#include <algorithm>

#include <cstring>

#include <map>

#include <vector>

using namespace std;

typedef long long LL;



struct node{

	LL a,b;

}s[200005];

bool cmp(node x,node y){

	if(x.a == 0 && y.a == 0) return x.b < y.b;

	return y.a * (x.b + 1) < x.a * (y.b + 1);

}



LL dp[200005][35];



int main(){

	LL n,T,st,ans = 0;

	cin >> n >> T;

	for(LL i = 1;i <= n;i ++) cin >> s[i].a >> s[i].b;

	st = n + 1; sort(s + 1,s + 1 + n,cmp);

	for(LL i = n;i >= 1;i --) if(s[i].a == 0) st = i;

	

	for(LL i = 0;i <= 31;i ++) dp[0][i] = T + 1;

	dp[0][0] = 0;

	for(LL i = 1;i < st;i ++){

		dp[i][0] = dp[i - 1][0];

		for(LL j = 1;j <= 31;j ++){

			dp[i][j] = min(dp[i - 1][j],(1 + dp[i - 1][j - 1]) * (1 + s[i].a) + s[i].b);

			dp[i][j] = min(dp[i][j],T + 1);

		}

	}

	for(LL j = 0;j <= 31;j ++){

		LL tt = dp[st - 1][j];

		if(tt > T) continue;

		ans = max(ans,j);

		for(LL k = st;k <= n;k ++){

			if(tt + s[k].b + 1 > T) break;

			ans = max(ans,(k - st + j + 1));

			tt += (s[k].b + 1);

		}

	}

	cout << ans << endl;

	return 0;

}

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

#include<cstring>

#include<algorithm>

#define For(i,A,B) for(i=(A);i<=(B);++i)

using namespace std;

typedef long long ll;

const int N=200050;

struct node{

    int a,b;

}a[N];

int b[N],f[35];

ll s[N];

inline bool cmp(const node &a,const node &b){return (ll)a.a*(b.b+1)>(ll)b.a*(a.b+1);}

inline void chkmin(int &a,int b){if(b<a)a=b;}

inline void chkmax(int &a,int b){if(b>a)a=b;}

int main(){

    int n,t,n1=0,n2=0,i,j,k=0,x,y,ans=0;

    ll tp;

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

    For(i,1,n){

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

        if(x){a[++n1].a=x;a[n1].b=y;}

        else b[++n2]=y;

    }

    sort(a+1,a+n1+1,cmp);

    sort(b+1,b+n2+1);

    For(i,1,n2)s[i]=s[i-1]+b[i]+1ll;

    memset(f,0x3f,sizeof(f));

    f[0]=0;

    For(i,1,n1){

        for(j=k;j>=0;--j)if((tp=(ll)(a[i].a+1)*(f[j]+1)+a[i].b)<=(ll)t)chkmin(f[j+1],tp);

        if(f[k+1]<=t)++k;

    }

    For(i,0,k)chkmax(ans,i+upper_bound(s+1,s+n2+1,t-f[i])-s-1);

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

    return 0;

}

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

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

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

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

#define fi first

#define se second

#define pb push_back

#define mp make_pair

using namespace std;

typedef pair<int,int> pii;

typedef vector<int> vi;

typedef long long ll;



const int N=100005;

vi A,B[10],p,q,res;

int n,K;



vi rev(vi a){

	vi b(n+1,0);

	rep(i,1,n)b[a[i]]=i;

	return b;

}



vi mul(vi a,vi b){

	vi c(n+1,0);

	rep(i,1,n)c[i]=a[b[i]];

	return c;

}



vi power(vi a,int p){

	vi res(n+1,0);

	rep(i,1,n)res[i]=i;

	for(;p;p>>=1,a=mul(a,a))

		if(p&1)res=mul(res,a);

	return res;

}



int main(){

	cin>>n>>K;

	p.resize(n+1,0);

	rep(i,1,n)cin>>p[i];

	q.resize(n+1,0);

	rep(i,1,n)cin>>q[i];

	A=power(mul(q,mul(rev(p),mul(rev(q),p))),(K-1)/6);

	if(K%6==4)A=mul(A,q);

	if(K%6==5||K%6==0)A=mul(A,mul(q,rev(p)));

	B[1]=p;

	B[2]=q;

	B[3]=mul(q,rev(p));

	B[4]=rev(p);

	B[5]=rev(q);

	B[6]=mul(rev(q),p);

	res=mul(A,mul(B[(K-1)%6+1],rev(A)));

	rep(i,1,n)printf("%d ",res[i]);

	puts("");

	return 0;

}

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

using namespace std;

#define N 1000700

int n,k,ct,p[N],q[N],rp[N],rq[N],s[N],rs[N],vis[N],st[N],as[N],s1[N];

int main()

{

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

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

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

	if(k==1){for(int i=1;i<=n;i++)printf("%d ",p[i]);return 0;}

	if(k<=6)

	{

		for(int i=3;i<=k;i++)

		{

			for(int j=1;j<=n;j++)s[p[j]]=q[j],p[j]=q[j];

			for(int j=1;j<=n;j++)q[j]=s[j];

		}

		for(int i=1;i<=n;i++)printf("%d ",q[i]);return 0;

	}

	for(int i=1;i<=n;i++)rp[p[i]]=i,rq[q[i]]=i;

	for(int i=1;i<=n;i++)s1[i]=rp[q[p[rq[i]]]];

	for(int i=3;i<=(k-1)%6+7;i++)

	{

		for(int j=1;j<=n;j++)s[p[j]]=q[j],p[j]=q[j];

		for(int j=1;j<=n;j++)q[j]=s[j];

	}

	for(int i=1;i<=n;i++)if(!vis[i])

	{

		ct=0;st[ct=1]=i;vis[i]=1;

		for(int j=s1[i];j!=i;j=s1[j])st[++ct]=j,vis[j]=1;

		for(int j=1;j<=ct;j++)as[st[j]]=st[(j-2+(k-1)/6)%ct+1];

	}

	for(int i=1;i<=n;i++)rs[as[i]]=i;

	for(int i=1;i<=n;i++)printf("%d ",rs[q[as[i]]]);

}//

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

#include <iostream>

using namespace std;



bool comp(int h1, int w1, int h2, int w2) {

	const double d1 = h1 * h1 + w1 * w1, d2 = h2 * h2 + w2 * w2;

	if(d1 != d2)

		return d1 > d2;

	else

		return h1 > h2;

}



int main() {

	cin.tie(0);

	ios::sync_with_stdio(false);



	for(int h, w; cin >> h >> w, h;) {

		int ans_h = 200, ans_w = 200;

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

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

				if(comp(i, j, h, w) && comp(ans_h, ans_w, i, j)) {

					ans_h = i;

					ans_w = j;

				}

			}

		}



		cout << ans_h << " " << ans_w << endl;

	}



	return EXIT_SUCCESS;

}

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

#include <iostream>

using namespace std;



bool comp(int h1, int w1, int h2, int w2) {

	const double d1 = h1 * h1 + w1 * w1, d2 = h2 * h2 + w2 * w2;

	if(d1 != d2)

		return d1 > d2;

	else

		return h1 > h2;

}



int main() {

	cin.tie(0);

	ios::sync_with_stdio(false);



	for(int h, w; cin >> h >> w, h;) {

		int ans_h = 200, ans_w = 200;

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

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

				if(comp(i, j, h, w)) {

					if(comp(ans_h, ans_w, i, j)) {

						ans_h = i;

						ans_w = j;

					}

					break;

				}

			}

		}



		cout << ans_h << " " << ans_w << endl;

	}



	return EXIT_SUCCESS;

}

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



using namespace std;



int a, b, c;



int main() {

	cin >> a >> b >> c;

	if(a + b >= c)

		puts("Yes");

	else

		puts("No");

	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);

	

	int total = a +b ;

	

	if(total < c){

		printf("No\n");

	}else{

		printf("Yes\n");

	}

	

	return 0;

	

}

// 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+b >= c )

	{

		cout << "Yes" << endl ;

		//cout << "He has "<< a << " + " << b << " = " << a+b << " yen, so he can buy the " << c << "-yen toy." ;

	}

	else

	{

		cout << "No" << endl ;

		//cout << "He has "<< a << " + " << b << " = " << a+b << " yen, but he cannot buy the " << c << "-yen toy." ;

	}

	

	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);

	

	int total = a +b ;

	

	if(total < c){

		printf("No\n");

	}else{

		printf("Yes\n");

	}

	

	return 0;

	

}

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

using namespace std;



long long int N, p[364364], id[364364], dp[364364], x, i;



int main(){

    iota(p, p + 364364, 1);

    scanf("%lld", &N);

    for(; i < N; ++i){

        scanf("%lld", p + i);

        id[p[i]] = i;

    }

    dp[N] = 0;

    x = N;

    for(; --i;){

        if(dp[i + 1]){

            dp[i] = dp[i + 1];

            if((id[i] < id[i + 1]) ^ (id[i + 1] < id[x]) ^ (id[x] < id[i])){

                ++dp[i];

                x = i + 1;

            }

        }else{

            dp[i] = dp[i + 1] + ((id[i] > id[i + 1]) ? 1 : 0);

            if(id[i] < id[i + 1])--x;

        }

    }

    cout << dp[1] << endl;

    return 0;

}


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



template<typename ...> static inline int gc(void) { return getchar(); }

static inline void read(int &x){int k,m=0;x=0;for(;;){k=gc();if(48<=k&&k<=57){x=k-48;break;}}for(;;){k=gc();if(k<48||k>57)break;x=x*10+k-48;}}



int N, d[262144], p, x, i;



main(){

    read(N);

    for(; i < N; d[x] = ++i)read(x);

    x = N;

    for(; --i;)

        if(p){

            if((d[i] < d[i + 1]) ^ (d[i + 1] < d[x]) ^ (d[x] < d[i])){

                ++p;

                x = i + 1;

            }

        }else

            if(d[i] < d[i + 1])--x;

            else++p;

    printf("%d", p);

}


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

#include <iostream>

#include <cstring>

#include <queue>

#include <cctype>

#include <algorithm>

#include <cmath>

#include <map>

#include <string>

#include <vector>



using namespace std;

typedef long long ll;



int a[200005],d[200005],ans[200005],f[200005];

int main()

{

    int n,i;

    scanf("%d",&n);

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

    {

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

        d[a[i]]=i;

    }

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

    {

        if(ans[i+1]==0)

        {

            if(d[i]>d[i+1])

            {

                ans[i]=1;

                f[i]=i+1;

            }

        }

        else

        {

            int aa=d[i],bb=d[i+1],cc=d[f[i+1]];

            if((aa<bb&&bb<cc)||(cc<aa&&aa<bb)||(bb<cc&&cc<aa))

            {

                ans[i]=ans[i+1];

                f[i]=f[i+1];

            }

            else

            {

                ans[i]=ans[i+1]+1;

                f[i]=i+1;

            }

        }

    }

    printf("%d\n",ans[1]);

    return 0;

}


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

using namespace std;

typedef long long ll;

int a[200005],d[200005],ans[200005],f[200005];

int main()

{

    int n,i;

    scanf("%d",&n);

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

    {

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

        d[a[i]]=i;

    }

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

    {

        if(ans[i+1]==0)

        {

            if(d[i]>d[i+1])

            {

                ans[i]=1;

                f[i]=i+1;

            }

        }

        else

        {

            int aa=d[i],bb=d[i+1],cc=d[f[i+1]];

            if((aa<bb&&bb<cc)||(cc<aa&&aa<bb)||(bb<cc&&cc<aa))

            {

                ans[i]=ans[i+1];

                f[i]=f[i+1];

            }

            else

            {

                ans[i]=ans[i+1]+1;

                f[i]=i+1;

            }

        }

    }

    printf("%d\n",ans[1]);

    return 0;

}

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

#include <cstdio>

#include <cmath>

#include <cstring>

#include <algorithm>

#include <vector>

#include <map>

#include <cstdlib>

#include <set>

#include <stack>

#include <queue>

using namespace std;



#define X first

#define Y second

#define N 100010

#define M 400010

typedef long long ll;

typedef pair<int,int> pii;

const int Mod=1000000007;



ll Solve(ll x)

{

	if (x<=6) return 1;

	if (x<=11) return 2;

	

	ll ans=x/11*2; x%=11;

	if (x==0) return ans;

	if (x<=6) return ans+1;

	return ans+2;

}



int main()

{

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

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

	

	ll x; 

	cin >> x;

	cout<< Solve(x)<<endl;

	return 0;

}


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

typedef long long ll;

int main(){

  ll x,ans;

  scanf("%lld",&x);

  ans=x/11*2;

  if (x%11!=0)

    if (x%11>6)

      ans+=2;

    else

      ans++;

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

}


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

#include<map>

#include<stack>

#include<queue>

#include<deque>

#include<cmath>

#include<cstdio>

#include<cctype>

#include<string>

#include<vector>

#include<cstdlib>

#include<cstring>

#include<sstream>

#include<iostream>

#include<algorithm>

#define MAXN 100000



using namespace std;

//int a[7][2]={0,0,1,0,2,1,3,1,4,1,5,1,6,2};

int main()

{

	long long x,ans=0;

	cin>>x;

	ans+=x/11*2;

	x%=11;

	if(x>0)

	{

		if(x>6)

			ans++;

		ans++;

	}

	cout<<ans;

	return 0;

}

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

typedef long long ll;

int main(){

  ll x,ans;

  scanf("%lld",&x);

  ans=x/11*2;

  if (x%11!=0)

    if (x%11>6)

      ans+=2;

    else

      ans++;

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

}


// Fastest known solution for this problem: