codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

851B.md (1415B)


      1 Source: https://codeforces.com/problemset/problem/851/B
      2 
      3 B. Arpa and an exam about geometry
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 Arpa is taking a geometry exam. Here is the last problem of the exam.
     22 
     23 You are given three points *a*, *b*, *c*.
     24 
     25 Find a point and an angle such that if we rotate the page around the point by the angle, the new position of *a* is the same as the old position of *b*, and the new position of *b* is the same as the old position of *c*.
     26 
     27 Arpa is doubting if the problem has a solution or not (i.e. if there exists a point and an angle satisfying the condition). Help Arpa determine if the question has a solution or not.
     28 
     29 Input
     30 
     31 The only line contains six integers *a**x*, *a**y*, *b**x*, *b**y*, *c**x*, *c**y* (|*a**x*|, |*a**y*|, |*b**x*|, |*b**y*|, |*c**x*|, |*c**y*| ≤ 109). It's guaranteed that the points are distinct.
     32 
     33 Output
     34 
     35 Print "Yes" if the problem has a solution, "No" otherwise.
     36 
     37 You can print each letter in any case (upper or lower).
     38 
     39 Examples
     40 
     41 Input
     42 
     43 ```
     44 0 1 1 1 1 0
     45 ```
     46 
     47 Output
     48 
     49 ```
     50 Yes
     51 ```
     52 
     53 Input
     54 
     55 ```
     56 1 1 0 0 1000 1000
     57 ```
     58 
     59 Output
     60 
     61 ```
     62 No
     63 ```
     64 
     65 Note
     66 
     67 In the first sample test, rotate the page around (0.5, 0.5) by ![](https://espresso.codeforces.com/9d845923f4d356a48d8ede337db0303821311f0c.png).
     68 
     69 In the second sample test, you can't find any solution.