report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Three points - MarisaOJ: Marisa Online Judge

Three points

Time limit: 1000 ms
Memory limit: 256 MB
Given 3 points $A(x_A,y_A),B(x_B,y_B),C(x_C,y_C)$. Determine if they are collinear. If they are not, find the perimeter of the triangle formed by these points. ### Input - A single line contains six integers $x_A,y_A,x_B,y_B,x_C,y_C$. ### Output - Print `YES` if $A,B,C$ are collinear. Otherwise, respectively print `NO`, the perimeter. Your answer will be considered correct if its absolute or relative error does not exceed $10^{-3}$. In other words, your answer, $x$, will be compared to the correct answer, $y$. If $|x-y| < 10^{-3}$, then your answer will be considered correct. ### Constraints - $-10^9 \le x, y \le 10^9$. ### Example Input: ``` 0 0 0 1 1 0 ``` Output: ``` NO 3.414 ```
Geometry
Three points
Line segment intersection
Line intersection
Quadrilateral classification
Point location
Triangle classification
Polygon area
Distance to polygon
Convex hull
Perpendicular pairs
Maximum quadrilateral
Catching butterflies
Topic
Geometry
Rating 1000
Solution (0) Solution