Calculate Smallest Bounding Rectangle Area - Cartesian Coordinates Program

  • Thread starter s_chaursia
  • Start date
In summary, the program needs to compute the area of the smallest bounding rectangle containing all the given points in a 2-dimensional plane. The input file may contain multiple test cases, each starting with a positive integer indicating the number of points. The input ends with a test case containing 0 for the number of points. For each test case, the output should be the area of the smallest bounding rectangle rounded to 4 decimal places.
  • #1
s_chaursia
3
0
Given the Cartesian coordinates of n (> 0) 2-dimensional points, write a program that
computes the area of their smallest bounding rectangle (smallest rectangle containing all the
given points).
Input
The input file may contain multiple test cases. Each test case begins with a line
containing a positive integer n (< 1001) indicating the number of points in this test case.
Then follows n lines each containing two real numbers giving respectively the x- and y
coordinates of a point. The input terminates with a test case containing a value 0 for n which
must not be processed.
Output
For each test case in the input print a line containing the area of the smallest bounding
Rectangle rounded to the 4th digit after the decimal point.
Sample Input
3
-3.000 5.000
17.000 9.000
17.000 5.000
4
10.000 10.000
10.000 20.000
20.000 20.000
20.000 10.000
0
Sample Output
80.0000
100.0000
 
Physics news on Phys.org
  • #2
Once again, please read the guide lines for this forum. No one here is going to do your work for you. If you want help, make a good effort, show us what you have done and where you got stuck and we will try to help.
 

1. What is "Help for question below"?

"Help for question below" is a phrase that is commonly used when seeking assistance or clarification on a specific question or problem. It is often used in online forums, discussion boards, and academic settings.

2. Why is "Help for question below" important in scientific research?

"Help for question below" is important in scientific research because it allows scientists to collaborate and share knowledge and resources. It also helps to ensure accuracy and validity of research findings by seeking input and feedback from others in the scientific community.

3. How can I effectively ask for "Help for question below"?

To effectively ask for "Help for question below", it is important to provide clear and concise information about the question or problem at hand. This includes providing relevant background information, stating the specific issue or question, and being open to feedback and suggestions from others.

4. Is there a specific format or platform for asking for "Help for question below" in scientific research?

There is no specific format or platform for asking for "Help for question below" in scientific research. It can be done through various means such as email, online forums, social media, or in-person discussions. However, it is important to consider the most appropriate and effective method for seeking help based on the nature of the question or problem.

5. How can "Help for question below" benefit my scientific research?

"Help for question below" can benefit your scientific research by providing valuable insights, perspectives, and resources that can improve the quality and impact of your work. It also allows for collaboration and networking opportunities within the scientific community.

Similar threads

Replies
24
Views
2K
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
21
Views
2K
  • Programming and Computer Science
Replies
1
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • General Math
Replies
16
Views
2K
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
4
Views
2K
Back
Top