Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

input: standard input output: standard output A square of positive ( strictly greater than 0 ) area is located on the coordinate plane, with sides

input: standard input
output: standard output
A square of positive (strictly greater than 0) area is located on the coordinate plane, with sides parallel to the coordinate axes. You are given the coordinates of its corners, in random order. Your task is to find the area of the square.
Input
Each test consists of several testcases. The first line contains one integer )t(100- the number of testcases. The following is a description of the testcases.
Each testcase contains four lines, each line contains two integers )xi,yi(1000, coordinates of the corners of the square.
It is guaranteed that there is a square with sides parallel to the coordinate axes, with positive (strictly greater than 0) area, with corners in given points.
Output
For each test case, print a single integer, the area of the square.
Example
\table[[input,,],[3,2,],[4,5,],[1,5,],[4,2,],[-1,1,],[1,-1,],[1,1,],[-1,-1,],[45,11,],[45,39,],[17,11,],[17,39,],[output,,],[9,,],[4,,],[784,,]]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions

Question

22. Explain how CSMA/CA DCF works.

Answered: 1 week ago

Question

3. Identify cultural universals in nonverbal communication.

Answered: 1 week ago

Question

2. Discuss the types of messages that are communicated nonverbally.

Answered: 1 week ago