TINT-Editorial

PROBLEM LINK:

CONTEST

PRACTICE

Author:Mahak Abroal

Tester: Akansha Bigasia

Editorialist:Mahak Abroal


DIFFICULTY:

EASY-MEDIUM

PREREQUISITES:

Coordinate Geometry

PROBLEM:

In this question, there are two rods arranged in plus shaped, on which the balls are placed.
We need to find the maximum distance possible among all the balls present on the two rods placed in “plus-shaped” manner.

QUICK EXPLANATION:

We have to find all the possible distances and the maximum among these will be the maximum distance possible with the given co-ordinates.

EXPLANATION:

Since all the balls are present on the cross which can be viewed as the x-axis or y-axis. So, the co-ordinates can be as (x’,0) and (0,y’)
for x-axis and y-axis respectively where x’ and y’ represent their respective position on x-axis and y-axis.
Here the maximum distance will be one out of the following possible cases:

• The distance between the maximum and minimum co-ordinates of x-axis.

• The distance between the maximum and minimum co-ordinates of y-axis.

• The distance between the maximum co-ordinate of x-axis and minimum co-ordinate of y-axis.

• The distance between the maximum co-ordinate of y-axis and minimum co-ordinate of x-axis.

• The distance between the maximum co-ordinate of x-axis and maximum co-ordinate of y-axis.

• The distance between the minimum co-ordinate of x-axis and minimum co-ordinate of y-axis.


We have to find all these 6 distances and the maximum among these will be the maximum distance possible with the given co-ordinates.

AUTHOR’S AND TESTER’S SOLUTIONS:

The solution can be found here.