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

#define maxn 109

#define maxm 1009

using namespace std;

struct Edge

{

	int v,w,next;

}edge[maxm];

int n,m,tot,head[maxn];

int d[maxn][maxm],inq[maxn][maxm];

inline void addedge(int u,int v,int w)

{

	edge[tot].v=v;

	edge[tot].w=w;

	edge[tot].next=head[u];

	head[u]=tot++;

}

queue<pair<int,int> >Q;

void spfa()

{

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

	d[1][0]=0;

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

	pair<int,int>tmp;

	while(!Q.empty())

	{

		tmp=Q.front();

		Q.pop();

		int x=tmp.first;

		int y=tmp.second;

		inq[x][y]=0;

		for(int e=head[x];e!=-1;e=edge[e].next)

		{

			int v=edge[e].v;

			if(y<m&&d[v][y+1]>d[x][y])

			{

				d[v][y+1]=d[x][y];

				if(!inq[v][y+1])

				{

					inq[v][y+1]=1;

					Q.push(make_pair(v,y+1));

				}

			}

			if(d[v][y]>d[x][y]+edge[e].w)

			{

				d[v][y]=d[x][y]+edge[e].w;

				if(!inq[v][y])

				{

					inq[v][y]=1;

					Q.push(make_pair(v,y));

				}

			}

		}

	}

}

int main()

{

	int u,v,w,c;

	while(scanf("%d%d%d",&n,&m,&c),n+m+c)

	{

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

		tot=0;

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

		{

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

			addedge(u,v,w);

		}

		spfa();

		int ans=m;

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

		{

			if(d[n][i]<=c)

			{

				ans=i;

				break;

			}

		}

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

	}

	return 0;

}

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

using namespace std;

const int MAXN=105;

const int INF=0x3f3f3f3f;

bool vis[MAXN];

int a[MAXN][MAXN], dp[MAXN][MAXN];

queue<int> Q;

void spfa(int s,int n){

    memset(vis,0,sizeof vis);

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

    Q.push(s);

    dp[1][0]=0;

    vis[s]=true;

    while(!Q.empty()){

        int u=Q.front(); Q.pop();

        vis[u]=false;

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

            if(a[u][i]!=-1){

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

                    if(dp[u][j]+a[u][i]<dp[i][j]){

                        dp[i][j]=dp[u][j]+a[u][i];

                        if(!vis[i]){

                            Q.push(i); vis[i]=true;

                        }

                    }

                    if(j&&dp[i][j]>dp[u][j-1]){

                        dp[i][j]=dp[u][j-1];

                        if(!vis[i]){

                            Q.push(i); vis[i]=true;

                        }

                    }

                }

            }

        }

    }

}

int main(){

    int n, m, c, x, y, w;

    while(cin>>n>>m>>c&&n){

        memset(a,-1,sizeof a);

        memset(dp,0x3f,sizeof dp);

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

            cin>>x>>y>>w;

            a[x][y]=w;

        }

        spfa(1,n);

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

            if(dp[n][i]<=c){

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

                goto next;

            }

        }

        next:;

    }

    return 0;

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

#include <cstring>

#include <queue>

#include <utility>

using std::queue;

using std::pair;

using std::make_pair;



const int N = 100 + 10;

const int M = 1000 + 10;



int cap[N][N], n, m, C;

int dis[N][M];

bool vis[N][M];

typedef pair<int, int> pir;

queue<pir> Q;



int solve()

{

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

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

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

	vis[1][0] = 1; dis[1][0] = 0;

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

	while(!Q.empty())

	{

		pir tmp = Q.front(); Q.pop();

		int i = tmp.first, k = tmp.second;

		vis[i][k] = 0;

		for(int j = 1; j <= n; j++) if(cap[i][j] != 0x3f3f3f3f)

		{

			if(dis[i][k] + cap[i][j] < dis[j][k])

			{

				dis[j][k] = dis[i][k] + cap[i][j];

				if(!vis[j][k])

				{

					Q.push(make_pair(j, k));

					vis[j][k] = 1;

				}

			}

			if(k < m && dis[i][k] + 0 < dis[j][k+1])

			{

				dis[j][k+1] = dis[i][k] + 0;

				if(!vis[j][k+1])

				{

					Q.push(make_pair(j, k+1));

					vis[j][k+1] = 1;

				}

			}

		}

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

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

	//		printf("%d ", dis[j][0]); puts("");

	}

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

		if(dis[n][i] <= C) return i;

}



