stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#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;

}

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

#include<vector>

#include<iostream>

#include<map>

#include<queue>

#include<algorithm>

#include<cstring>

#include<cmath>

#define eps 1e-10

#define inf 100000000

using namespace std;

int n,m,c;

struct node

{

    int t,cost;

    node(int t=0,int cost=0):t(t),cost(cost) {}

};

vector<node> G[105];

int d[105][105];

void spfa()

{

    queue<pair<int,int> > q;

    bool vis[105][105];

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

    for(int j=0;j<=n;j++) d[i][j]=inf;

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

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

    while(!q.empty())

    {

        pair<int,int> p=q.front();q.pop();

        int x=p.first,y=p.second;

        vis[x][y]=0;

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

        {

            int v=G[x][i].t,co=G[x][i].cost;

            if(d[v][y]>d[x][y]+co)

            {

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

                if(!vis[v][y])

                {

                    vis[v][y]=1;

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

                }

            }

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

            {

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

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

                {

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

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

                }

            }

        }



    }

}

main()

{

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

    {

        memset(G,0,sizeof(G));

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

        {

            int s,t,c;

            scanf("%d%d%d",&s,&t,&c);

            G[s].push_back(node(t,c));

        }

        spfa();

        int ans;

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

        if(d[n][j]<=c) {ans=j;break;}

        cout<<ans<<endl;

    }

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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);

}

// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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];

                }

            }

        }

    }

}

// Optimized solution to the same problem (faster):
#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);

        }

    }

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#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";

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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);

}

// Optimized solution to the same problem (faster):
# 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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
# 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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

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

using namespace std;

const int N=1e5+5;

int A[N],n,cnt,mx,mn;

int main(){

    scanf("%d",&n);

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

        scanf("%d",A+i);

    mn=A[0];

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

        if(A[i]<=mn){

            mx=max(++cnt,mx);

            mn=A[i];

        }else{

        cnt=0;

        mn=A[i];

        }

    }

    printf("%d",mx);





    return 0;

}


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

#include<algorithm>

#include<cmath>

#include<iomanip>

#include<map>

using namespace std;

int main() {

  long long n,a[100000]={},ans=0,cnt=0;

  cin >> n;

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

    cin >> a[i];

  }

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

    if(a[i+1]<=a[i]) {

      cnt++;

      ans=max(ans,cnt);

    }

    else {

      cnt=0;

    }

  }

  cout << ans << endl;

}


// Optimized solution to the same problem (faster):
//   _/                _/                 _/_/_/   _/

//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/

// _/     _/    _/   _/     _/    _/  _/_/_/     _/

//_/     _/    _/   _/     _/    _/  _/    _/   _/

// _/_/   _/_/       _/_/   _/_/      _/_/     _/

#include<iostream>

#include<algorithm>

#include<cmath>

#include<iomanip>

#include<set>

#include<map>

#include<queue>

#include<vector>

using namespace std;

typedef long long ll;

const int MOD=1e9+7;

const double pi=3.14159265358979323846;

const int inf=2e9;

const ll INF=9e18;

typedef pair<int,int> P;

int main() {

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

  ios::sync_with_stdio(false);

  int n,h[100005]={},cnt=0,ans=0;

  cin >> n;

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

    cin >> h[i];

  }

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

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

      cnt++;

      ans=max(ans,cnt);

    }

    else {

      cnt=0;

    }

  }

  cout << ans << endl;

}

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

#include <iostream>

#include <vector>



using namespace std;



int main(void) {

  int N;

  cin >> N;

  vector<int> H(N);

  for (auto& v : H) {

    cin >> v;

  }



  int ans = 0;

  int cnt = 0;

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

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

      cnt++;

      ans = max(ans, cnt);

    } else {

      cnt = 0;

    }

  }

  cout << ans << endl;

}


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



int H[100000];



int main(void) {

  int N;

  scanf("%d", &N);

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

    scanf("%d", H + i);

  }



  int ans = 0;

  int cnt = 0;

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

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

      cnt++;

      if (ans < cnt)

        ans = cnt;

    } else {

      cnt = 0;

    }

  }

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

}


// Fastest known solution for this problem: