#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long MOD = 1000000007; int N; vector A; vector X; long long func( int a, long long s ) { if ( X[a] != -1 ) { return X[a]+s; } vector B; for ( int i = 0; i < N; i++ ) { if ( ((1<> N; A.resize(N); X.resize(1<> A[i]; } cout << func( 0,0 ) << endl; return 0; }