dp[i7][i6][i5][i4][i3][i2][i1] where ij is no of yet to be decided losing teams in jth round. ij <= 2^{7-j}
$O(2^{21})$ states per testcase, 7 transitions for each state.
We start with dp[1][0][0][0][0][0]
Transitions looks like following dp[i7][i6][i5][i4][i3][i2][i1] -> dp[i7][i6][i5-1][i4+1][i3+1][i2+1][i1+1]+(1+2+3+4+5)*aj, notably we do not need index in dp state.
dp[i7][i6][i5][i4][i3][i2][i1]whereijis no of yet to be decided losing teams injthround.ij <= 2^{7-j}$O(2^{21})$ states per testcase, 7 transitions for each state.
We start with
dp[1][0][0][0][0][0]Transitions looks like following
dp[i7][i6][i5][i4][i3][i2][i1]->dp[i7][i6][i5-1][i4+1][i3+1][i2+1][i1+1]+(1+2+3+4+5)*aj, notably we do not need index in dp state.