#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define MOD3 (1000000009)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("input.txt");ofstream coutt("output.txt");

int n,v[300005];

int tree[4*300005];

void makeit(int s,int e,int idx){
    if(s==e){
        tree[idx]=v[s];
        return;
    }
    int mid=(s+e)/2;
    makeit(s,mid,idx*2+1);
    makeit(mid+1,e,idx*2+2);
    tree[idx]=__gcd(tree[idx*2+1],tree[idx*2+2]);
}

int query(int s,int e,int S,int E,int idx){
    if(s>E || e<S)return 0;
    if(s>=S && e<=E)return tree[idx];
    int mid=(s+e)/2;
    return __gcd(query(s,mid,S,E,idx*2+1),query(mid+1,e,S,E,idx*2+2));
}

int gett(int a,int b){
    return query(0,n-1,a,b,0);
}

vi ans;
int mx=-1;
int cnt[1000005];

bool f(int k){
    for(int i=0;i<=1000000;i++)cnt[i]=0;

    vi lo;
    for(int i=0;i<k;i++)cnt[v[i]]=i+1;

    if(cnt[gett(0,k-1)])lo.push_back(1);

    for(int i=k;i<n;i++){
        cnt[v[i-k]]=0;
        cnt[v[i]]=i+1;

        if(cnt[gett(i-k+1,i)])lo.push_back(i+2-k);
    }

    if(lo.empty())return 0;

    if(mx<k){
        mx=k;
        ans=lo;
    }
    return 1;
}

signed main(){
    FASTER;
    cin>>n;
    for(int i=0;i<n;i++)cin>>v[i];
    makeit(0,n-1,0);

    int s=1,e=n;
    while(s<=e){
        int mid=(s+e)/2;
        if(f(mid))s=mid+1;
        else e=mid-1;
    }
    cout<<ans.size()<<" "<<s-2<<"\n"<<ans;
}


#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define MOD3 (1000000009)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("input.txt");ofstream coutt("output.txt");

int n,v[300005];

int tree[4*300005];

void makeit(int s,int e,int idx){
    if(s==e){
        tree[idx]=v[s];
        return;
    }
    int mid=(s+e)/2;
    makeit(s,mid,idx*2+1);
    makeit(mid+1,e,idx*2+2);
    tree[idx]=__gcd(tree[idx*2+1],tree[idx*2+2]);
}

int query(int s,int e,int S,int E,int idx){
    if(s>E || e<S)return -1;
    if(s>=S && e<=E)return tree[idx];
    int mid=(s+e)/2;
    int lolo=query(s,mid,S,E,idx*2+1);
    int olol=query(mid+1,e,S,E,idx*2+2);
    if(lolo==-1)return olol;
    if(olol==-1)return lolo;
    return __gcd(lolo,olol);
}

int gett(int a,int b){
    return query(0,n-1,a,b,0);
}

vi ans;
int mx;
int cnt[1000005];

bool f(int k){
    for(int i=0;i<=1000000;i++)cnt[i]=0;

    vi lo;
    for(int i=0;i<k;i++)cnt[v[i]]=i+1;

    if(cnt[gett(0,k-1)])lo.push_back(1);

    for(int i=k;i<n;i++){
        cnt[v[i-k]]=0;
        cnt[v[i]]=i+1;

        if(cnt[gett(i-k+1,i)])lo.push_back(i+2-k);
    }

    if(lo.empty())return 0;

    if(mx<k){
        mx=k;
        ans=lo;
    }
    return 1;
}

signed main(){
    FASTER;
    cin>>n;
    for(int i=0;i<n;i++)cin>>v[i];
    makeit(0,n-1,0);

    int s=1,e=n;
    while(s<=e){
        int mid=(s+e)/2;
        if(f(mid))s=mid+1;
        else e=mid-1;
    }
    cout<<ans.size()<<" "<<mx-1<<"\n"<<ans;
}


#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define MOD3 (1000000009)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("input.txt");ofstream coutt("output.txt");

int n,v[300005];

int tree[4*300005];

void makeit(int s,int e,int idx){
    if(s==e){
        tree[idx]=v[s];
        return;
    }
    int mid=(s+e)/2;
    makeit(s,mid,idx*2+1);
    makeit(mid+1,e,idx*2+2);
    tree[idx]=__gcd(tree[idx*2+1],tree[idx*2+2]);
}

int query(int s,int e,int S,int E,int idx){
    if(s>E || e<S)return 0;
    if(s>=S && e<=E)return tree[idx];
    return __gcd(query(s,(s+e)/2,S,E,idx*2+1),query((s+e)/2+1,e,S,E,idx*2+2));
}

int gett(int a,int b){
    return query(0,n-1,a,b,0);
}

vi ans;
int mx=-1;

int cnt[1000005];

bool f(int k){
    for(int i=0;i<=1000000;i++)cnt[i]=0;

    vi lo;
    for(int i=0;i<k;i++){
        cnt[v[i]]++;
    }

    if(cnt[gett(0,k-1)])lo.push_back(1);

    for(int i=k;i<n;i++){
        cnt[v[i-k]]--;
        cnt[v[i]]++;

        if(cnt[gett(i-k+1,i)])lo.push_back(i+2-k);
    }

    if(lo.empty())return 0;
    ans=lo;
    return 1;
}

signed main(){
    FASTER;
    cin>>n;
    for(int i=0;i<n;i++)cin>>v[i];
    makeit(0,n-1,0);

    int s=1,e=n;
    while(s<=e){
        int mid=(s+e)/2;
        if(f(mid)){
            s=mid+1;
        }else e=mid-1;
    }
    cout<<ans.size()<<" "<<s-2<<"\n"<<ans;
}


#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define MOD3 (1000000009)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("input.txt");ofstream coutt("output.txt");

int n,v[300005];

int tree[4*300005];

void makeit(int s,int e,int idx){
    if(s==e){
        tree[idx]=v[s];
        return;
    }
    int mid=(s+e)/2;
    makeit(s,mid,idx*2+1);
    makeit(mid+1,e,idx*2+2);
    tree[idx]=__gcd(tree[idx*2+1],tree[idx*2+2]);
}

int query(int s,int e,int S,int E,int idx){
    if(s>E || e<S)return 0;
    if(s>=S && e<=E)return tree[idx];
    return __gcd(query(s,(s+e)/2,S,E,idx*2+1),query((s+e)/2+1,e,S,E,idx*2+2));
}

int gett(int a,int b){
    return query(0,n-1,a,b,0);
}

vi ans;
int mx=-1;

int cnt[1000005];

bool f(int k){
    for(int i=0;i<=1000000;i++)cnt[i]=0;

    vi lo;
    for(int i=0;i<k;i++){
        cnt[v[i]]=i+1;
    }

    if(cnt[gett(0,k-1)])lo.push_back(1);

    for(int i=k;i<n;i++){
        cnt[v[i-k]]=0;
        cnt[v[i]]=i+1;

        if(cnt[gett(i-k+1,i)])lo.push_back(i+2-k);
    }

    if(lo.empty())return 0;

    if(mx<k){
        mx=k;
        ans=lo;
    }

    return 1;
}

signed main(){
    FASTER;
    cin>>n;
    for(int i=0;i<n;i++)cin>>v[i];
    makeit(0,n-1,0);

    int s=1,e=n;
    while(s<=e){
        int mid=(s+e)/2;
        if(f(mid)){
            s=mid+1;
        }else e=mid-1;
    }
    cout<<ans.size()<<" "<<s-2<<"\n"<<ans;
}


#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define MOD3 (1000000009)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("input.txt");ofstream coutt("output.txt");

int gg(int a,int b){
    if(b==0)return a;
    return gg(b,a%b);
}

int n,v[300005];

int tree[4*300005];

void makeit(int s,int e,int idx){
    if(s==e){
        tree[idx]=v[s];
        return;
    }
    int mid=(s+e)/2;
    makeit(s,mid,idx*2+1);
    makeit(mid+1,e,idx*2+2);
    tree[idx]=gg(tree[idx*2+1],tree[idx*2+2]);
}

int query(int s,int e,int S,int E,int idx){
    if(s>E || e<S)return 0;
    if(s>=S && e<=E)return tree[idx];
    return gg(query(s,(s+e)/2,S,E,idx*2+1),query((s+e)/2+1,e,S,E,idx*2+2));
}

int gett(int a,int b){
    return query(0,n-1,a,b,0);
}

vi ans;
int mx=-1;

int cnt[1000005];

bool f(int k){
    for(int i=0;i<=1000000;i++)cnt[i]=0;

    vi lo;
    for(int i=0;i<k;i++){
        cnt[v[i]]=i+1;
    }

    if(cnt[gett(0,k-1)])lo.push_back(1);

    for(int i=k;i<n;i++){
        cnt[v[i-k]]=0;
        cnt[v[i]]=i+1;

        if(cnt[gett(i-k+1,i)])lo.push_back(i+2-k);
    }

    if(lo.empty())return 0;

    if(mx<k){
        mx=k;
        ans=lo;
    }

    return 1;
}

signed main(){
    FASTER;
    cin>>n;
    for(int i=0;i<n;i++)cin>>v[i];
    makeit(0,n-1,0);

    int s=1,e=n;
    while(s<=e){
        int mid=(s+e)/2;
        if(f(mid)){
            s=mid+1;
        }else e=mid-1;
    }
    cout<<ans.size()<<" "<<s-2<<"\n"<<ans;
}


#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define MOD3 (1000000009)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("input.txt");ofstream coutt("output.txt");

int n,v[300005];

int tree[4*300005];

void makeit(int s,int e,int idx){
    if(s==e){
        tree[idx]=v[s];
        return;
    }
    int mid=(s+e)/2;
    makeit(s,mid,idx*2+1);
    makeit(mid+1,e,idx*2+2);
    tree[idx]=__gcd(tree[idx*2+1],tree[idx*2+2]);
}

int query(int s,int e,int S,int E,int idx){
    if(s>E || e<S)return 0;
    if(s>=S && e<=E)return tree[idx];
    return __gcd(query(s,(s+e)/2,S,E,idx*2+1),query((s+e)/2+1,e,S,E,idx*2+2));
}

int gett(int a,int b){
    return query(0,n-1,a,b,0);
}

vi ans;
int mx=-1;

int cnt[1000005];

bool f(int k){

    vi lo;
    for(int i=0;i<k;i++){
        cnt[v[i]]++;
    }

    if(cnt[gett(0,k-1)])lo.push_back(1);

    for(int i=k;i<n;i++){
        cnt[v[i-k]]--;
        cnt[v[i]]++;

        if(cnt[gett(i-k+1,i)])lo.push_back(i+2-k);
    }

    for(int i=n-k;i<n;i++)cnt[v[i]]--;

    if(lo.empty())return 0;
    ans=lo;
    return 1;
}

signed main(){
    FASTER;
    cin>>n;
    for(int i=0;i<n;i++)cin>>v[i];
    makeit(0,n-1,0);

    int s=1,e=n;
    while(s<=e){
        int mid=(s+e)/2;
        if(f(mid)){
            s=mid+1;
        }else e=mid-1;
    }
    cout<<ans.size()<<" "<<s-2<<"\n"<<ans;
}


