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. [Maven] maven插件系列之maven-shade-plugin

    [Maven] maven插件系列之maven-shade-plugin 1 插件简述/Plugin Overview 1.1 定义与目的/Definition & Goals Officia ...

  2. Kong网关

    Kong网关 一.kong网关核心概念 1. Upstream upstream 对象表示虚拟主机名,可用于通过多个服务对传入请求进行负载远的 2. Target 目标ip地址/主机名,其端口表示后端 ...

  3. 文心一言 VS 讯飞星火 VS chatgpt (98)-- 算法导论9.3 4题

    四.用go语言,对一个包含n个元素的集合,假设一个算法只使用比较来确定第i小的元素,证明:无需额外的比较操作,它也能找到第 i-1 小的元素和第 n-i大的元素. 文心一言: 在这个问题中,我们要使用 ...

  4. c++枚举详细介绍以及具体用法

    C++ 中的枚举(Enumeration)是一种用于定义命名常量集合的数据类型.枚举可以提高代码的可读性和可维护性,让您可以使用有意义的名称来表示特定的取值,而不必使用原始的数字常量. 枚举的基本语法 ...

  5. Linux系列教程——Linux磁盘管理、Linux进程管理、Linux系统服务、 Linux计划任务

    @ 目录 1 Linux磁盘管理 1.磁盘的基本概念 1.什么是磁盘 2.磁盘的基本结构 3.磁盘的预备知识 1.磁盘的接口类型 2.磁盘的基本术语 3.磁盘在系统上的命名方式 4.磁盘基本分区Fdi ...

  6. Writing your first Django app, part 1

    Let's learn by example. Throughout this tutorial, we'll walk you through the creation of a basic pol ...

  7. python学习笔记(持续更新)

    一.对列表的操作 #建立一个列表 list = [1,2,3,4] #打印列表 print(list) #在列表尾部添加元素 list.append(5) #在指定位置插入元素 list.insert ...

  8. Android Studio里导入制作好的图片后,直接报错,图片名下方出现红色波浪线

    症状:Android Studio里导入制作好的图片后,直接报错,图片名下方出现红色波浪线. 比如:bk_Image_BackGround,报红 解决办法:如:bk_Image_BackGround, ...

  9. 关于长链剖分的数组实现 | CF1009F Dominant Indices

    请容许我不理解一下为什么这题题解几乎全都是指针实现/kk 其实长链剖分是可以直接用数组来写的. 考虑朴素 DP.设 \(f_{u,i}\) 表示以点 \(u\) 为根的子树中与点 \(u\) 距离为 ...

  10. CSS色域、色彩空间、CSS Color 4新标准

    引言 近期,三大主流浏览器引擎均发布最新版本,支持W3C的CSS Color 4标准,包含新的取色方法color()和相应语法,可展示更多的色域及色彩空间,这意味着web端能展示更丰富更高清的色彩.虽 ...