int main()

{

	while(scanf("%d%d%d", &n, &m, &C) == 3 && (n||m||C))

	{

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

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

		{

			int x, y, z;

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

			if(cap[x][y] > z) cap[x][y] = z;

		}

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

	}

	return 0;

}

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

using namespace std;

const int MAXN=105;

const int INF=0x3f3f3f3f;

bool vis[MAXN];

int a[MAXN][MAXN], dp[MAXN][MAXN];

queue<int> Q;

void spfa(int s,int n){

    memset(vis,0,sizeof vis);

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

    Q.push(s);

    dp[1][0]=0;

    vis[s]=true;

    while(!Q.empty()){

        int u=Q.front(); Q.pop();

        vis[u]=false;

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

            if(a[u][i]!=-1){

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

                    if(dp[u][j]+a[u][i]<dp[i][j]){

                        dp[i][j]=dp[u][j]+a[u][i];

                        if(!vis[i]){

                            Q.push(i); vis[i]=true;

                        }

                    }

                    if(j&&dp[i][j]>dp[u][j-1]){

                        dp[i][j]=dp[u][j-1];

                        if(!vis[i]){

                            Q.push(i); vis[i]=true;

                        }

                    }

                }

            }

        }

    }

}

int main(){

    int n, m, c, x, y, w;

    while(cin>>n>>m>>c&&n){

        memset(a,-1,sizeof a);

        memset(dp,0x3f,sizeof dp);

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

            cin>>x>>y>>w;

            a[x][y]=w;

        }

        spfa(1,n);

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

            if(dp[n][i]<=c){

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

                goto next;

            }

        }

        next:;

    }

    return 0;

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



using namespace std;



const int INF = 1001001001;



struct Edge {

	int to, cost, cost2;

	Edge(int to, int cost, int cost2 = 0) : to(to), cost(cost), cost2(cost2){}

	Edge(){}

	bool operator > (const Edge &a) const {

		return (cost > a.cost);

	}

};



int main()

{

	int n, m, c;



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

		vector<Edge> G[128];



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

			int f, t, cst;

			scanf("%d %d %d", &f, &t, &cst);

			G[f - 1].push_back(Edge(t - 1, cst));

		}



		bool vis[128][1024];

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



		priority_queue< Edge, vector<Edge>, greater<Edge> > pq;

		pq.push(Edge(0, 0));



		int ans = m;

		while (pq.size()){

			Edge e = pq.top(); pq.pop();

			if (vis[e.to][e.cost2]) continue;

			vis[e.to][e.cost2] = true;



			if (e.to == n - 1){

				ans = min(ans, e.cost2);

				continue;

			}



			for (int i = 0; i < G[e.to].size(); i++){

				Edge nxt = G[e.to][i];

				if (e.cost + nxt.cost <= c && !vis[nxt.to][e.cost2]) pq.push(Edge(nxt.to, e.cost + nxt.cost, e.cost2));

				if (e.cost2 < m && !vis[nxt.to][e.cost2 + 1]) pq.push(Edge(nxt.to, e.cost, e.cost2 + 1));

			}

		}



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

	}



	return (0);

}

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



using namespace std;



const int INF = 1001001001;



struct Edge {

	int to, cost, cost2;

	Edge(int to, int cost, int cost2 = 0) : to(to), cost(cost), cost2(cost2){}

	Edge(){}

	bool operator > (const Edge &a) const {

		return (cost > a.cost);

	}

};



int main()

