#include <string>
#include <vector>
using namespace std;
int solution(vector<int> arrows) {
int answer = 0;
vector<int> keke(200001);
int a=100000;
int b=100000;
for(int i=1;i<=arrows.size();i++)
{
}
return answer;
}
#include <string>
#include <vector>
using namespace std;
int dp[501][501];
int kekeke(int x, int y, vector<vector<int>> triangle)
{
if(dp[x][y]!=0)
return dp[x][y];
if(y<0||y>=x)
return 0;
if(x==1)
return triangle[0][0];
return dp[x][y]=max(kekeke(x-1, y, triangle), kekeke(x-1, y-1, triangle))+triangle[x-1][y];
}
int solution(vector<vector<int>> triangle) {
int answer = 0;
int size=triangle.size();
for(int i=0;i<size;i++)
{
answer=max(answer, kekeke(size, i, triangle));
}
return answer;
}