#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define MOD3 (1000000009)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("input.txt");ofstream coutt("output.txt");

int gg(int a,int b){
    if(b==0)return a;
    return gg(b,a%b);
}

int n,v[300005];

int tree[4*300005];

void makeit(int s,int e,int idx){
    if(s==e){
        tree[idx]=v[s];
        return;
    }
    int mid=(s+e)/2;
    makeit(s,mid,idx*2+1);
    makeit(mid+1,e,idx*2+2);
    tree[idx]=gg(tree[idx*2+1],tree[idx*2+2]);
}

int query(int s,int e,int S,int E,int idx){
    if(s>E || e<S)return -1;
    if(s>=S && e<=E)return tree[idx];
    int mid=(s+e)/2;
    int lolo=query(s,mid,S,E,idx*2+1);
    int olol=query(mid+1,e,S,E,idx*2+2);
    if(olol==-1)return lolo;
    if(lolo==-1)return olol;
    return gg(lolo,olol);
}

int gett(int a,int b){
    return query(0,n-1,a,b,0);
}

vi ans;
bool cnt[1000005];

bool f(int k){
    for(int i=0;i<=1000000;i++)cnt[i]=0;

    vi lo;
    for(int i=0;i<k;i++)cnt[v[i]]=1;

    if(cnt[gett(0,k-1)])lo.push_back(1);

    for(int i=k;i<n;i++){
        cnt[v[i-k]]=0;
        cnt[v[i]]=1;

        if(cnt[gett(i-k+1,i)])lo.push_back(i+2-k);
    }

    if(lo.empty())return 0;
    ans=lo;
    return 1;
}

signed main(){
    FASTER;
    cin>>n;
    for(int i=0;i<n;i++)cin>>v[i];
    makeit(0,n-1,0);

    int s=1,e=n;
    while(s<=e){
        int mid=(s+e)/2;
        if(f(mid))s=mid+1;
        else e=mid-1;
    }
    cout<<ans.size()<<" "<<s-2<<"\n"<<ans;
}


#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
//#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define MOD3 (1000000009)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("input.txt");ofstream coutt("output.txt");

int n,v[300005];

int tree[4*300005];

void makeit(int s,int e,int idx){
    if(s==e){
        tree[idx]=v[s];
        return;
    }
    int mid=(s+e)/2;
    makeit(s,mid,idx*2+1);
    makeit(mid+1,e,idx*2+2);
    tree[idx]=__gcd(tree[idx*2+1],tree[idx*2+2]);
}

int query(int s,int e,int S,int E,int idx){
    if(s>E || e<S)return 0;
    if(s>=S && e<=E)return tree[idx];
    return __gcd(query(s,(s+e)/2,S,E,idx*2+1),query((s+e)/2+1,e,S,E,idx*2+2));
}

int gett(int a,int b){
    return query(0,n-1,a,b,0);
}

vi ans;
int mx=-1;

int cnt[1000005];

bool f(int k){
    for(int i=0;i<n;i++)cnt[v[i]]=0;

    vi lo;
    for(int i=0;i<k;i++){
        cnt[v[i]]++;
    }

    if(cnt[gett(0,k-1)])lo.push_back(1);

    for(int i=k;i<n;i++){
        cnt[v[i-k]]--;
        cnt[v[i]]++;

        if(cnt[gett(i-k+1,i)])lo.push_back(i+2-k);
    }

    if(lo.empty())return 0;
    ans=lo;
    return 1;
}

signed main(){
    FASTER;
    cin>>n;
    for(int i=0;i<n;i++)cin>>v[i];
    makeit(0,n-1,0);

    int s=1,e=n;
    while(s<=e){
        int mid=(s+e)/2;
        if(f(mid)){
            s=mid+1;
        }else e=mid-1;
    }
    cout<<ans.size()<<" "<<s-2<<"\n"<<ans;
}


#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define MOD3 (1000000009)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("input.txt");ofstream coutt("output.txt");

int gg(int a,int b){
    if(b==0)return a;
    return gg(a,a%b);
}

int n,v[300005];

int tree[4*300005];

void makeit(int s,int e,int idx){
    if(s==e){
        tree[idx]=v[s];
        return;
    }
    int mid=(s+e)/2;
    makeit(s,mid,idx*2+1);
    makeit(mid+1,e,idx*2+2);
    tree[idx]=gg(tree[idx*2+1],tree[idx*2+2]);
}

int query(int s,int e,int S,int E,int idx){
    if(s>E || e<S)return -1;
    if(s>=S && e<=E)return tree[idx];
    int mid=(s+e)/2;
    int lolo=query(s,mid,S,E,idx*2+1);
    int olol=query(mid+1,e,S,E,idx*2+2);
    if(olol==-1)return lolo;
    if(lolo==-1)return olol;
    return gg(lolo,olol);
}

int gett(int a,int b){
    return query(0,n-1,a,b,0);
}

vi ans;
bool cnt[1000005];

bool f(int k){
    for(int i=0;i<=1000000;i++)cnt[i]=0;

    vi lo;
    for(int i=0;i<k;i++)cnt[v[i]]=1;

    if(cnt[gett(0,k-1)])lo.push_back(1);

    for(int i=k;i<n;i++){
        cnt[v[i-k]]=0;
        cnt[v[i]]=1;

        if(cnt[gett(i-k+1,i)])lo.push_back(i+2-k);
    }

    if(lo.empty())return 0;
    ans=lo;
    return 1;
}

signed main(){
    FASTER;
    cin>>n;
    for(int i=0;i<n;i++)cin>>v[i];
    makeit(0,n-1,0);

    int s=1,e=n;
    while(s<=e){
        int mid=(s+e)/2;
        if(f(mid))s=mid+1;
        else e=mid-1;
    }
    cout<<ans.size()<<" "<<s-2<<"\n"<<ans;
}


#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
//#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define MOD3 (1000000009)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("input.txt");ofstream coutt("output.txt");

int n,v[300005];

int tree[4*300005];

void makeit(int s,int e,int idx){
    if(s==e){
        tree[idx]=v[s];
        return;
    }
    int mid=(s+e)/2;
    makeit(s,mid,idx*2+1);
    makeit(mid+1,e,idx*2+2);
    tree[idx]=__gcd(tree[idx*2+1],tree[idx*2+2]);
}

int query(int s,int e,int S,int E,int idx){
    if(s>E || e<S)return 0;
    if(s>=S && e<=E)return tree[idx];
    return __gcd(query(s,(s+e)/2,S,E,idx*2+1),query((s+e)/2+1,e,S,E,idx*2+2));
}

int gett(int a,int b){
    return query(0,n-1,a,b,0);
}

vi ans;
int mx=-1;

int cnt[1000005];

bool f(int k){
    for(int i=0;i<=1000000;i++)cnt[i]=0;

    vi lo;
    for(int i=0;i<k;i++){
        cnt[v[i]]++;
    }

    if(cnt[gett(0,k-1)])lo.push_back(1);

    for(int i=k;i<n;i++){
        cnt[v[i-k]]--;
        cnt[v[i]]++;

        if(cnt[gett(i-k+1,i)])lo.push_back(i+2-k);
    }

    if(lo.empty())return 0;
    ans=lo;
    return 1;
}

signed main(){
    FASTER;
    cin>>n;
    for(int i=0;i<n;i++)cin>>v[i];
    makeit(0,n-1,0);

    int s=1,e=n;
    while(s<=e){
        int mid=(s+e)/2;
        if(f(mid)){
            s=mid+1;
        }else e=mid-1;
    }
    cout<<ans.size()<<" "<<s-2<<"\n"<<ans;
}


#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
//#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define MOD3 (1000000009)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("input.txt");ofstream coutt("output.txt");

int n,v[300005];

int tree[4*300005];

void makeit(int s,int e,int idx){
    if(s==e){
        tree[idx]=v[s];
        return;
    }
    int mid=(s+e)/2;
    makeit(s,mid,idx*2+1);
    makeit(mid+1,e,idx*2+2);
    tree[idx]=__gcd(tree[idx*2+1],tree[idx*2+2]);
}

int query(int s,int e,int S,int E,int idx){
    if(s>E || e<S)return 0;
    if(s>=S && e<=E)return tree[idx];
    return __gcd(query(s,(s+e)/2,S,E,idx*2+1),query((s+e)/2+1,e,S,E,idx*2+2));
}

int gett(int a,int b){
    return query(0,n-1,a,b,0);
}

vi ans;
int mx=-1;

int cnt[1000005];

bool f(int k){

    vi lo;
    for(int i=0;i<k;i++){
        cnt[v[i]]++;
    }

    if(cnt[gett(0,k-1)])lo.push_back(1);

    for(int i=k;i<n;i++){
        cnt[v[i-k]]--;
        cnt[v[i]]++;

        if(cnt[gett(i-k+1,i)])lo.push_back(i+2-k);
    }

    for(int i=n-k;i<n;i++)cnt[v[i]]--;

    if(lo.empty())return 0;
    ans=lo;
    return 1;
}

signed main(){
    FASTER;
    cin>>n;
    for(int i=0;i<n;i++)cin>>v[i];
    makeit(0,n-1,0);

    int s=1,e=n;
    while(s<=e){
        int mid=(s+e)/2;
        if(f(mid)){
            s=mid+1;
        }else e=mid-1;
    }
    cout<<ans.size()<<" "<<s-2<<"\n"<<ans;
}


#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define MOD3 (1000000009)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("input.txt");ofstream coutt("output.txt");

int n,v[300005];

int tree[4*300005];

void makeit(int s,int e,int idx){
    if(s==e){
        tree[idx]=v[s];
        return;
    }
    int mid=(s+e)/2;
    makeit(s,mid,idx*2+1);
    makeit(mid+1,e,idx*2+2);
    tree[idx]=__gcd(tree[idx*2+1],tree[idx*2+2]);
}

int query(int s,int e,int S,int E,int idx){
    if(s>E || e<S)return 0;
    if(s>=S && e<=E)return tree[idx];
    return __gcd(query(s,(s+e)/2,S,E,idx*2+1),query((s+e)/2+1,e,S,E,idx*2+2));
}

int gett(int a,int b){
    return query(0,n-1,a,b,0);
}

vi ans;
int mx=-1;

int cnt[1000005];

bool f(int k){
    for(int i=0;i<n;i++)cnt[v[i]]=0;

    vi lo;
    for(int i=0;i<k;i++){
        cnt[v[i]]++;
    }

    if(cnt[gett(0,k-1)])lo.push_back(1);

    for(int i=k;i<n;i++){
        cnt[v[i-k]]--;
        cnt[v[i]]++;

        if(cnt[gett(i-k+1,i)])lo.push_back(i+2-k);
    }

    if(lo.empty())return 0;
    ans=lo;
    return 1;
}