{

	int n, m, c;



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

		vector<Edge> G[128];



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

			int f, t, cst;

			scanf("%d %d %d", &f, &t, &cst);

			G[f - 1].push_back(Edge(t - 1, cst));

		}



		bool vis[128][128];

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



		priority_queue< Edge, vector<Edge>, greater<Edge> > pq;

		pq.push(Edge(0, 0));



		int ans = n;

		while (pq.size()){

			Edge e = pq.top(); pq.pop();

			if (vis[e.to][e.cost2]) continue;

			vis[e.to][e.cost2] = true;



			if (e.to == n - 1){

				ans = min(ans, e.cost2);

				continue;

			}



			for (int i = 0; i < G[e.to].size(); i++){

				Edge nxt = G[e.to][i];

				if (e.cost + nxt.cost <= c && !vis[nxt.to][e.cost2]) pq.push(Edge(nxt.to, e.cost + nxt.cost, e.cost2));

				if (e.cost2 < n && !vis[nxt.to][e.cost2 + 1]) pq.push(Edge(nxt.to, e.cost, e.cost2 + 1));

			}

		}



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

	}



	return (0);

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

#include <string.h>

#include <algorithm>

using namespace std;

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

#define INF (1<<28)



int N, M, C, u[2000], v[2000];

int g[128][128], dp[1024][128];



int main() {

    for(;;) {

        scanf("%d%d%d", &N, &M, &C);

        if(N==0) return 0;

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

        rep(i, N) g[i][i] = 0;

        rep(i, M) {

            int w;

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

            u[i]--, v[i]--;

            g[u[i]][v[i]] = w;

        }

        rep(k, N) rep(i, N) if(g[i][k]!=-1) rep(j, N) if(g[k][j]!=-1) {

            if(g[i][j]==-1 || g[i][j]>g[i][k]+g[k][j]) g[i][j]=g[i][k]+g[k][j];

        }

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

        rep(i, N) dp[0][i] = g[0][i];

        rep(k, M+1) {

            if(dp[k][N-1]<=C) {

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

                break;

            }

            rep(i, M) if(dp[k][u[i]]!=-1) rep(j, N) if(g[v[i]][j]!=-1) {

                if(dp[k+1][j]==-1 || dp[k+1][j]>dp[k][u[i]]+g[v[i]][j]) {

                    dp[k+1][j] = dp[k][u[i]]+g[v[i]][j];

                }

            }

        }

    }

}

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

#include <string.h>

#include <algorithm>

using namespace std;

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

#define INF (1<<28)



int N, M, C, u[2000], v[2000];

int g[128][128], dp[2][128];



int main() {

    for(;;) {

        scanf("%d%d%d", &N, &M, &C);

        if(N==0) return 0;

        rep(i, N) rep(j, N) g[i][j] = i==j ? 0 : INF;

        rep(i, M) {

            int w;

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

            u[i]--, v[i]--;

            g[u[i]][v[i]] = w;

        }

        rep(k, N) rep(i, N) rep(j, N) g[i][j] = min(g[i][j], g[i][k]+g[k][j]);

        int *cur = dp[0], *nxt = dp[1];

        rep(i, N) cur[i] = g[0][i];

        rep(e, M+1) {

            if(cur[N-1]<=C) {

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

                break;

            }

            rep(i, N) nxt[i] = cur[i];

            rep(i, M) rep(j, N) nxt[j] = min(nxt[j], cur[u[i]]+g[v[i]][j]);

            swap(cur, nxt);

        }

    }

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

using namespace std;

#define int long long

typedef pair<int,int> P;

struct st{

  int v,s,d;

  st(){}

  st(int v,int s,int d):v(v),s(s),d(d){}

  bool operator<(const st a)const{

    return d>a.d;

  }

};

int dp[111][111];

signed main(){

  int n,m,c;

  while(cin>>n>>m>>c,n||m||c){

    //cout<<n<<" "<<m<<" "<<c<<endl;;

    vector<P> G[n];

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

      int u,v,d;

      cin>>u>>v>>d;

      u--;v--;

      G[u].emplace_back(v,d);

      //G[v].emplace_back(u,d);

    }

    int INF=1LL<<55LL;

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

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

	dp[i][j]=INF;

    priority_queue<st> q;

    dp[0][0]=0;

    q.emplace(0,0,0);

    while(!q.empty()){

      st p=q.top();q.pop();

      int v=p.v,s=p.s,d=p.d;

      if(dp[v][s]<d) continue;

      //cout<<v<<" "<<s<<":"<<d<<endl;

      for(P e:G[v]){

	{

	  int nv=e.first,ns=s,nd=d+e.second;

	  if(dp[nv][ns]>nd){

	    dp[nv][ns]=nd;

	    q.emplace(nv,ns,nd);

	  }

	}

	if(s<n){

	  int nv=e.first,ns=s+1,nd=d;

	  if(dp[nv][ns]>nd){

	    dp[nv][ns]=nd;

	    q.emplace(nv,ns,nd);

	  }

	}

      }

    }

    int ans=n;

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

      //cout<<i<<":"<<dp[n-1][i]<<endl;

      if(dp[n-1][i]<=c){

	ans=i;

	break;

      }

    }

    cout<<ans<<endl;

  }

  return 0;

}

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

