#include #include #include #include #include #include #include #define pb push_back #define all(x) begin(x),end(x) #define ll long long #define P pair #define lP pait using namespace std; int main() { int n; cin>>n; vector a(n),dp(n); for(int i=0;i>a[i]; } dp[0]=1000; for(int i=0;i