DMOPC '17 Contest 4 P0 - Catch

View as PDF

Submit solution


Points: 3
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

The problem statement is incorrect. The intent of the statement is to compute the square of the minimum pairwise distance between Alice, Bob, and Charlie. Anyone seriously affected by this mistake may ask to be unrated for this contest.

Alice, Bob, and Charlie are playing a game of catch. David wants to join, but he knows that he can't throw as far as Alice, Bob, or Charlie, so he requests to stand no further from Alice than Bob and Charlie, no further from Bob than Alice and Charlie, and no further from Charlie than Alice and Bob. If D represents the longest distance between David and any of the three other players, what is the maximum possible value of D^2?

Constraints

-100 \le x_1,x_2,x_3,y_1,y_2,y_3 \le 100

Input Specification

The first line of input will have two integers, x_1 and y_1, Alice's location.
The second line of input will have two integers, x_2 and y_2, Bob's location.
The third and final line of input will have two integers, x_3 and y_3, Charlie's location.

Output Specification

A single integer, the maximum value of D^2.

Sample Input

1 0
2 0
3 0

Sample Output

1

Explanation for Sample Output

The square of the pairwise distances are 1, 1, and 4. The smallest of these is 1.


Comments

There are no comments at the moment.