Menu

[Solved]-Use Python Posted Question Third Time Hope Time Answered Q37252033

Usethe pythonI have posted the Question third time, hope this time will beanswered
Assignment 2: One day, farmer Peter got an agricultural land from his friend and he plans to divide the land into numbers ofPartition B PartitionA After investigated the land closely, Peter found that it is too difficult for him to work out the bestA. Write a program to output the numbers of possible fields (rectangle) that can be built on a given land. The sample input aB. Write a program to work out the largest farming areas of a given land. The largest farming area is the sum of all the possAssignment 2: One day, farmer Peter got an agricultural land from his friend and he plans to divide the land into numbers of field for planting different crops. The land has numbers of non-removable stones that can be used to build the partitions of fields. To make it simple, field will be in form of rectangle with its sides either parallels to x-axis or y- axis. The corners of a field must build on a stone. Fields can share partition and having stone placed inside but cannot be overlapped. For example, the land shown below got 9 stones in the middle and four possible fields can be made. Without overlapping, the final partition of land can be either partition A or B shown below. However, partition A is more preferable as it gives more area for farming. Partition B PartitionA After investigated the land closely, Peter found that it is too difficult for him to work out the best partition and therefore, he asks for your help again. As an engineering student, you decide to solve it by writing a computer program. Input: The first input would be the number of stones in the land, n, followed by n pairs of unsorted stone’s coordinate. The coordinate is inputted as x and y separated by a space, i.e. “x y”, with the origin on the bottom left corner of the land. Both n, x and y are integers. You may assume that n<100 and total number of possible fields in a given land should be less than 100. Example: 2 5 42 9 4 62 6 4 6 5 92 A. Write a program to output the numbers of possible fields (rectangle) that can be built on a given land. The sample input and output of 4 lands are shown below #1 #2 #4 #3 4 2 10 4 10 6 4 2 4 2 2 5 4 2 6 4 6 5 9 2 B. Write a program to work out the largest farming areas of a given land. The largest farming area is the sum of all the possible fields that can be built without overlapping with each other, i.e. the program should partition the land such that: Fields do not overlap with each other b. a. The total area of the fields is the largest possible framing area of the land. In case more than one partitioning have the largest farming area, select the one with larger individual fields. The program should output the number of non-overlapped fields, followed by the area of each field in a descending order. Input Output 10 2 5 4 2 9 2 9 6 10 4 10 6 2 5 4 2 3 4 2 12 2 5 4 2 9 4 6 2 6 4 6 5 9 2 Show transcribed image text Assignment 2: One day, farmer Peter got an agricultural land from his friend and he plans to divide the land into numbers of field for planting different crops. The land has numbers of non-removable stones that can be used to build the partitions of fields. To make it simple, field will be in form of rectangle with its sides either parallels to x-axis or y- axis. The corners of a field must build on a stone. Fields can share partition and having stone placed inside but cannot be overlapped. For example, the land shown below got 9 stones in the middle and four possible fields can be made. Without overlapping, the final partition of land can be either partition A or B shown below. However, partition A is more preferable as it gives more area for farming.
Partition B PartitionA After investigated the land closely, Peter found that it is too difficult for him to work out the best partition and therefore, he asks for your help again. As an engineering student, you decide to solve it by writing a computer program. Input: The first input would be the number of stones in the land, n, followed by n pairs of unsorted stone’s coordinate. The coordinate is inputted as x and y separated by a space, i.e. “x y”, with the origin on the bottom left corner of the land. Both n, x and y are integers. You may assume that n

Expert Answer


Answer to Use the pythonI have posted the Question third time, hope this time will be answered … . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *