Arpa is taking a geometry exam. Here is the last problem of the exam.

You are given three points a, b, c.

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.

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.

Input

The only line contains six integers ax, ay, bx, by, cx, cy (|ax|, |ay|, |bx|, |by|, |cx|, |cy| ≤ 109). It's guaranteed that the points are distinct.

Output

Print "Yes" if the problem has a solution, "No" otherwise.

You can print each letter in any case (upper or lower).

Examples
input
  1. 0 1 1 1 1 0
output
  1. Yes
input
  1. 1 1 0 0 1000 1000
output
  1. No
Note

In the first sample test, rotate the page around (0.5, 0.5) by .

In the second sample test, you can't find any solution.

题意:三个点,从A B C找到一个圆形,通过旋转可以使得A到B这个位置,B到C这个位置

解法:

1 AB BC距离相等

2 大概想到是一个.....扇子..不能符合条件的只有三点共线的情况

  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. struct Node{
  4. long long x,y;
  5. }node[];
  6. long long dis(Node a,Node b){
  7. return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
  8. }
  9. int main(){
  10. for(int i=;i<=;i++){
  11. cin>>node[i].x>>node[i].y;
  12. }
  13.  
  14. long long a=(node[].x-node[].x)*(node[].y-node[].y);
  15. long long b=(node[].y-node[].y)*(node[].x-node[].x);
  16. if(a!=b&&(dis(node[],node[])==dis(node[],node[]))){
  17. cout<<"Yes"<<endl;
  18. }else{
  19. cout<<"No"<<endl;
  20. }
  21. return ;
  22. }

Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) B的更多相关文章

  1. D. Arpa and a list of numbers Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017)

    http://codeforces.com/contest/851/problem/D 分区间操作 #include <cstdio> #include <cstdlib> # ...

  2. Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017)ABCD

    A. Arpa and a research in Mexican wave time limit per test 1 second memory limit per test 256 megaby ...

  3. Codeforces Round #432 (Div. 1, based on IndiaHacks Final Round 2017) D. Tournament Construction(dp + 构造)

    题意 一个竞赛图的度数集合是由该竞赛图中每个点的出度所构成的集合. 现给定一个 \(m\) 个元素的集合,第 \(i\) 个元素是 \(a_i\) .(此处集合已经去重) 判断其是否是一个竞赛图的度数 ...

  4. 【前缀和】【枚举倍数】 Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) D. Arpa and a list of numbers

    题意:给你n个数,一次操作可以选一个数delete,代价为x:或者选一个数+1,代价y.你可以进行这两种操作任意次,让你在最小的代价下,使得所有数的GCD不为1(如果全删光也视作合法). 我们从1到m ...

  5. 【推导】【暴力】Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) C. Five Dimensional Points

    题意:给你五维空间内n个点,问你有多少个点不是坏点. 坏点定义:如果对于某个点A,存在点B,C,使得角BAC为锐角,那么A是坏点. 结论:如果n维空间内已经存在2*n+1个点,那么再往里面添加任意多个 ...

  6. 【推导】Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) B. Arpa and an exam about geometry

    题意:给你平面上3个不同的点A,B,C,问你能否通过找到一个旋转中心,使得平面绕该点旋转任意角度后,A到原先B的位置,B到原先C的位置. 只要A,B,C构成等腰三角形,且B为上顶点.那么其外接圆圆心即 ...

  7. Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) D

    Arpa has found a list containing n numbers. He calls a list bad if and only if it is not empty and g ...

  8. Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) C

    You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two poi ...

  9. Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) A

    Arpa is researching the Mexican wave. There are n spectators in the stadium, labeled from 1 to n. Th ...

随机推荐

  1. CC通信软件list

    bozokgh0stnanocoredarkcometponydarkcometadwindadzokaecomblacknixbluebananacorigaratdarkcometDRAThuig ...

  2. SpringMVC拦截器的配置与使用详解

         一.SpringMVC拦截器简介      Spring MVC的处理器拦截器类似于Servlet开发中的过滤器Filter,用于对处理器进行预处理和后处理.在springmvc中,定义拦截 ...

  3. CodeForces - 1000D:Yet Another Problem On a Subsequence (DP+组合数)

    The sequence of integers a1,a2,…,aka1,a2,…,ak is called a good array if a1=k−1a1=k−1 and a1>0a1&g ...

  4. 【Lintcode】177.Convert Sorted Array to Binary Search Tree With Minimal Height

    题目: Given a sorted (increasing order) array, Convert it to create a binary tree with minimal height. ...

  5. C++ ADO连接

    #include "stdafx.h" #include <iostream> #include <iomanip> #include "wind ...

  6. JQuery Mobile+cordova构建一个Android项目

    1.安装Android开发环境     Android开发环境的安装,现在主要是由于不能访问谷歌站点,在windows下在host文件中添加一个对应的74.125.195.190 dl-ssl.goo ...

  7. I/O:Unit1

    编程,从键盘读入学生成绩(0~100分),共15名学生,计算并显示总分.平均成绩.单的学生成绩 ; sum: avg: DATA1 SEGMENT STU DB ,,,,,,,,,,,,,, SUM ...

  8. 同时安装Python2与Python3,安装第三方包,老是报错

    同时安装Python2与Python3,安装第三方包,老是报错提示Fatal error in launcher: Unable to create process using '"',那可 ...

  9. Stored Procedures CASE 用法错误

    )) )     select @type=[type] from sys.objects with(nolock) where name=@ObjectName          case @typ ...

  10. SPFA算法——最短路径

    粗略讲讲SPFA算法的原理,SPFA算法是1994年西南交通大学段凡丁提出 是一种求单源最短路的算法 算法中需要用到的主要变量 int n;  //表示n个点,从1到n标号 int s,t;  //s ...