Given a 3D NxNxN matrix, such that value of A[i][j][k] is defined as i * k * ( i + j +k )
1 <= i,j,k <= N
for ex= A[1][1][1] = 3, A[2][2][2] = 24
Given a number S.
Determine the max value of N such that:
Sum of all array elements doesn't exceed S.
for N = 2 , summation of Mat = 87
for N = 3 , Summation of Mat = 720 ( you can check that )
3 <= S <= 1e16
any solution with O(N^2) or better complexity ?