Problem Link #include <iostream> #include <cstring> using namespace std; typedef long int li; const int size = 201; int n; li arr[size]; int dp[size][size][size]; int main() { while(true) { cin >> n; if(n == -1) break; for(int i = 1; i <= n; i++) cin >> arr[i]; memset(dp, 0, sizeof(dp)); for(int i = 1; i <= n; i++) { for(int lb = i + 1; lb <= n + 1; lb++) { for(int lw = i + 1; lw <= n + 1; lw++) { ...