• + 1 comment
    /* what's wrong with this code tle problem  */
    #include<bits/stdc++.h>
    using namespace std;
    long long gcd(long long a,long long b)
    {
     if(a==0)
        return b;
      return gcd(b%a,a);
    }
    long long fib(long long c)
     {
      if(c<=1)
        return c;
      return (fib(c-1)+fib(c-2));
     }
    int main()
    {
      long long int n,ans,p,q;
      cin>>n;
       long long int a[n];
     for(int i=0;i<n;i++)
        cin>>a[i];
      ans=a[0];
      for(int i=1;i<n;i++)
      ans=gcd(ans,a[i]);
       p=fib(ans);
       cout<<p%1000000007<<endl;
    }