signed main(){
    FASTER;
    cin>>n;
    for(int i=0;i<n;i++)cin>>v[i];
    makeit(0,n-1,0);

    int s=1,e=n;
    while(s<=e){
        int mid=(s+e)/2;
        if(f(mid)){
            s=mid+1;
        }else e=mid-1;
    }
    cout<<ans.size()<<" "<<s-2<<"\n"<<ans;
}


#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define MOD3 (1000000009)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("input.txt");ofstream coutt("output.txt");

int n,v[300005];

int tree[4*300005];

void makeit(int s,int e,int idx){
    if(s==e){
        tree[idx]=v[s];
        return;
    }
    int mid=(s+e)/2;
    makeit(s,mid,idx*2+1);
    makeit(mid+1,e,idx*2+2);
    tree[idx]=__gcd(tree[idx*2+1],tree[idx*2+2]);
}

int query(int s,int e,int S,int E,int idx){
    if(s>E || e<S)return 0;
    if(s>=S && e<=E)return tree[idx];
    int mid=(s+e)/2;
    int lolo=query(s,mid,S,E,idx*2+1);
    int olol=query(mid+1,e,S,E,idx*2+2);
    return __gcd(lolo,olol);
}

int gett(int a,int b){
    return query(0,n-1,a,b,0);
}

vi ans;
int mx;
int cnt[1000005];

bool f(int k){
    for(int i=0;i<=1000000;i++)cnt[i]=0;

    vi lo;
    for(int i=0;i<k;i++)cnt[v[i]]=1;

    if(cnt[gett(0,k-1)])lo.push_back(1);

    for(int i=k;i<n;i++){
        cnt[v[i-k]]=0;
        cnt[v[i]]=1;

        if(cnt[gett(i-k+1,i)])lo.push_back(i+2-k);
    }

    if(lo.empty())return 0;

    if(mx<k){
        mx=k;
        ans=lo;
    }
    return 1;
}

