Problem Statement

There is a rectangle in the $xy$-plane. Each edge of this rectangle is parallel to the $x$- or $y$-axis, and its area is not zero.

Given the coordinates of three of the four vertices of this rectangle, $(x_1, y_1)$, $(x_2, y_2)$, and $(x_3, y_3)$, find the coordinates of the other vertex.

Constraints

  • $-100 \leq x_i, y_i \leq 100$
  • There uniquely exists a rectangle with all of $(x_1, y_1)$, $(x_2, y_2)$, $(x_3, y_3)$ as vertices, edges parallel to the $x$- or $y$-axis, and a non-zero area.
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

$x_1$ $y_1$
$x_2$ $y_2$
$x_3$ $y_3$

Output

Print the sought coordinates $(x, y)$ separated by a space in the following format:

$x$ $y$

Sample Input 1

-1 -1
-1 2
3 2

Sample Output 1

3 -1

The other vertex of the rectangle with vertices $(-1, -1), (-1, 2), (3, 2)$ is $(3, -1)$.


Sample Input 2

-60 -40
-60 -80
-20 -80

Sample Output 2

-20 -40

可以用异或找到不同的那一个。

#include<cstdio>
int x1,y1,x2,y2,x3,y3;
int main()
{
scanf("%d%d%d%d%d%d",&x1,&y1,&x2,&y2,&x3,&y3);
printf("%d %d",x1^x2^x3,y1^y2^y3);
}

[ABC246A] Four Points的更多相关文章

  1. 有理数的稠密性(The rational points are dense on the number axis.)

    每一个实数都能用有理数去逼近到任意精确的程度,这就是有理数的稠密性.The rational points are dense on the number axis.

  2. [LeetCode] Max Points on a Line 共线点个数

    Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. ...

  3. LeetCode:Max Points on a Line

    题目链接 Given n points on a 2D plane, find the maximum number of points that lie on the same straight l ...

  4. K closest points

    Find the K closest points to a target point in a 2D plane. class Point { public int x; public int y; ...

  5. 【leetcode】Max Points on a Line

    Max Points on a Line 题目描述: Given n points on a 2D plane, find the maximum number of points that lie ...

  6. Max Points on a Line

    Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. ...

  7. [LeetCode OJ] Max Points on a Line

    Max Points on a Line Submission Details 27 / 27 test cases passed. Status: Accepted Runtime: 472 ms ...

  8. [UCSD白板题] Points and Segments

    Problem Introduction The goal in this problem is given a set of segments on a line and a set of poin ...

  9. [UCSD白板题] Covering Segments by Points

    Problem Introduction You are given a set of segments on a line and your goal is to mark as few point ...

  10. [javascript svg fill stroke stroke-width points polygon属性讲解] svg fill stroke stroke-width points polygon绘制多边形属性并且演示polyline和polygon区别讲解

    <!DOCTYPE html> <html lang='zh-cn'> <head> <title>Insert you title</title ...

随机推荐

  1. c++算法:二分

    算法中,有一种比线性查找算力费得更少的一种算法思想,叫"分治",今天讲的是分治里的二分查找: 借助 (low+high)/2公式,找到搜索区域内的中间元素.图 1 中,搜索区域内中 ...

  2. 用ChatGPT三分钟免费做出数字人视频- 提升自媒体魅力

    本教程收集于:AIGC从入门到精通教程汇总 操作指引 ChatGPT产生文案=>腾讯智影数字人播报=>粘贴文案=>导出视频. 说明:部分资源只有会员才能用~,非会员可生成5分钟视频. ...

  3. ETL之apache hop系列3-hop Server环境部署与客户端发布管道工作流

    前言 该文档主要是apache hop 2.5的 Windows 10和Linux docker环境部署和客户端发布工作流和管道的相关内容 不使用Docker直接使用应用程序包,下载压缩包文件后,需要 ...

  4. 《SQLi-Labs》02. Less 6~10

    @ 目录 索引 Less-6 题解 原理 Less-7 题解 Less-8 题解 Less-9 题解 原理 Less-10 题解 sqli.开启新坑. 索引 Less-6:布尔盲注,字符型[" ...

  5. k8s 入门到实战--部署应用到 k8s

    背景 最近这这段时间更新了一些 k8s 相关的博客和视频,也收到了一些反馈:大概分为这几类: 公司已经经历过服务化改造了,但还未接触过云原生. 公司部分应用进行了云原生改造,但大部分工作是由基础架构和 ...

  6. Web自动化测试--selenium

    一.selenium介绍 Selenium 是支持web浏览器自动化的一系列工具和库的综合项目,能够进行自动化网页浏览器操作,广泛应用于测试和自动化行业.它可以模拟用户在浏览器中执行的操作,如点击按钮 ...

  7. Oracle-复制表结构存在的问题

    在生产中,创建一个新表tbl_A,要求与已有表结构tbl_B一致 create table tbl_A AS select * from tbl_B where 1=2; --拷贝表结构tbl_B给t ...

  8. DBA容灾与备份恢复:闪回应用及实践(一)

    闪回应用及实践 针对主机故障.网络故障.系统软件故障.存储介质故障.人为操作失误等各类故障,可以通过RAC.RMAN.Data Guard等成熟的解决方案来处理,不过对于人为操作失误防范的首推技术还是 ...

  9. 基于Python语言的KNN算法

    import operator import numpy as np # 鸢尾花的数据集 load_iris from sklearn.datasets import load_iris ''' 对测 ...

  10. [WPF]原生TabControl控件实现拖拽排序功能

    在UI交互中,拖拽操作是一种非常简单友好的交互.尤其是在ListBox,TabControl,ListView这类列表控件中更为常见.通常要实现拖拽排序功能的做法是自定义控件.本文将分享一种在原生控件 ...