
#include <bits/stdc++.h>
#include "grader.cpp"
using namespace std;
int tempo_massimo(int N, int a[], int b[]){
    vector<vector<int> >tempo(N, vector<int>(3));
    tempo[0][0] = 0;
    tempo[0][1] = a[0];
    tempo[0][2] = b[0];
    for(int i=1;i<N;i++){
    	tempo[i][0] = max(tempo[i-1][0], max( tempo[i-1][1], tempo[i-1][2]));
    	tempo[i][1] = a[i] + tempo[i][0];
    	tempo[i][2] = b[i] + tempo[i-1][0];
	}
	return max(max(tempo[N-1][0],tempo[N-1][1]),tempo[N-1][2]);
}