signed main(){
    FASTER;
    cin>>n;
    for(int i=0;i<n;i++)cin>>v[i];
    makeit(0,n-1,0);

    int s=1,e=n;
    while(s<=e){
        int mid=(s+e)/2;
        if(f(mid))s=mid+1;
        else e=mid-1;
    }
    cout<<ans.size()<<" "<<mx-1<<"\n"<<ans;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N=3e5+9;

int a[N],n,q;
vector<int>v;

struct node {
    int mn;
    int gcd;
};

node seg[4*N];

void bulid(int p,int l,int r){
    if(l==r){
        seg[p].mn=a[l];
        seg[p].gcd=a[l];
        return ;
    }
    int mid=(l+r)/2;
    bulid(p*2,l,mid);
    bulid(p*2+1,mid+1,r);
    seg[p].mn=min(seg[p*2].mn,seg[p*2+1].mn);
    seg[p].gcd=__gcd(seg[p*2].gcd,seg[p*2+1].gcd);
}

int get_mn(int p,int l,int r,int a,int b){
     if(l>=a&&r<=b)return seg[p].mn;
     if(r<a||l>b)return 1e9;
     int mid=(l+r)/2;
     return min(get_mn(p*2,l,mid,a,b),get_mn(p*2+1,mid+1,r,a,b));
}

int get_g(int p,int l,int r,int a,int b){
     if(l>=a&&r<=b)return seg[p].gcd;
     if(r<a||l>b)return 0;
     int mid=(l+r)/2;
    return __gcd(get_g(p*2,l,mid,a,b),get_g(p*2+1,mid+1,r,a,b));
}

bool ok(int mid){
    for(int i=1;i<=n-mid+1;i++){
        int mn=get_mn(1,1,n,i,i+mid-1);
        int g=get_g(1,1,n,i,i+mid-1);
        if(mn==g)return true;
    }
    return false;
}

void fill(int c){
    for(int i=1;i<=n-c+1;i++){
       int mn=get_mn(1,1,n,i,i+c-1);
       int g=get_g(1,1,n,i,i+c-1);
       if(mn==g){
         v.push_back(i);
       }
    }
}

int main()
{

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    bulid(1,1,n);
    int l=1,r=n,mid,ans;
    while(l<=r){
        mid=(l+r)/2;
        if(ok(mid)){
            ans=mid;
            l=mid+1;
        }
        else {
            r=mid-1;
        }
    }
    fill(ans);
    cout<<v.size()<<" "<<ans-1<<'\n';
    for(int i=0;i<v.size();i++){
        cout<<v[i]<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N=3e5+9;

int a[N],n,q;
vector<int>v;

struct node {
    int mn;
    int gcd;
};

node seg[4*N];

void bulid(int p,int l,int r){
    if(l==r){
        seg[p].mn=a[l];
        seg[p].gcd=a[l];
        return ;
    }
    int mid=(l+r)/2;
    bulid(p*2,l,mid);
    bulid(p*2+1,mid+1,r);
    seg[p].mn=min(seg[p*2].mn,seg[p*2+1].mn);
    seg[p].gcd=__gcd(seg[p*2].gcd,seg[p*2+1].gcd);
}

int get_mn(int p,int l,int r,int a,int b){
     if(l>=a&&r<=b)return seg[p].mn;
     if(r<a||l>b)return 1e9;
     int mid=(l+r)/2;
    return min(get_mn(p*2,l,mid,a,b),get_mn(p*2+1,mid+1,r,a,b));
}

int get_g(int p,int l,int r,int a,int b){
     if(l>=a&&r<=b)return seg[p].gcd;
     if(r<a||l>b)return 0;
     int mid=(l+r)/2;
    return __gcd(get_g(p*2,l,mid,a,b),get_g(p*2+1,mid+1,r,a,b));
}

bool ok(int mid){
    for(int i=1;i<=n-mid+1;i++){
        int mn=get_mn(1,1,n,i,i+mid-1);
        int g=get_g(1,1,n,i,i+mid-1);
        if(mn==g)return true;
    }
    return false;
}

void fill(int c){
    for(int i=1;i<=n-c+1;i++){
       int mn=get_mn(1,1,n,i,i+c-1);
       int g=get_g(1,1,n,i,i+c-1);
       if(mn==g){
         v.push_back(i);
       }
    }
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    bulid(1,1,n);
    int l=1,r=n,mid,ans;
    while(l<=r){
        mid=(l+r)/2;
        if(ok(mid)){
            ans=mid;
            l=mid+1;
        }
        else {
            r=mid-1;
        }
    }
    fill(ans);
    cout<<v.size()<<" "<<ans-1<<'\n';
    for(int i=0;i<v.size();i++){
        cout<<v[i]<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N=1e6+2;

int a[N],seg[4*N],seg1[4*N],n,q;
vector<int>v;

void bulid(int p,int l,int r){
    if(l==r){
        seg[p]=a[l];
        seg1[p]=a[l];
        return ;
    }
    int mid=(l+r)/2;
    bulid(p*2,l,mid);
    bulid(p*2+1,mid+1,r);
    seg[p]=min(seg[p*2],seg[p*2+1]);
    seg1[p]=__gcd(seg1[p*2],seg1[p*2+1]);
}

int get_mn(int p,int l,int r,int a,int b){
     if(l>=a&&r<=b)return seg[p];
     if(r<a||l>b)return 1e9;
     int mid=(l+r)/2;
    return min(get_mn(p*2,l,mid,a,b),get_mn(p*2+1,mid+1,r,a,b));
}

int get_g(int p,int l,int r,int a,int b){
     if(l>=a&&r<=b)return seg1[p];
     if(r<a||l>b)return 0;
     int mid=(l+r)/2;
    return __gcd(get_g(p*2,l,mid,a,b),get_g(p*2+1,mid+1,r,a,b));
}

bool ok(int mid){
    for(int i=1;i<=n-mid+1;i++){
        int mn=get_mn(1,1,n,i,i+mid-1);
        int g=get_g(1,1,n,i,i+mid-1);
        if(mn==g)return true;
    }
    return false;
}

void fill(int c){
    for(int i=1;i<=n-c+1;i++){
       int mn=get_mn(1,1,n,i,i+c-1);
       int g=get_g(1,1,n,i,i+c-1);
       if(mn==g){
         v.push_back(i);
       }
    }
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    bulid(1,1,n);
    int l=1,r=n,mid,ans;
    while(l<=r){
        mid=(l+r)/2;
        if(ok(mid)){
            ans=mid;
            l=mid+1;
        }
        else {
            r=mid-1;
        }
    }
    fill(ans);
    cout<<v.size()<<" "<<ans-1<<'\n';
    for(int i=0;i<v.size();i++){
        cout<<v[i]<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N=3e5+9;

int a[N],n,q;
vector<int>v;

struct node {
    int mn;
    int gcd;
};

node seg[4*N];

node merge(const node &l,const node &r){
    node res;
    res.mn=min(l.mn,r.mn);
    res.gcd=__gcd(l.gcd,r.gcd);
    return res;
}

void bulid(int p,int l,int r){
    if(l==r){
        seg[p].mn=a[l];
        seg[p].gcd=a[l];
        return ;
    }
    int mid=(l+r)/2;
    bulid(p*2,l,mid);
    bulid(p*2+1,mid+1,r);
    seg[p]=merge(seg[p*2],seg[p*2+1]);
}

node get(int p,int l,int r,int a,int b){
     if(l>=a&&r<=b)return seg[p];
     if(r<a||l>b){
        node tmp;
        tmp.mn=1e9;
        tmp.gcd=0;
        return tmp;
    }
    int mid=(l+r)/2;
    if(b<=mid) return get(p*2,l,mid,a,b);
    if(a>mid) return get(p*2+1,mid+1,r,a,b);
    return merge(get(p*2,l,mid,a,b),get(p*2+1,mid+1,r,a,b));
}

bool ok(int mid){
    for(int i=1;i<=n-mid+1;i++){
        int mn=get(1,1,n,i,i+mid-1).mn;
        int g=get(1,1,n,i,i+mid-1).gcd;
        if(mn==g)return true;
    }
    return false;
}

void fill(int c){
    for(int i=1;i<=n-c+1;i++){
       int mn=get(1,1,n,i,i+c-1).mn;
       int g=get(1,1,n,i,i+c-1).gcd;
       if(mn==g){
         v.push_back(i);
       }
    }
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    scanf("%d" ,&n);
    for(int i=1;i<=n;i++){
        scanf("%d" , &a[i]);
    }
    bulid(1,1,n);
    int l=1,r=n,mid,ans;

    while(l<=r){
        mid=(l+r)/2;
        if(ok(mid)){
            ans=mid;
            l=mid+1;
        }
        else {
            r=mid-1;
        }
    }
    fill(ans);
    printf("%d %d \n" ,v.size(),ans-1);
    for(int i=0;i<v.size();i++){
        printf("%d " ,v[i]);
    }

}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N=3e5+9;

int a[N],n,q,seg[4*N],seg1[4*N];
vector<int>v;

void bulid(int p,int l,int r){
    if(l==r){
        seg[p]=a[l];
        seg1[p]=a[l];
        return ;
    }
    int mid=(l+r)/2;
    bulid(p*2,l,mid);
    bulid(p*2+1,mid+1,r);
    seg[p]=min(seg[p*2],seg[p*2+1]);
    seg1[p]=__gcd(seg1[p*2],seg1[p*2+1]);
}

int get(int p,int l,int r,int a,int b){
     if(l>=a&&r<=b)return seg[p];
     if(r<a||l>b) return 1e9;
    int mid=(l+r)/2;
    if(b<=mid) return get(p*2,l,mid,a,b);
    if(a>mid) return get(p*2+1,mid+1,r,a,b);
    return min(get(p*2,l,mid,a,b),get(p*2+1,mid+1,r,a,b));
}

int get1(int p,int l,int r,int a,int b){
    if(l>=a&&r<=b)return seg1[p];
    if(r<a||l>b) return 0;
    int mid=(l+r)/2;
    if(b<=mid) return get1(p*2,l,mid,a,b);
    if(a>mid) return get1(p*2+1,mid+1,r,a,b);
    return __gcd(get1(p*2,l,mid,a,b),get1(p*2+1,mid+1,r,a,b));
}

bool ok(int mid){
    for(int i=1;i<=n-mid+1;i++){
        int mn=get(1,1,n,i,i+mid-1);
        int g=get1(1,1,n,i,i+mid-1);
        if(mn==g)return true;
    }
    return false;
}

void fill(int c){
    for(int i=1;i<=n-c+1;i++){
       int mn=get(1,1,n,i,i+c-1);
       int g=get1(1,1,n,i,i+c-1);
       if(mn==g){
         v.push_back(i);
       }
    }
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    bulid(1,1,n);
    int l=1,r=n,mid,ans;

    while(l<=r){
        mid=(l+r)/2;
        if(ok(mid)){
            ans=mid;
            l=mid+1;
        }
        else {
            r=mid-1;
        }
    }
    fill(ans);
    cout<<v.size()<<" "<<ans-1<<'\n';
    for(int i=0;i<v.size();i++){
        cout<<v[i]<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N=3e5+9;

int a[N],n,q;
vector<int>v;

struct node {
    int mn;
    int gcd;
};

node seg[4*N];

node merge(const node &l,const node &r){
    node res;
    res.mn=min(l.mn,r.mn);
    res.gcd=__gcd(l.gcd,r.gcd);
    return res;
}

void bulid(int p,int l,int r){
    if(l==r){
        seg[p].mn=a[l];
        seg[p].gcd=a[l];
        return ;
    }
    int mid=(l+r)/2;
    bulid(p*2,l,mid);
    bulid(p*2+1,mid+1,r);
    seg[p]=merge(seg[p*2],seg[p*2+1]);
}

node get(int p,int l,int r,int a,int b){
     if(l>=a&&r<=b)return seg[p];
     if(r<a||l>b){
        node tmp;
        tmp.mn=1e9;
        tmp.gcd=0;
        return tmp;
    }
    int mid=(l+r)/2;
    return merge(get(p*2,l,mid,a,b),get(p*2+1,mid+1,r,a,b));
}

bool ok(int mid){
    for(int i=1;i<=n-mid+1;i++){
        int mn=get(1,1,n,i,i+mid-1).mn;
        int g=get(1,1,n,i,i+mid-1).gcd;
        if(mn==g)return true;
    }
    return false;
}

void fill(int c){
    for(int i=1;i<=n-c+1;i++){
       int mn=get(1,1,n,i,i+c-1).mn;
       int g=get(1,1,n,i,i+c-1).gcd;
       if(mn==g){
         v.push_back(i);
       }
    }
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    bulid(1,1,n);
    int l=1,r=n,mid,ans;
    while(l<=r){
        mid=(l+r)/2;
        if(ok(mid)){
            ans=mid;
            l=mid+1;
        }
        else {
            r=mid-1;
        }
    }
    fill(ans);
    cout<<v.size()<<" "<<ans-1<<'\n';
    for(int i=0;i<v.size();i++){
        cout<<v[i]<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N=3e5+9

int a[N],n,q;
vector<int>v;

struct node {
    int mn;
    int gcd;
};

node seg[4*N];

void bulid(int p,int l,int r){
    if(l==r){
        seg[p].mn=a[l];
        seg[p].gcd=a[l];
        return ;
    }
    int mid=(l+r)/2;
    bulid(p*2,l,mid);
    bulid(p*2+1,mid+1,r);
    seg[p].mn=min(seg[p*2].mn,seg[p*2+1].mn);
    seg[p].gcd=__gcd(seg[p*2].gcd,seg[p*2+1].gcd);
}

int get_mn(int p,int l,int r,int a,int b){
     if(l>=a&&r<=b)return seg[p].mn;
     if(r<a||l>b)return 1e9;
     int mid=(l+r)/2;
    return min(get_mn(p*2,l,mid,a,b),get_mn(p*2+1,mid+1,r,a,b));
}

int get_g(int p,int l,int r,int a,int b){
     if(l>=a&&r<=b)return seg[p].gcd;
     if(r<a||l>b)return 0;
     int mid=(l+r)/2;
    return __gcd(get_g(p*2,l,mid,a,b),get_g(p*2+1,mid+1,r,a,b));
}

bool ok(int mid){
    for(int i=1;i<=n-mid+1;i++){
        int mn=get_mn(1,1,n,i,i+mid-1);
        int g=get_g(1,1,n,i,i+mid-1);
        if(mn==g)return true;
    }
    return false;
}

void fill(int c){
    for(int i=1;i<=n-c+1;i++){
       int mn=get_mn(1,1,n,i,i+c-1);
       int g=get_g(1,1,n,i,i+c-1);
       if(mn==g){
         v.push_back(i);
       }
    }
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    bulid(1,1,n);
    int l=1,r=n,mid,ans;
    while(l<=r){
        mid=(l+r)/2;
        if(ok(mid)){
            ans=mid;
            l=mid+1;
        }
        else {
            r=mid-1;
        }
    }
    fill(ans);
    cout<<v.size()<<" "<<ans-1<<'\n';
    for(int i=0;i<v.size();i++){
        cout<<v[i]<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N=1e6+2;

int a[N],n,q;
vector<int>v;

struct node {
    int mn;
    int gcd;
};

node seg[4*N];

void bulid(int p,int l,int r){
    if(l==r){
        seg[p].mn=a[l];
        seg[p].gcd=a[l];
        return ;
    }
    int mid=(l+r)/2;
    bulid(p*2,l,mid);
    bulid(p*2+1,mid+1,r);
    seg[p].mn=min(seg[p*2].mn,seg[p*2+1].mn);
    seg[p].gcd=__gcd(seg[p*2].gcd,seg[p*2+1].gcd);
}

int get_mn(int p,int l,int r,int a,int b){
     if(l>=a&&r<=b)return seg[p].mn;
     if(r<a||l>b)return 1e9;
     int mid=(l+r)/2;
    return min(get_mn(p*2,l,mid,a,b),get_mn(p*2+1,mid+1,r,a,b));
}

int get_g(int p,int l,int r,int a,int b){
     if(l>=a&&r<=b)return seg[p].gcd;
     if(r<a||l>b)return 0;
     int mid=(l+r)/2;
    return __gcd(get_g(p*2,l,mid,a,b),get_g(p*2+1,mid+1,r,a,b));
}

bool ok(int mid){
    for(int i=1;i<=n-mid+1;i++){
        int mn=get_mn(1,1,n,i,i+mid-1);
        int g=get_g(1,1,n,i,i+mid-1);
        if(mn==g)return true;
    }
    return false;
}

void fill(int c){
    for(int i=1;i<=n-c+1;i++){
       int mn=get_mn(1,1,n,i,i+c-1);
       int g=get_g(1,1,n,i,i+c-1);
       if(mn==g){
         v.push_back(i);
       }
    }
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    bulid(1,1,n);
    int l=1,r=n,mid,ans;
    while(l<=r){
        mid=(l+r)/2;
        if(ok(mid)){
            ans=mid;
            l=mid+1;
        }
        else {
            r=mid-1;
        }
    }
    fill(ans);
    cout<<v.size()<<" "<<ans-1<<'\n';
    for(int i=0;i<v.size();i++){
        cout<<v[i]<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N=3e5+9;

int a[N],n,q;
vector<int>v;

struct node {
    int mn;
    int gcd;
};

node seg[4*N];

node merge(const node &l,const node &r){
    node res;
    res.mn=min(l.mn,r.mn);
    res.gcd=__gcd(l.gcd,r.gcd);
    return res;
}

void bulid(int p,int l,int r){
    if(l==r){
        seg[p].mn=a[l];
        seg[p].gcd=a[l];
        return ;
    }
    int mid=(l+r)/2;
    bulid(p*2,l,mid);
    bulid(p*2+1,mid+1,r);
    seg[p]=merge(seg[p*2],seg[p*2+1]);
}

node get(int p,int l,int r,int a,int b){
     if(l>=a&&r<=b)return seg[p];
     if(r<a||l>b){
        node tmp;
        tmp.mn=1e9;
        tmp.gcd=0;
        return tmp;
    }
    int mid=(l+r)/2;
    if(b<=mid) return get(p*2,l,mid,a,b);
    if(a>mid) return get(p*2+1,mid+1,r,a,b);
    return merge(get(p*2,l,mid,a,b),get(p*2+1,mid+1,r,a,b));
}

bool ok(int mid){
    for(int i=1;i<=n-mid+1;i++){
        int mn=get(1,1,n,i,i+mid-1).mn;
        int g=get(1,1,n,i,i+mid-1).gcd;
        if(mn==g)return true;
    }
    return false;
}

void fill(int c){
    for(int i=1;i<=n-c+1;i++){
       int mn=get(1,1,n,i,i+c-1).mn;
       int g=get(1,1,n,i,i+c-1).gcd;
       if(mn==g){
         v.push_back(i);
       }
    }
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    bulid(1,1,n);
    int l=1,r=n,mid,ans;
    while(l<=r){
        mid=(l+r)/2;
        if(ok(mid)){
            ans=mid;
            l=mid+1;
        }
        else {
            r=mid-1;
        }
    }
    fill(ans);
    cout<<v.size()<<" "<<ans-1<<'\n';
    for(int i=0;i<v.size();i++){
        cout<<v[i]<<" ";
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
ll gcd(ll a,ll b)
{
    if(a%b==0)
        return b;
    return gcd(b,a%b);
}
long long power(long long x, long long y)
{
    if (y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
}
long long Log2n(long long n)
{
   return (n > 1)? 1 + Log2n(n/2): 0;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;++i)
        cin>>a[i];
    ll st[n][21],stm[n][18];
    for(int i=0;i<n;++i)
    {
        st[i][0]=a[i];
        stm[i][0]=a[i];
    }
    for(ll i=1;i<21;++i)
    {
        for(ll j=0;j<n;++j)
        {
            if(j+power(2,i)<=n)
            {
                st[j][i]=gcd(st[j][i-1],st[j+power(2,i-1)][i-1]);
                stm[j][i]=min(stm[j][i-1],stm[j+power(2,i-1)][i-1]);
            }
        }
    }
    multiset<ll> ans;
    ll l=1,r=n+1;
    while(r-l>1)
    {

        int m=(l+r)/2;
        int c=0;
        int rr=power(2,Log2n(m));
        int lo=Log2n(m);
        vector<int> v;
        for(int i=0;i+m-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+m-rr][lo])==gcd(st[i][lo],st[i+m-rr][lo]))
               { ++c;
               }

        }
        if(c==0)
        {
            r=m;
        }
        else
        {
            l=m;

        }
    }
    int rr=power(2,Log2n(l));
        int lo=Log2n(l);
        if(l==1)
           {rr=1; lo=0;}
    for(int i=0;i+l-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+l-rr][lo])==gcd(st[i][lo],st[i+l-rr][lo]))
               {
                ans.insert(i+1);
               }
        }

   cout<<ans.size()<<" "<<l-1<<"\n";
    for(auto z:ans)
        cout<<z<<" " ;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
ll gcd(ll a,ll b)
{
    if(a%b==0)
        return b;
    return gcd(b,a%b);
}
long long power(long long x, long long y)
{
    if (y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
}
long long Log2n(long long n)
{
   return (n > 1)? 1 + Log2n(n/2): 0;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;++i)
        cin>>a[i];
    ll st[n][18],stm[n][18];
    for(int i=0;i<n;++i)
    {
        st[i][0]=a[i];
        stm[i][0]=a[i];
    }
    for(ll i=1;i<18;++i)
    {
        for(ll j=0;j<n;++j)
        {
            if(j+power(2,i)<=n)
            {
                st[j][i]=gcd(st[j][i-1],st[j+power(2,i-1)][i-1]);
                stm[j][i]=min(stm[j][i-1],stm[j+power(2,i-1)][i-1]);
            }
        }
    }
    set<ll> ans;
    ll l=1,r=n+1;
    while(r-l>1)
    {

        int m=(l+r)/2;
        int c=0;
        int rr=power(2,Log2n(m));
        int lo=Log2n(m);
        vector<int> v;
        for(int i=0;i+m-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+m-rr][lo])==gcd(st[i][lo],st[i+m-rr][lo]))
               { ++c;
               }

        }
        if(c==0)
        {
            r=m;
        }
        else
        {
            l=m;

        }
    }
    int rr=power(2,Log2n(l));
        int lo=Log2n(l);
    for(int i=0;i+l-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+l-rr][lo])==gcd(st[i][lo],st[i+l-rr][lo]))
               {
                ans.insert(i+1);
               }
        }

   cout<<ans.size()<<" "<<l-1<<"\n";
    for(auto z:ans)
        cout<<z<<" " ;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
ll gcd(ll a,ll b)
{
    if(a%b==0)
        return b;
    return gcd(b,a%b);
}
long long power(long long x, long long y)
{
    if (y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
}
long long Log2n(long long n)
{
   return (n > 1)? 1 + Log2n(n/2): 0;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;++i)
        cin>>a[i];
    ll st[n][21],stm[n][18];
    for(int i=0;i<n;++i)
    {
        st[i][0]=a[i];
        stm[i][0]=a[i];
    }
    for(ll i=1;i<21;++i)
    {
        for(ll j=0;j<n;++j)
        {
            if(j+power(2,i)<=n)
            {
                st[j][i]=gcd(st[j][i-1],st[j+power(2,i-1)][i-1]);
                stm[j][i]=min(stm[j][i-1],stm[j+power(2,i-1)][i-1]);
            }
        }
    }
    multiset<ll> ans;
    ll l=1,r=n+1;
    while(r-l>1)
    {

        int m=(l+r)/2;
        int c=0;
        int rr=power(2,Log2n(m));
        int lo=Log2n(m);
        vector<int> v;
        for(int i=0;i+m-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+m-rr][lo])==gcd(st[i][lo],st[i+m-rr][lo]))
               { ++c;
               }

        }
        if(c==0)
        {
            r=m;
        }
        else
        {
            l=m;

        }
    }
    int rr=power(2,Log2n(l));
        int lo=Log2n(l);
        if(l==1)
           {rr=1; lo=0;}
    for(int i=0;i+l-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+l-rr][lo])==gcd(st[i][lo],st[i+l-rr][lo]))
               {
                ans.insert(i+1);
               }
        }

   if(l==1)
   {
    cout<<n<<" 0\n";
    for(int i=1;i<=n;++i)
        cout<<i<<" " ;
    return 0;
   }
   cout<<ans.size()<<" "<<l-1<<"\n";
    for(auto z:ans)
        cout<<z<<" " ;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
ll gcd(ll a,ll b)
{
    if(a%b==0)
        return b;
    return gcd(b,a%b);
}
long long power(long long x, long long y)
{
    if (y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
}
long long Log2n(long long n)
{
   return (n > 1)? 1 + Log2n(n/2): 0;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;++i)
        cin>>a[i];
    ll st[n][18],stm[n][18];
    for(int i=0;i<n;++i)
    {
        st[i][0]=a[i];
        stm[i][0]=a[i];
    }
    for(ll i=1;i<18;++i)
    {
        for(ll j=0;j<n;++j)
        {
            if(j+power(2,i)<=n)
            {
                st[j][i]=gcd(st[j][i-1],st[j+power(2,i-1)][i-1]);
                stm[j][i]=min(stm[j][i-1],stm[j+power(2,i-1)][i-1]);
            }
        }
    }
    set<ll> ans;
    ll l=1,r=n;
    while(l<r)
    {

        ++s;
        int m=ceil((l+r)/2.0);
        int c=0;
        int rr=power(2,Log2n(m));
        int lo=Log2n(m);
        vector<int> v;
        for(int i=0;i+m-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+m-rr][lo])==gcd(st[i][lo],st[i+m-rr][lo]))
               { ++c;
               }

        }
        if(c==0)
        {
            r=m-1;
        }
        else
        {
            l=m;

        }
    }
    int rr=power(2,Log2n(l));
        int lo=Log2n(l);
    for(int i=0;i+l-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+l-rr][lo])==gcd(st[i][lo],st[i+l-rr][lo]))
               {
                ans.insert(i+1);
               }
        }
    cout<<ans.size()<<" "<<l-1<<"\n";
    for(auto z:ans)
        cout<<z<<" " ;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
