Home / Expert Answers / Computer Science / nbsp-nbsp-python-3-5-dividing-forest-there-is-a-rectangular-forest-with-a-total-of-m-pa768

(Solved):     python 3 5. Dividing forest There is a rectangular forest with a total of \( m \) ...



5. Dividing forest
There is a rectangular forest with a total of \( m \) * \( n \) trees planted, with a total of 3 species o

 

the remainder of \( 10 \mathrm{e} 9+7 \).

 

python 3

5. Dividing forest There is a rectangular forest with a total of \( m \) * \( n \) trees planted, with a total of 3 species of trees, number 1 means pine tree, 2 means poplar tree and 3 means willow tree. Now the forest needs to be divided into \( x \) parts for \( x \) people to take care of. The forest can be divided horizontally or vertically, and each division needs to divide the whole forest into two parts. If the division is horizontal, give the top one to one person and continue to divide the forest below; if the division is vertical, give the left one to one person and continue to divide the forest on the right. You need to make sure that each person has at least one poplar tree. Please calculate how many divisions there are in total. Since the answer may be a very large number, please return the result of taking the remainder of \( 10 \mathrm{e} 9+7 \). Example: Input forest \( =[[1,2,3] \), \( [2,1,2],[3,1,1]] \), number \( =3 \). Output: 4 the remainder of \( 10 \mathrm{e} 9+7 \).


We have an Answer from Expert

View Expert Answer

Expert Answer


psedo Codes: Starting of parent process if (fork()==0) // a new child process is successfully created. int childid=getpid(); // childid stores the chi

We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe