Short Approach:

You are given 4 types of Query. In each query, if you will be given -

  1. L, M, N and need to find out K . Then K = sqrt(L^2 - M^2 + N^2 )
  2. K, M, N and need to find out L . Then L = sqrt(K^2 + M^2 - N^2 )
  3. K, L, N and need to find out M . Then M = sqrt(-K^2 + L^2 + N^2 )
  4. K, L, M and need to find out N . Then N = sqrt(K^2 - L^2 + M^2 )

    Proof:

    Let ABCD is a Rectangle. Honey Drop is at O. Draw 4 perpendicular line from O on 4 side of the rectangle.
    Let they are, OW perpendicular on AD, OX perpendicular on AB, OY perpendicular on BC, OZ perpendicular on CD.


    Now, for triangle OBX and OAX we will have,
    OA^2 - AX^2 = OB^2 - BX^2 [ = OX^2 ]
    => AX^2 - BX^2 = OA^2 - OB^2
    And, for triangle ODZ and OCZ we will have,
    OD^2 - DZ^2 = OC^2 - ZC^2 [ = OZ^2 ]
    => DZ^2 - ZC^2 = OD^2 - OC^2

Now, AX = DZ and BX = CZ . So put values in any one eqn.
OD^2 - OC^2 = OA^2 - OB^2

Hence, we have any three of them and we can find put the rest one.

Statistics

83% Solution Ratio
IOI_StfuFfsEarliest, Mar '18
Kuddus.6068Fastest, 0.1s
minhazmirazLightest, 1.6 MB
CoderFolderShortest, 458B
Toph uses cookies. By continuing you agree to our Cookie Policy.