/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
//import java.lang.math.*;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
public static int Solve(int[] arr)
{
int sp = arr[0];
int m = 0;
int peak = 0;
int i = 0;
boolean goingUp = false;
int peakStart = 0;
while (i < arr.length-1)
{
if ((!goingUp && sp >= arr[i+1]) || (goingUp && sp <= arr[i+1]))
{
if (goingUp && sp < arr[i + 1])
{
peakStart = i + 1;
}
sp = arr[i + 1];
i++;
}
else if (!goingUp)
{
goingUp = true;
}
else if (goingUp)
{
// distance between the current peak and previous peak.
int distance = i - peak;
// save max
m =
math.
max(m, distance
);
if (i != peakStart)
{
peak = peakStart;
}
else
{
peak = i;
}
// reached peak so that means the next step is to walk down the slope.
goingUp = false;
}
}
// final calculation as the last location in the histogram is the final peak.
int d = i - peak;
return (m+1);
}
{
// your code goes here
int ar[]={1,1};
system.
out.
println(Solve
(ar
));
}
}