#include #include #include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin>>n; vector r(n),g(n),b(n); for(int i = 0;i>r[i]; for(int i = 0;i>b[i]; for(int i = 0;i>g[i]; const int mx = 3e3 + 1; vector cb(mx,0),cg(mx,0); vector sum(mx+1,0); for(int i = 0;imx) ri = mx; if(le