using namespace std;

using Int = long long;

template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}

template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}



//INSERT ABOVE HERE

signed main(){

  int n,m,c;

  while(cin>>n>>m>>c,n){

    using P = pair<int, int>;

    vector< vector<P> > G(n);

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

      int u,v,w;

      cin>>u>>v>>w;

      u--;v--;

      G[u].emplace_back(v,w);

    }



    using PP = pair<int, P>;

    priority_queue<PP, vector<PP>, greater<PP> > pq;

    const int INF = 1e9;

    vector< vector<int> > dist(n+1,vector<int>(n,INF));

    dist[0][0]=0;

    pq.emplace(dist[0][0],P(0,0));



    while(!pq.empty()){

      int d=pq.top().first;

      int x,v;

      tie(x,v)=pq.top().second;

      pq.pop();

      if(dist[x][v]<d) continue;



      for(auto e:G[v]){

        int y=x,u=e.first,w=e.second;

        if(dist[y][u]<=dist[x][v]+w) continue;

        dist[y][u]=dist[x][v]+w;

        pq.emplace(dist[y][u],P(y,u));

      }



      if(x==n) continue;

      for(auto e:G[v]){

        int y=x+1,u=e.first,w=0;

        if(dist[y][u]<=dist[x][v]+w) continue;

        dist[y][u]=dist[x][v]+w;

        pq.emplace(dist[y][u],P(y,u));

      }

    }



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

      if(dist[i][n-1]<=c){

        cout<<i<<endl;

        break;

      }

    }

  }

  return 0;

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

#include <algorithm>

using namespace std;

int main()

{

	long long s = 0, i;

	string x;

	cin >> x;

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

	{

		s += (x[i] - '0');

		s %= 9;

	}

	if (s % 9 == 0)

		cout << "Yes";

	else

		cout << "No";

}

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

#include <string.h>

int main()