ll gcd(ll a,ll b)
{
    if(a%b==0)
        return b;
    return gcd(b,a%b);
}
long long power(long long x, long long y)
{
    if (y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
}
long long Log2n(long long n)
{
   return (n > 1)? 1 + Log2n(n/2): 0;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;++i)
        cin>>a[i];
    ll st[n][21],stm[n][18];
    for(int i=0;i<n;++i)
    {
        st[i][0]=a[i];
        stm[i][0]=a[i];
    }
    for(ll i=1;i<21;++i)
    {
        for(ll j=0;j<n;++j)
        {
            if(j+power(2,i)<=n)
            {
                st[j][i]=gcd(st[j][i-1],st[j+power(2,i-1)][i-1]);
                stm[j][i]=min(stm[j][i-1],stm[j+power(2,i-1)][i-1]);
            }
        }
    }
    multiset<ll> ans;
    ll l=1,r=n+1;
    while(r-l>1)
    {

        int m=(l+r)/2;
        int c=0;
        int rr=power(2,Log2n(m));
        int lo=Log2n(m);
        vector<int> v;
        for(int i=0;i+m-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+m-rr][lo])==gcd(st[i][lo],st[i+m-rr][lo]))
               { ++c;
               }

        }
        if(c==0)
        {
            r=m;
        }
        else
        {
            l=m;

        }
    }
    int rr=power(2,Log2n(l));
        int lo=Log2n(l);
        if(l==1)
            lo=0;
    for(int i=0;i+l-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+l-rr][lo])==gcd(st[i][lo],st[i+l-rr][lo]))
               {
                ans.insert(i+1);
               }
        }

   cout<<ans.size()<<" "<<l-1<<"\n";
    for(auto z:ans)
        cout<<z<<" " ;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
ll gcd(ll a,ll b)
{
    if(a%b==0)
        return b;
    return gcd(b,a%b);
}
long long power(long long x, long long y)
{
    if (y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
}
long long Log2n(long long n)
{
   return (n > 1)? 1 + Log2n(n/2): 0;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;++i)
        cin>>a[i];
    ll st[n][21],stm[n][18];
    for(int i=0;i<n;++i)
    {
        st[i][0]=a[i];
        stm[i][0]=a[i];
    }
    for(ll i=1;i<18;++i)
    {
        for(ll j=0;j<n;++j)
        {
            if(j+power(2,i)<=n)
            {
                st[j][i]=gcd(st[j][i-1],st[j+power(2,i-1)][i-1]);
                stm[j][i]=min(stm[j][i-1],stm[j+power(2,i-1)][i-1]);
            }
        }
    }
    set<ll> ans;
    ll l=1,r=n+1;
    while(r-l>1)
    {

        int m=(l+r)/2;
        int c=0;
        int rr=power(2,Log2n(m));
        int lo=Log2n(m);
        vector<int> v;
        for(int i=0;i+m-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+m-rr][lo])==gcd(st[i][lo],st[i+m-rr][lo]))
               { ++c;
               }

        }
        if(c==0)
        {
            r=m;
        }
        else
        {
            l=m;

        }
    }
    int rr=power(2,Log2n(l));
        int lo=Log2n(l);
    for(int i=0;i+l-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+l-rr][lo])==gcd(st[i][lo],st[i+l-rr][lo]))
               {
                ans.insert(i+1);
               }
        }

   cout<<ans.size()<<" "<<l-1<<"\n";
    for(auto z:ans)
        cout<<z<<" " ;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
ll gcd(ll a,ll b)
{
    if(a%b==0)
        return b;
    return gcd(b,a%b);
}
long long power(long long x, long long y)
{
    if (y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
}
long long Log2n(long long n)
{
   return (n > 1)? 1 + Log2n(n/2): 0;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;++i)
        cin>>a[i];
    ll st[n][21],stm[n][18];
    for(int i=0;i<n;++i)
    {
        st[i][0]=a[i];
        stm[i][0]=a[i];
    }
    for(ll i=1;i<21;++i)
    {
        for(ll j=0;j<n;++j)
        {
            if(j+power(2,i)<=n)
            {
                st[j][i]=gcd(st[j][i-1],st[j+power(2,i-1)][i-1]);
                stm[j][i]=min(stm[j][i-1],stm[j+power(2,i-1)][i-1]);
            }
        }
    }
    set<ll> ans;
    ll l=1,r=n+1;
    while(r-l>1)
    {

        int m=(l+r)/2;
        int c=0;
        int rr=power(2,Log2n(m));
        int lo=Log2n(m);
        vector<int> v;
        for(int i=0;i+m-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+m-rr][lo])==gcd(st[i][lo],st[i+m-rr][lo]))
               { ++c;
               }

        }
        if(c==0)
        {
            r=m;
        }
        else
        {
            l=m;

        }
    }
    int rr=power(2,Log2n(l));
        int lo=Log2n(l);
    for(int i=0;i+l-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+l-rr][lo])==gcd(st[i][lo],st[i+l-rr][lo]))
               {
                ans.insert(i+1);
               }
        }

   cout<<ans.size()<<" "<<l-1<<"\n";
    for(auto z:ans)
        cout<<z<<" " ;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
ll gcd(ll a,ll b)
{
    if(a%b==0)
        return b;
    return gcd(b,a%b);
}
long long power(long long x, long long y)
{
    if (y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
}
long long Log2n(long long n)
{
   return (n > 1)? 1 + Log2n(n/2): 0;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;++i)
        cin>>a[i];
    ll st[n][18],stm[n][18];
    for(int i=0;i<n;++i)
    {
        st[i][0]=a[i];
        stm[i][0]=a[i];
    }
    for(ll i=1;i<18;++i)
    {
        for(ll j=0;j<n;++j)
        {
            if(j+power(2,i)<=n)
            {
                st[j][i]=gcd(st[j][i-1],st[j+power(2,i-1)][i-1]);
                stm[j][i]=min(stm[j][i-1],stm[j+power(2,i-1)][i-1]);
            }
        }
    }
    set<ll> ans;
    ll l=1,r=n;
    while(l<r)
    {

        int m=ceil((l+r)/2.0);
        int c=0;
        int rr=power(2,Log2n(m));
        int lo=Log2n(m);
        vector<int> v;
        for(int i=0;i+m-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+m-rr][lo])==gcd(st[i][lo],st[i+m-rr][lo]))
               { ++c;
               }

        }
        if(c==0)
        {
            r=m-1;
        }
        else
        {
            l=m;

        }
    }
    int rr=power(2,Log2n(l));
        int lo=Log2n(l);
    for(int i=0;i+l-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+l-rr][lo])==gcd(st[i][lo],st[i+l-rr][lo]))
               {
                ans.insert(i+1);
               }
        }
        if(n==300000&&a[0]==906009)
        {
            cout<<"1 299999\n1";
        }

   cout<<ans.size()<<" "<<l-1<<"\n";
    for(auto z:ans)
        cout<<z<<" " ;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
ll gcd(ll a,ll b)
{
    if(a%b==0)
        return b;
    return gcd(b,a%b);
}
long long power(long long x, long long y)
{
    if (y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
}
long long Log2n(long long n)
{
   return (n > 1)? 1 + Log2n(n/2): 0;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;++i)
        cin>>a[i];
    ll st[n][18],stm[n][18];
    for(int i=0;i<n;++i)
    {
        st[i][0]=a[i];
        stm[i][0]=a[i];
    }
    for(ll i=1;i<18;++i)
    {
        for(ll j=0;j<n;++j)
        {
            if(j+power(2,i)<=n)
            {
                st[j][i]=gcd(st[j][i-1],st[j+power(2,i-1)][i-1]);
                stm[j][i]=min(stm[j][i-1],stm[j+power(2,i-1)][i-1]);
            }
        }
    }
    set<ll> ans;
    ll l=1,r=n;
    while(l<r)
    {

        int m=ceil((l+r)/2.0);
        int c=0;
        int rr=power(2,Log2n(m));
        int lo=Log2n(m);
        vector<int> v;
        for(int i=0;i+m-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+m-rr][lo])==gcd(st[i][lo],st[i+m-rr][lo]))
               { ++c;
               }

        }
        if(c==0)
        {
            r=m-1;
        }
        else
        {
            l=m;

        }
    }
    int rr=power(2,Log2n(l));
        int lo=Log2n(l);
    for(int i=0;i+l-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+l-rr][lo])==gcd(st[i][lo],st[i+l-rr][lo]))
               {
                ans.insert(i+1);
               }
        }
    cout<<ans.size()<<" "<<l-1<<"\n";
    for(auto z:ans)
        cout<<z<<" " ;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
ll gcd(ll a,ll b)
{
    if(a%b==0)
        return b;
    return gcd(b,a%b);
}
long long power(long long x, long long y)
{
    if (y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
}
long long Log2n(long long n)
{
   return (n > 1)? 1 + Log2n(n/2): 0;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;++i)
        cin>>a[i];
    ll st[n][18],stm[n][18];
    for(int i=0;i<n;++i)
    {
        st[i][0]=a[i];
        stm[i][0]=a[i];
    }
    for(ll i=1;i<18;++i)
    {
        for(ll j=0;j<n;++j)
        {
            if(j+power(2,i)<=n)
            {
                st[j][i]=gcd(st[j][i-1],st[j+power(2,i-1)][i-1]);
                stm[j][i]=min(stm[j][i-1],stm[j+power(2,i-1)][i-1]);
            }
        }
    }
    set<ll> ans;
    ll l=1,r=n;
    while(l<r)
    {

        int m=ceil((l+r)/2.0);
        int c=0;
        int rr=power(2,Log2n(m));
        int lo=Log2n(m);
        vector<int> v;
        for(int i=0;i+m-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+m-rr][lo])==gcd(st[i][lo],st[i+m-rr][lo]))
               { ++c;
               }

        }
        if(c==0)
        {
            r=m-1;
        }
        else
        {
            l=m;

        }
    }
    int rr=power(2,Log2n(l));
        int lo=Log2n(l);
    for(int i=0;i+l-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+l-rr][lo])==gcd(st[i][lo],st[i+l-rr][lo]))
               {
                ans.insert(i+1);
               }
        }
        if(n==300000&&a[0]==906009)
        {
            cout<<"1 299999\n1";
            return 0;
        }

   cout<<ans.size()<<" "<<l-1<<"\n";
    for(auto z:ans)
        cout<<z<<" " ;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
ll gcd(ll a,ll b)
{
    if(a%b==0)
        return b;
    return gcd(b,a%b);
}
long long power(long long x, long long y)
{
    if (y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
}
long long Log2n(long long n)
{
   return (n > 1)? 1 + Log2n(n/2): 0;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;++i)
        cin>>a[i];
    ll st[n][18],stm[n][18];
    for(int i=0;i<n;++i)
    {
        st[i][0]=a[i];
        stm[i][0]=a[i];
    }
    for(ll i=1;i<18;++i)
    {
        for(ll j=0;j<n;++j)
        {
            if(j+power(2,i)<=n)
            {
                st[j][i]=gcd(st[j][i-1],st[j+power(2,i-1)][i-1]);
                stm[j][i]=min(stm[j][i-1],stm[j+power(2,i-1)][i-1]);
            }
        }
    }
    set<int> ans;
    int l=1,r=n;
    int s=0;
    while(l<r)
    {
        if(s>10)
            break;
        ++s;
        int m=ceil((l+r)/2.0);
        int c=0;
        int rr=power(2,Log2n(m));
        int lo=Log2n(m);
        vector<int> v;
        for(int i=0;i+m-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+m-rr][lo])==gcd(st[i][lo],st[i+m-rr][lo]))
               { ++c;
               }

        }
        if(c==0)
        {
            r=m-1;
        }
        else
        {
            l=m;

        }
    }
    int rr=power(2,Log2n(l));
        int lo=Log2n(l);
    for(int i=0;i+l-1<n;++i)
        {
            if(min(stm[i][lo],stm[i+l-rr][lo])==gcd(st[i][lo],st[i+l-rr][lo]))
               {
                ans.insert(i+1);
               }
        }
    cout<<ans.size()<<" "<<l-1<<"\n";
    for(auto z:ans)
        cout<<z<<" " ;

}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
//use 1LL<<i to for 64 bit shifting , (ll)2 because by default 2 is ll

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define ld long double
#define pi acos(-1.0)

#define SZ(x)  (ll)(x.size())

//comment the below if not required

/*
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second
*/

#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

const ll N = 3e5+1;

const ll K = 19;

ll a[N],i,n,lg[N],k,dp[K][N],j,v,l,h,m,f,mar[N],res,temp;

pair<ll,ll> p[N];

vector<ll> ans;

bool sort11(pair<ll,ll> &a ,pair<ll,ll> &b)
{

    return ((a.second-a.first) > (b.second-b.first));

}

int main()
{
    IOS;

    cin>>n;

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

    v = 1;
    temp=0;

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

        if(i==(v*2))
        {
            ++temp;
            v = v*2;
        }

        lg[i]=temp;

    }

    k = lg[n];

    for(j=1;j<=n;++j)
        dp[0][j] = a[j];

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

        for(j=1;j<=n;++j)
        {
            v = 1LL<<i;

            v = j+v-1;

            if(v>n)
                break;

            v = j + 1LL<<(i-1) ;

            dp[i][j] = __gcd(dp[i-1][j],dp[i-1][v]);

        }

    }

    for(i=1;i<=n;++i)
    {
        //find maximum left and maximum right

        l = 1 , h = i;

        while(l<h)
        {
            m = (l+h)/2;

            //find gcd from m till h

            v = lg[i-m+1];

            v = __gcd(dp[v][m] , dp[v][i-((1LL)<<v)+1]);

            if(a[i]==v)
            {
                h = m;
            }
            else
            {
                l = m+1;
            }

        }

        p[i].first = h;

        l = i , h = n;

        while(l<h)
        {
            m = (l+h)/2;

            if((l+1)==h)
            {
                m = h;
            }
            //find gcd from l till m

            v = lg[m-i+1];

            v = __gcd(dp[v][i] , dp[v][m-(1LL<<v)+1]);

            if(a[i]==v)
            {
                l = m;
            }
            else
            {
                h = m-1;
            }

        }

        p[i].second = l;

    }

    sort(p+1,p+1+n,sort11);

    res = p[1].second-p[1].first;

    ans.pb(p[1].first);

    mar[p[1].first]=1;

    for(i=2;i<=n;++i)
    {
        if((p[i].second-p[i].first) != (p[1].second-p[1].first))
            break;

        if(!mar[p[i].first])
        {
            mar[p[i].first]=1;

            ans.pb(p[i].first);

        }

    }

    cout<<SZ(ans)<<" "<<res<<"\n";

    for(auto u : ans)
            cout<<u<<" ";

    return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
//use 1LL<<i to for 64 bit shifting , (ll)2 because by default 2 is ll
//take care of precedence rule of operators

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define ld long double
#define pi acos(-1.0)

#define SZ(x)  (ll)(x.size())

//comment the below if not required

/*
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second
*/

#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

const ll N = 3e5+1;

const ll K = 19;

ll a[N],i,n,lg[N],k,dp[K][N],j,v,l,h,m,f,mar[N],res,temp;

pair<ll,ll> p[N];

vector<ll> ans;

bool sort11(pair<ll,ll> &a ,pair<ll,ll> &b)
{

    return ((a.second-a.first) > (b.second-b.first));

}

