Given sum of row size & column size, Determine the maximum number of values that can be stored?

Given K, the sum of row size & column  size of the matrix, compute the maximum number of values that can be stored.


For Example: 
If K=5, You have to find the row and column size
row = 3, column = 2
So, Maximum number of values that can be stored = 6

If K=6,
row can be '3' & column can be '3'
So, output = 9

If K=7
row can be '4' & column can be '3'
So, output = 12



Implementation: