#include <iostream>
using namespace std;
int main ()
{
	long long j,i,n,x,br=0,p,s1,s=0,br1=0,nd=0;
	cin>>n>>p;
	for (i=2;i<n;i++)
	{
		cin>>x;
		if (x>p)
		{
			if (br==0){
				br++;
				s+=p;}
			br++;
			s+=x;
		}
		else
		{
			 if (br>br1)
		{
			for (j=s/2;j>=1;j--)
			{
				if (s%j==0) 
				{
					nd=j;
					break;
				}
			}
			s1=s;
			br1=br;
		}
			s=0;
			br=0;
			
		}
		p=x;
}


		if (br>br1)
		{
			for (j=s/2;j>=1;j--)
			{
				if (s%j==0) 
				{
					nd=j;
					break;
				}
			}
			br1=br;
		}
		
		
	cout<<br1<<endl<<nd<<endl;
	
}
/*
16
11 1 2 3 2 3 2 3 2 5 6 7 9 10 1
*/
