Блог пользователя SyHoMadara

Автор SyHoMadara, история, 6 лет назад, По-английски

we have 3 points coordinate of 3 corners of specific rectangle fine the other point you can't use array. Input : in first 3 line we have $$$x_i , y_i$$$ of i-th point. Output : print $$$x_4 , y_4$$$.

example :
   input 
        1 2
        3 5
        3 2
   output 
        1 5

    input 
        11 26
        -2 7
        5 5
    output
        4 28
  • Проголосовать: нравится
  • -7
  • Проголосовать: не нравится

»
6 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +6 Проголосовать: не нравится

In a rectangle, their diagonals intersect at the midpoint

choose 2 points. find midpoint. Reflect the last point about it. This is a parallelogram.

Try all pairs. one of them has to be a rectangle