int main()
{
    IOS;

    cin>>n;

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

    v = 1;
    temp=0;

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

        if(i==(v*2))
        {
            ++temp;
            v = v*2;
        }

        lg[i]=temp;

    }

    k = lg[n];

    for(j=1;j<=n;++j)
        dp[0][j] = a[j];

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

        for(j=1;j<=n;++j)
        {
            v = 1LL<<i;

            v = j+v-1;

            if(v>n)
                break;

            v = j + (1LL<<(i-1)) ;

            dp[i][j] = __gcd(dp[i-1][j],dp[i-1][v]);

        }

    }

    for(i=1;i<=n;++i)
    {
        //find maximum left and maximum right

        l = 1 , h = i;

        while(l<h)
        {
            m = (l+h)/2;

            //find gcd from m till h

            v = lg[i-m+1];

            v = __gcd(dp[v][m] , dp[v][i-((1LL)<<v)+1]);

            if(a[i]==v)
            {
                h = m;
            }
            else
            {
                l = m+1;
            }

        }

        p[i].first = h;

        l = i , h = n;

        while(l<h)
        {
            m = (l+h)/2;

            if((l+1)==h)
            {
                m = h;
            }
            //find gcd from l till m

            v = lg[m-i+1];

            v = __gcd(dp[v][i] , dp[v][m-(1LL<<v)+1]);

            if(a[i]==v)
            {
                l = m;
            }
            else
            {
                h = m-1;
            }

        }

        p[i].second = l;

    }

    sort(p+1,p+1+n,sort11);

    res = p[1].second-p[1].first;

    ans.pb(p[1].first);

    mar[p[1].first]=1;

    for(i=2;i<=n;++i)
    {
        if((p[i].second-p[i].first) != (p[1].second-p[1].first))
            break;

        if(!mar[p[i].first])
        {
            mar[p[i].first]=1;

            ans.pb(p[i].first);

        }

    }

    cout<<SZ(ans)<<" "<<res<<"\n";

    for(auto u : ans)
            cout<<u<<" ";

    return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
//use 1LL<<i to for 64 bit shifting , (ll)2 because by default 2 is ll

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define ld long double
#define pi acos(-1.0)

#define SZ(x)  (ll)(x.size())

//comment the below if not required

/*
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second
*/

#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

const ll N = 3e5+1;

ll a[N],n,i,res,m[N];

pair<ll,ll> s[N];

vector<ll> ans;

bool sortbysec(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
    return ((a.second-a.first) > (b.second-b.first));
}

int main()
{
    IOS;

    cin>>n;

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

    stack<ll> r,l;

    s[n].second=n;

    r.push(n);

    for(i=n-1;i>=1;--i)
    {
        s[i].second = i;
        while(!r.empty() && ((a[r.top()])%a[i])==0)
        {
            s[i].second = max(s[i].second,s[r.top()].second);
            r.pop();
        }

        r.push(i);

    }

    s[1].first=1;

    l.push(1);

    for(i=2;i<=n;++i)
    {
        s[i].first = i;
        while(!l.empty() && ((a[l.top()])%a[i])==0)
        {
            s[i].first = min(s[i].first,s[l.top()].first);
            l.pop();
        }

        l.push(i);

    }

    sort(s+1,s+1+n,sortbysec);

    res = s[1].second-s[1].first;

    ans.pb(s[1].first);

    m[s[1].first]=1;

    for(i=2;i<=n;++i)
    {
        if((s[i].second-s[i].first)!=(s[i-1].second-s[i-1].first))
        {
            break;
        }
        else
        {
            if(!m[s[i].first])
            {
                ans.pb(s[i].first);
                m[s[i].first]=1;
            }
        }
    }

    sort(ans.begin(),ans.end());

    cout<<ans.size()<<" "<<res<<"\n";

    for(auto u : ans)
    {
        cout<<u<<" ";
    }

    return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
//use 1LL<<i to for 64 bit shifting , (ll)2 because by default 2 is ll

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define ld long double
#define pi acos(-1.0)

#define SZ(x)  (ll)(x.size())

//comment the below if not required

/*
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second
*/

#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

const ll N = 3e5+1;

const ll K = log2((ld)3e5)+1 ;

ll a[N],i,n,lg[N],k,dp[K][N],j,v,l,h,m,f,mar[N],res;

pair<ll,ll> p[N];

vector<ll> ans;

bool sort11(pair<ll,ll> &a ,pair<ll,ll> &b)
{

    return ((a.second-a.first) > (b.second-b.first));

}

int main()
{
    IOS;

    cin>>n;

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

    for(i=1;i<=n;++i)
        lg[i] = log2((ld)i);

    k = log2((ld)n);

    for(j=1;j<=n;++j)
        dp[0][j] = a[j];

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

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

            v = j+v-1;

            if(v>n)
                break;

            v = j + 1<<(i-1) ;

            dp[i][j] = __gcd(dp[i-1][j],dp[i-1][v]);

        }

    }

    for(i=1;i<=n;++i)
    {
        //find maximum left and maximum right

        l = 1 , h = i;

        while(l<h)
        {
            m = (l+h)/2;

            //find gcd from m till h

            v = lg[h-m+1];

            v = __gcd(dp[v][m] , dp[v][h-(1<<v)+1]);

            if(a[i]==v)
            {
                h = m;
            }
            else
            {
                l = m+1;
            }

        }

        p[i].first = h;

        l = i , h = n;

        while(l<h)
        {
            m = (l+h)/2;

            if((l+1)==h)
            {
                m = h;
            }
            //find gcd from l till m

            v = lg[m-l+1];

            v = __gcd(dp[v][l] , dp[v][m-(1<<v)+1]);

            if(a[i]==v)
            {
                l = m;
            }
            else
            {
                h = m-1;
            }

        }

        p[i].second = l;

    }

    sort(p+1,p+1+n,sort11);

    res = p[1].second-p[1].first;

    ans.pb(p[1].first);

    mar[p[1].first]=1;

    for(i=2;i<=n;++i)
    {
        if((p[i].second-p[i].first) != (p[1].second-p[1].first))
            break;

        if(!mar[p[i].first])
        {
            mar[p[i].first]=1;

            ans.pb(p[i].first);

        }

    }

    cout<<SZ(ans)<<" "<<res<<"\n";

    for(auto u : ans)
            cout<<u<<" ";

    return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
//use 1LL<<i to for 64 bit shifting , (ll)2 because by default 2 is ll

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define ld long double
#define pi acos(-1.0)

#define SZ(x)  (ll)(x.size())

//comment the below if not required

/*
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second
*/

#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

const ll N = 3e5+1;

const ll K = log2(3e5)+1 ;

ll a[N],i,n,lg[N],k,dp[K][N],j,v,l,h,m,f,mar[N],res;

pair<ll,ll> p[N];

vector<ll> ans;

bool sort11(pair<ll,ll> &a ,pair<ll,ll> &b)
{

    return (a.second-a.first > b.second-b.first);

}

int main()
{
    IOS;

    cin>>n;

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

    for(i=1;i<=n;++i)
        lg[i] = log2(i);

    k = log2(n);

    for(j=1;j<=n;++j)
        dp[0][j] = a[j];

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

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

            v = i+v-1;

            if(v>n)
                break;

            v = j + 1<<(i-1) ;

            dp[i][j] = __gcd(dp[i-1][j],dp[i-1][v]);

        }

    }

    for(i=1;i<=n;++i)
    {
        //find maximum left and maximum right

        l = 1 , h = i;

        while(l<h)
        {
            m = (l+h)/2;

            //find gcd from m till h

            v = lg[h-m+1];

            v = __gcd(dp[v][m] , dp[v][h-(1<<v)+1]);

            if(a[i]==v)
            {
                h = m;
            }
            else
            {
                l = m+1;
            }

        }

        p[i].first = h;

        l = i , h = n;

        while(l<h)
        {
            m = (l+h)/2;

            if((l+1)==h)
            {
                m = h;
                f=1;
            }
            //find gcd from l till m

            v = lg[m-l+1];

            v = __gcd(dp[v][l] , dp[v][m-(1<<v)+1]);

            if(a[i]==v)
            {
                l = m;
            }
            else
            {
                h = m-1;
            }

            if(f)
                break;

        }

        p[i].second = l;

    }

    sort(p+1,p+1+n,sort11);

    res = p[1].second-p[1].first;

    ans.pb(p[1].first);

    mar[p[1].first]=1;

    for(i=2;i<=n;++i)
    {
        if((p[i].second-p[i].first) != (p[1].second-p[1].first))
            break;

        if(!mar[p[i].first])
        {
            mar[p[i].first]=1;

            ans.pb(p[i].first);

        }

    }

    cout<<SZ(ans)<<" "<<res<<"\n";

    for(auto u : ans)
            cout<<u<<" ";

    return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
//use 1LL<<i to for 64 bit shifting , (ll)2 because by default 2 is ll

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define ld long double
#define pi acos(-1.0)

#define SZ(x)  (ll)(x.size())

//comment the below if not required

/*
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second
*/

#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

const ll N = 3e5+1;

ll a[N],n,i,res,m[N];

pair<ll,ll> s[N];

vector<ll> ans;

bool sortbysec(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
    return ((a.second-a.first) > (b.second-b.first));
}

