Area of the box

given a box of element cables with dimensions row x columns. choose a x a groups for all such that 1<=a<=min(row,column).determine the number of ways the box of cables can be divided.

example
row=5
column=3

there are 35=15 ways to choose a 11 area of cables
there are 24=8 ways to choose a 22 area of cables
there are 13=3 ways to choose a 33 area of cables

in total there are 15+8+3=26 ways the box can be divided

i know it is done by recursion but i am not getting it please give me code of this problem

1 Like

hello @sahudilip138
pls share the question link with me.

aksing just to get more clarity of question.

solution is simpe.

answer=0
for a = 1 .....min(row,col) : 
      answer+=(row-a+1)*(col-a+1)

print answer

Can u pls elaborate on how to do this question?

Question Link Below

https://leetcode.com/discuss/interview-question/1811422/Area-of-the-box-HackerRank-code