#include #define REP(i,n,N) for(int i=(n);i<(int) N;i++) #define p(s) cout<<(s)<>C[i]; ll d=C[3]; ll e=C[4]; ll h=C[7]; ll l=C[11]; ll o=C[14]; ll r=C[17]; ll w=C[22]; ll ans=d*e*h*r*w; ll mxl = 0, mxo = 0; REP(i,2,l){ ll tmp = (i*(i-1)/2) * (l-i); mxl=max(mxl,tmp); } REP(i,1,o){ ll tmp = i*(o-i); mxo=max(mxo,tmp); } ans *= mxl*mxo; p(ans); }