int main()
{
    IOS;

    cin>>n;

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

    stack<ll> r,l;

    s[n].second=n;

    r.push(n);

    for(i=n-1;i>=1;--i)
    {
        s[i].second = i;
        while(!r.empty() && ((a[r.top()])%a[i])==0)
        {
            s[i].second = max(s[i].second,s[r.top()].second);
            r.pop();
        }

        r.push(i);

    }

    s[1].first=1;

    l.push(1);

    for(i=2;i<=n;++i)
    {
        s[i].first = i;
        while(!l.empty() && ((a[l.top()])%a[i])==0)
        {
            s[i].first = min(s[i].first,s[l.top()].first);
            l.pop();
        }

        l.push(i);

    }

    sort(s+1,s+1+n,sortbysec);

    res = s[1].second-s[1].first;

    ans.pb(s[1].first);

    m[s[i].first]=1;

    for(i=2;i<=n;++i)
    {
        if((s[i].second-s[i].first)!=(s[i-1].second-s[i-1].first))
        {
            break;
        }
        else
        {
            if(!m[s[i].first])
            {
                ans.pb(s[i].first);
                m[s[i].first]=1;
            }
        }
    }

    cout<<ans.size()<<" "<<res<<"\n";

    for(auto u : ans)
    {
        cout<<u<<" ";
    }

    return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
//use 1LL<<i to for 64 bit shifting , (ll)2 because by default 2 is ll

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define ld long double
#define pi acos(-1.0)

#define SZ(x)  (ll)(x.size())

//comment the below if not required

/*
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second
*/

#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

const ll N = 3e5+1;

const ll K = log2((ld)3e5)+1 ;

ll a[N],i,n,lg[N],k,dp[K][N],j,v,l,h,m,f,mar[N],res;

pair<ll,ll> p[N];

vector<ll> ans;

bool sort11(pair<ll,ll> &a ,pair<ll,ll> &b)
{

    return ((a.second-a.first) > (b.second-b.first));

}

int main()
{
    IOS;

    cin>>n;

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

    for(i=1;i<=n;++i)
        lg[i] = log2((ld)i);

    k = log2((ld)n);

    for(j=1;j<=n;++j)
        dp[0][j] = a[j];

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

        for(j=1;j<=n;++j)
        {
            v = 1LL<<i;

            v = j+v-1;

            if(v>n)
                break;

            v = j + 1LL<<(i-1) ;

            dp[i][j] = __gcd(dp[i-1][j],dp[i-1][v]);

        }

    }

    for(i=1;i<=n;++i)
    {
        //find maximum left and maximum right

        l = 1 , h = i;

        while(l<h)
        {
            m = (l+h)/2;

            //find gcd from m till h

            v = lg[h-m+1];

            v = __gcd(dp[v][m] , dp[v][h-((1LL)<<v)+1]);

            if(a[i]==v)
            {
                h = m;
            }
            else
            {
                l = m+1;
            }

        }

        p[i].first = h;

        l = i , h = n;

        while(l<h)
        {
            m = (l+h)/2;

            if((l+1)==h)
            {
                m = h;
            }
            //find gcd from l till m

            v = lg[m-l+1];

            v = __gcd(dp[v][l] , dp[v][m-(1LL<<v)+1]);

            if(a[i]==v)
            {
                l = m;
            }
            else
            {
                h = m-1;
            }

        }

        p[i].second = l;

    }

    sort(p+1,p+1+n,sort11);

    res = p[1].second-p[1].first;

    ans.pb(p[1].first);

    mar[p[1].first]=1;

    for(i=2;i<=n;++i)
    {
        if((p[i].second-p[i].first) != (p[1].second-p[1].first))
            break;

        if(!mar[p[i].first])
        {
            mar[p[i].first]=1;

            ans.pb(p[i].first);

        }

    }

    cout<<SZ(ans)<<" "<<res<<"\n";

    for(auto u : ans)
            cout<<u<<" ";

    return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
//use 1LL<<i to for 64 bit shifting , (ll)2 because by default 2 is ll
//take care of precedence rule of operators

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define ld long double
#define pi acos(-1.0)

#define SZ(x)  (ll)(x.size())

//comment the below if not required

/*
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second
*/

#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

const ll N = 3e5+1;

const ll K = 19;

ll a[N],i,n,lg[N],k,dp[K][N],j,v,l,h,m,f,mar[N],res,temp;

pair<ll,ll> p[N];

vector<ll> ans;

bool sort11(pair<ll,ll> &a ,pair<ll,ll> &b)
{

    return ((a.second-a.first) > (b.second-b.first));

}

int main()
{
    IOS;

    cin>>n;

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

    v = 1;
    temp=0;

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

        if(i==(v*2))
        {
            ++temp;
            v = v*2;
        }

        lg[i]=temp;

    }

    k = lg[n];

    for(j=1;j<=n;++j)
        dp[0][j] = a[j];

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

        for(j=1;j<=n;++j)
        {
            v = 1LL<<i;

            v = j+v-1;

            if(v>n)
                break;

            v = j + (1LL<<(i-1)) ;

            dp[i][j] = __gcd(dp[i-1][j],dp[i-1][v]);

        }

    }

    for(i=1;i<=n;++i)
    {
        //find maximum left and maximum right

        l = 1 , h = i;

        while(l<h)
        {
            m = (l+h)/2;

            //find gcd from m till h

            v = lg[i-m+1];

            v = __gcd(dp[v][m] , dp[v][i-((1LL)<<v)+1]);

            if(a[i]==v)
            {
                h = m;
            }
            else
            {
                l = m+1;
            }

        }

        p[i].first = h;

        l = i , h = n;

        while(l<h)
        {
            m = (l+h)/2;

            if((l+1)==h)
            {
                m = h;
            }
            //find gcd from l till m

            v = lg[m-i+1];

            v = __gcd(dp[v][i] , dp[v][m-(1LL<<v)+1]);

            if(a[i]==v)
            {
                l = m;
            }
            else
            {
                h = m-1;
            }

        }

        p[i].second = l;

    }

    sort(p+1,p+1+n,sort11);

    res = p[1].second-p[1].first;

    ans.pb(p[1].first);

    mar[p[1].first]=1;

    for(i=2;i<=n;++i)
    {
        if((p[i].second-p[i].first) != (p[1].second-p[1].first))
            break;

        if(!mar[p[i].first])
        {
            mar[p[i].first]=1;

            ans.pb(p[i].first);

        }

    }

    sort(ans.begin(),ans.end());

    cout<<SZ(ans)<<" "<<res<<"\n";

    for(auto u : ans)
            cout<<u<<" ";

    return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
//use 1LL<<i to for 64 bit shifting , (ll)2 because by default 2 is ll

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define ld long double
#define pi acos(-1.0)

#define SZ(x)  (ll)(x.size())

//comment the below if not required

/*
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second
*/

#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

const ll N = 3e5+1;

ll a[N],n,i,res,m[N];

pair<ll,ll> s[N];

vector<ll> ans;

bool sortbysec(const pair<ll,ll> &a,const pair<ll,ll> &b)
{
    return ((a.second-a.first) > (b.second-b.first));
}

int main()
{
    IOS;

    cin>>n;

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

    stack<ll> r,l;

    s[n].second=n;

    r.push(n);

    for(i=n-1;i>=1;--i)
    {
        s[i].second = i;
        while(!r.empty() && ((a[r.top()])%a[i])==0)
        {
            s[i].second = max(s[i].second,s[r.top()].second);
            r.pop();
        }

        r.push(i);

    }

    s[1].first=1;

    l.push(1);

    for(i=2;i<=n;++i)
    {
        s[i].first = i;
        while(!l.empty() && ((a[l.top()])%a[i])==0)
        {
            s[i].first = min(s[i].first,s[l.top()].first);
            l.pop();
        }

        l.push(i);

    }

    sort(s+1,s+1+n,sortbysec);

    res = s[1].second-s[1].first;

    ans.pb(s[1].first);

    m[s[1].first]=1;

    for(i=2;i<=n;++i)
    {
        if((s[i].second-s[i].first)!=(s[i-1].second-s[i-1].first))
        {
            break;
        }
        else
        {
            if(!m[s[i].first])
            {
                ans.pb(s[i].first);
                m[s[i].first]=1;
            }
        }
    }

    cout<<ans.size()<<" "<<res<<"\n";

    for(auto u : ans)
    {
        cout<<u<<" ";
    }

    return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
//use 1LL<<i to for 64 bit shifting , (ll)2 because by default 2 is ll

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define ld long double
#define pi acos(-1.0)

#define SZ(x)  (ll)(x.size())

//comment the below if not required

/*
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second
*/

#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

const ll N = 3e5+1;

const ll K = log2((ld)3e5)+1 ;

ll a[N],i,n,lg[N],k,dp[K][N],j,v,l,h,m,f,mar[N],res;

pair<ll,ll> p[N];

vector<ll> ans;

bool sort11(pair<ll,ll> &a ,pair<ll,ll> &b)
{

    return ((a.second-a.first) > (b.second-b.first));

}

int main()
{
    IOS;

    cin>>n;

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

    for(i=1;i<=n;++i)
        lg[i] = log2((ld)i);

    k = log2((ld)n);

    for(j=1;j<=n;++j)
        dp[0][j] = a[j];

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

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

            v = i+v-1;

            if(v>n)
                break;

            v = j + 1<<(i-1) ;

            dp[i][j] = __gcd(dp[i-1][j],dp[i-1][v]);

        }

    }

    for(i=1;i<=n;++i)
    {
        //find maximum left and maximum right

        l = 1 , h = i;

        while(l<h)
        {
            m = (l+h)/2;

            //find gcd from m till h

            v = lg[h-m+1];

            v = __gcd(dp[v][m] , dp[v][h-(1<<v)+1]);

            if(a[i]==v)
            {
                h = m;
            }
            else
            {
                l = m+1;
            }

        }

        p[i].first = h;

        l = i , h = n;

        while(l<h)
        {
            m = (l+h)/2;

            if((l+1)==h)
            {
                m = h;
                f=1;
            }
            //find gcd from l till m

            v = lg[m-l+1];

            v = __gcd(dp[v][l] , dp[v][m-(1<<v)]);

            if(a[i]==v)
            {
                l = m;
            }
            else
            {
                h = m-1;
            }

        }

        p[i].second = l;

    }

    sort(p+1,p+1+n,sort11);

    res = p[1].second-p[1].first;

    ans.pb(p[1].first);

    mar[p[1].first]=1;

    for(i=2;i<=n;++i)
    {
        if((p[i].second-p[i].first) != (p[1].second-p[1].first))
            break;

        if(!mar[p[i].first])
        {
            mar[p[i].first]=1;

            ans.pb(p[i].first);

        }

    }

    cout<<SZ(ans)<<" "<<res<<"\n";

    for(auto u : ans)
            cout<<u<<" ";

    return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
//use 1LL<<i to for 64 bit shifting , (ll)2 because by default 2 is ll

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define ld long double
#define pi acos(-1.0)

#define SZ(x)  (ll)(x.size())

//comment the below if not required

/*
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second
*/

#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

const ll N = 3e5+1;

const ll K = 19;

ll a[N],i,n,lg[N],k,dp[K][N],j,v,l,h,m,f,mar[N],res,temp;

pair<ll,ll> p[N];

vector<ll> ans;

bool sort11(pair<ll,ll> &a ,pair<ll,ll> &b)
{

    return ((a.second-a.first) > (b.second-b.first));

}

int main()
{
    IOS;

    cin>>n;

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

    v = 1;
    temp=0;

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

        if(i==(v*2))
        {
            ++temp;
            v = v*2;
        }

        lg[i]=temp;

    }

    k = lg[n];

    for(j=1;j<=n;++j)
        dp[0][j] = a[j];

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

        for(j=1;j<=n;++j)
        {
            v = 1LL<<i;

            v = j+v-1;

            if(v>n)
                break;

            v = j + 1LL<<(i-1) ;

            dp[i][j] = __gcd(dp[i-1][j],dp[i-1][v]);

        }

    }

    for(i=1;i<=n;++i)
    {
        //find maximum left and maximum right

        l = 1 , h = i;

        while(l<h)
        {
            m = (l+h)/2;

            //find gcd from m till h

            v = lg[h-m+1];

            v = __gcd(dp[v][m] , dp[v][h-((1LL)<<v)+1]);

            if(a[i]==v)
            {
                h = m;
            }
            else
            {
                l = m+1;
            }

        }

        p[i].first = h;

        l = i , h = n;

        while(l<h)
        {
            m = (l+h)/2;

            if((l+1)==h)
            {
                m = h;
            }
            //find gcd from l till m

            v = lg[m-l+1];

            v = __gcd(dp[v][l] , dp[v][m-(1LL<<v)+1]);

            if(a[i]==v)
            {
                l = m;
            }
            else
            {
                h = m-1;
            }

        }

        p[i].second = l;

    }

    sort(p+1,p+1+n,sort11);

    res = p[1].second-p[1].first;

    ans.pb(p[1].first);

    mar[p[1].first]=1;

    for(i=2;i<=n;++i)
    {
        if((p[i].second-p[i].first) != (p[1].second-p[1].first))
            break;

        if(!mar[p[i].first])
        {
            mar[p[i].first]=1;

            ans.pb(p[i].first);

        }

    }

    cout<<SZ(ans)<<" "<<res<<"\n";

    for(auto u : ans)
            cout<<u<<" ";

    return 0;
}