CodeforcesRound #195 (Div.2) AVasilytheBearandTrian

Source: Internet
Author: User
Vasilythebearhasafavoriterectangle, ithasonevertexatpoint (0 ,? 0), andtheoppositevertexatpoint (x ,? Y). Ofcourse, thesidesofVasyasfavoriterectangleareparalleltothecoordinateaxes. Vasyaalsolovestriangles

Vasily the bear has a favorite rectangle, it has one vertex at point (0 ,? 0), and the opposite vertex at point (x ,? Y). Of course, the sides of Vasya's favorite rectangle are parallel to the coordinate axes. Vasya also loves triangles

Vasily the bear has a favorite rectangle, it has one vertex at point (0 ,? 0), and the opposite vertex at point (X,?Y). Of course, the sides of Vasya's favorite rectangle are parallel to the coordinate axes.

Vasya also loves triangles, if the triangles have one vertex at pointB? =? (0 ,? 0). That's why today he asks you to find two pointsA? =? (X1 ,?Y1) andC? =? (X2 ,?Y2), such that the following conditions hold:

  • The coordinates of points:X1,X2,Y1,Y2 are integers. Besides, the following inequation holds:X1? X2;
  • The triangle formed by pointA,BAndCIs rectangular and isosceles (is right );
  • All points of the favorite rectangle are located inside or on the border of triangleABC;
  • The area of triangleABCIs as small as possible.

Help the bear, find the required points. It is not so hard to proof that these points are unique.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.