#include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF 100000 #define MAX 100000 #define MOD 1000000007 typedef long long ll; typedef pair P; typedef pair< pair, int> p; #define bit(n,k) ((n>>k)&1) /*nのk bit目*/ //https://yukicoder.me/submissions/392116 ll GCD(ll a,ll b){ return ((b==0) ? a:GCD(b,a%b)); } int main(){ int N; cin>>N; vector A(N); for(int i=0;i>A[i]; vector > dp(N); ll ans=0; for(int i=0;i