{

	char s[1000000];

	long long int i, j, p = 0, a, k;

 scanf("%s",s);

	a = strlen(s);//printf("%d",a);

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

	{

		p = p + (s[i] - '0');

		p = p % 9;

	}

	if (p % 9 == 0)

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

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

#include<cstring>

#include<iostream>

#include<queue>

#include<map>

#include<cstdlib>

#include<stack>

#include<algorithm>

#include<set>

#include<cmath>

#include<vector>

using namespace std;

int main()

{

	#ifdef local

	freopen("1.txt","r",stdin);

	#endif

	int i,n,a[100005];

	scanf("%d",&n);

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

	int ans=0,now=0;

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

	{

		if(a[i]>=a[i+1])now++;

		else

		{

			ans=max(ans,now);

			now=0;

		}

	}

	ans=max(now,ans);

	printf("%d",ans);

}

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



# include<malloc.h>



void sort(int *, int len);



int main(void)

{

	int len;

	int * pArr;

	int i, j = 0;

	//int a[100000] = {0};

	int sum1 = 0;

	int sum2 = 0;

	//int *p = (int *)malloc(int len)

		//malloc() the return is"void *"也叫干地址

	scanf("%d", &len);

	pArr = (int *)malloc(sizeof(int)*len);;

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

	{

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

	}

	

	for(i=0; i<len-1; ++i)

	{

		if(pArr[i]>=pArr[i+1])

		{

			sum1 += 1;

			//a[j] += 1;

		}

		if(pArr[i]<pArr[i+1])

		{

			if(sum1>sum2)

			{

				sum2 = sum1;

			}

			

			sum1 = 0;

			

				//j++;

		}

	}



	if(sum1>sum2)

			{

				sum2 = sum1;

			}



	printf("%d", sum2);

	//sort(a, j+1);



	return 0;

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

#include <vector>



using namespace std;



int main() {



    int N;

    int current = 0;

    int largest = 0;

    vector < int > h;

    cin >> N;



    h.push_back(0);

    cin >> h[0];



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



        h.push_back(0);

        cin >> h[i];

        if (h[i-1] >= h[i]) current++;

        else {



            if (current > largest) largest = current;

            current = 0;

        } 

    }



    cout << max(largest, current) << endl;

    return 0;

}

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



# include<malloc.h>



void sort(int *, int len);



int main(void)

{

	int len;

	int * pArr;

	int i, j = 0;

	//int a[100000] = {0};

	int sum1 = 0;

	int sum2 = 0;

	//int *p = (int *)malloc(int len)

		//malloc() the return is"void *"也叫干地址

	scanf("%d", &len);

	pArr = (int *)malloc(sizeof(int)*len);;

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

	{

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

	}

	

	for(i=0; i<len-1; ++i)

	{

		if(pArr[i]>=pArr[i+1])

		{

			sum1 += 1;

			//a[j] += 1;

		}

		if(pArr[i]<pArr[i+1])

		{

			if(sum1>sum2)

			{

				sum2 = sum1;

			}

			

			sum1 = 0;

			

				//j++;

		}

	}



	if(sum1>sum2)

			{

				sum2 = sum1;

			}



	printf("%d", sum2);

	//sort(a, j+1);



	return 0;

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

#include<cstring>

#include<iostream>

#include<queue>

#include<map>

#include<cstdlib>

#include<stack>

#include<algorithm>

#include<set>

#include<cmath>

#include<vector>

using namespace std;

int main()

{

	#ifdef local

	freopen("1.txt","r",stdin);

	#endif

	int i,n,a[100005];

	scanf("%d",&n);

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

	int ans=0,now=0;

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

	{

		if(a[i]>=a[i+1])now++;

		else

		{

			ans=max(ans,now);

			now=0;

		}

	}

	ans=max(now,ans);

	printf("%d",ans);

}

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



int main()

{

    long long int n;

    long long int h[100000];

    scanf("%lld",&n);

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

    {

        scanf("%lld",&h[i]);

    }

    int sum = 0;

    int num = 0;

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

    {

        if(h[i] >= h[i + 1])

            sum ++ ;

        else

        {

            if(sum >= num)

                num = sum;

            sum = 0;

        }

    }

    if(sum >= num)

        num = sum;

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

    return 0;

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

#include <vector>



using namespace std;



int main() {



    int N;

    int current = 0;

    int largest = 0;

    vector < int > h;

    cin >> N;



    h.push_back(0);

    cin >> h[0];



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



        h.push_back(0);

        cin >> h[i];

        if (h[i-1] >= h[i]) current++;

        else {



            if (current > largest) largest = current;

            current = 0;

        } 

    }



    cout << max(largest, current) << endl;

    return 0;

}

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



int main()

{

    long long int n;

    long long int h[100000];

    scanf("%lld",&n);

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

    {

        scanf("%lld",&h[i]);

    }

    int sum = 0;

    int num = 0;

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

    {

        if(h[i] >= h[i + 1])

            sum ++ ;

        else

        {

            if(sum >= num)

                num = sum;

            sum = 0;

        }

    }

    if(sum >= num)

        num = sum;

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

    return 0;

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

#include<cstdio>

using namespace std;

const int N=1E5+7;

int arr[N];

int main()

{

	int n;

	cin>>n;

	for(int i=1;i<=n;i++)	cin>>arr[i];

	int ans=0;

	int sum=0;

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

		if(arr[i]>=arr[i+1]) ans++;

		else ans=0;

		sum=max(ans,sum);

	}

	cout<<sum<<endl;

	return 0;

}


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



int main()

{

    long long int n;

    long long int h[100000];

    scanf("%lld",&n);

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

    {

        scanf("%lld",&h[i]);

    }

    int sum = 0;

    int num = 0;

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

    {

        if(h[i] >= h[i + 1])

            sum ++ ;

        else

        {

            if(sum >= num)

                num = sum;

            sum = 0;

        }

    }

    if(sum >= num)

        num = sum;

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

    return 0;

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

//#include<iostream>

//#include<cmath>

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

typedef long long ll;

using namespace std;

const int inf=0x3f3f3f3f;

const ll INF=0x3f3f3f3f3f3f3f3f;

const int N=1e5+10;

void io(){

	ios::sync_with_stdio(0);

	cin.tie(0);

	cout.tie(0);

}

int main()

{

	io();

	int n,a,b;cin>>n;

	ll ans=0;cin>>b;

	ll anss=0;

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

		cin>>a;

		if(b>=a)ans++;

		else ans=0;

		if(ans>anss)anss=ans;

		b=a; 

	}

	cout<<anss<<endl;

	return 0;

}

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



int main()

{

    long long int n;

    long long int h[100000];

    scanf("%lld",&n);

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

    {

        scanf("%lld",&h[i]);

    }

    int sum = 0;

    int num = 0;

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

    {

        if(h[i] >= h[i + 1])

            sum ++ ;

        else

        {

            if(sum >= num)

                num = sum;

            sum = 0;

        }

    }

    if(sum >= num)

        num = sum;

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

    return 0;

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

using namespace std;

#define Nmax 100000



int main()

{

	int n = 0;

	int h[Nmax] = { 0 };



	cin >> n;

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

		cin >> h[i];

	}



	int cnt = 0;

	int maxcnt = 0;

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

		if (h[i] >= h[i + 1]) {

			cnt++;

		}

		else {

			cnt = 0;

		}

		if (cnt >= maxcnt) {

			maxcnt = cnt;

		}

	}



	cout << maxcnt << "\n";



	return 0;

}

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

#include <vector>

using namespace std;



int main()

{

	int n;

	cin >> n;

	vector<int> h;

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

		int tmp;

		cin >> tmp;

		h.push_back(tmp);

	}

	int cntmax = 0;

	int cnt = 0;



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

		if (h[i] >= h[i + 1]) {

			cnt++;

		}

		else

		{

			if (cnt > cntmax) {

				cntmax = cnt;

			}

			cnt = 0;

		}

	}

	if (cnt > cntmax) {

		cntmax = cnt;

	}

	cout << cntmax << endl;

	return 0;

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

#include <bits/stdc++.h>

using namespace std;

int b[100006] ={0};

int main()

{

    int n,a[100006],mx=0,cnt=0,sum=0,k=0,no=0;

    cin>>n;

    memset(b,0,sizeof(b));

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

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

    }



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

        if(a[i-1]>=a[i]){

            no=b[k];

            no++;

            b[k]=no;

        }else{

            k++;

            no=0;

           

        }

    }

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

        if(mx<b[j]){

            mx=b[j];

        }

    }

    cout<<mx<<endl;

   





    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.4105882439744069x):


/*|In The Name Of Allah|*/



#include <bits/stdc++.h>



using namespace std;



const int N = 1e5+5;



const int mod = 1e9+7;



int n;

int a[N];

int dp[N];



int main(){

    cin >> n;

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

        cin >> a[i];

        dp[i] = 0;

    }

    int mx = 0;

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

        if(a[i - 1] >= a[i]){

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

        }

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

    }

    cout << mx << endl;

}