B. Cover Points

time limit per test1 second

memory limit per test256 megabytes

inputstandard input

outputstandard output

There are n points on the plane, (x1,y1),(x2,y2),…,(xn,yn).

You need to place an isosceles triangle with two sides on the coordinate axis to cover all points (a point is covered if it lies inside the triangle or on the side of the triangle). Calculate the minimum length of the shorter side of the triangle.

Input

First line contains one integer n (1≤n≤105).

Each of the next n lines contains two integers xi and yi (1≤xi,yi≤109).

Output

Print the minimum length of the shorter side of the triangle. It can be proved that it’s always an integer.

Examples

inputCopy

3

1 1

1 2

2 1

outputCopy

3

inputCopy

4

1 1

1 2

2 1

2 2

outputCopy

4

Note

Illustration for the first example:



Illustration for the second example:



题意是找一个三角形把所有点都覆盖,求等腰三角形最短边长。额他的长度因为是等腰直角三角型,很奇怪,最大的X+Y正好是最短边长。

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,a,b,max2=0;
cin>>n;
while(n--)
{
scanf("%d %d",&a,&b);
max2=max(a+b,max2);
}
cout<<max2<<endl;
return 0;
}

CodeForces - 1047B Cover Points的更多相关文章

  1. B. Cover Points Codeforces Round #511 (Div. 2)【数学】

    题目: There are nn points on the plane, (x1,y1),(x2,y2),…,(xn,yn)(x1,y1),(x2,y2),…,(xn,yn). You need t ...

  2. codeforces 19D D. Points 树套树

    D. Points Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/19/problem/D De ...

  3. codeforces B.Fixed Points

    link:http://codeforces.com/contest/347/problem/B 很简单,最多只能交换一次,也就是说,最多会增加两个.可能会增加一个.也可能一个也不增加(此时都是fix ...

  4. codeforces 577E E. Points on Plane(构造+分块)

    题目链接: E. Points on Plane time limit per test 2 seconds memory limit per test 256 megabytes input sta ...

  5. codeforces B. Fixed Points 解题报告

    题目链接:http://codeforces.com/problemset/problem/347/B 题目意思:给出一个包含n个数的排列a,在排列a中最多只能作一次交换,使得ai = i 这样的匹配 ...

  6. codeforces 19 D. Points(线段树+set二分)

    题目链接:http://codeforces.com/contest/19/problem/D 题意:给出3种操作:1)添加点(x,y),2)删除点(x,y),3)查询离(x,y)最近的右上方的点. ...

  7. Codeforces C Match Points(二分贪心)

    题目描述: Match Points time limit per test 2 seconds memory limit per test 256 mega bytes input standard ...

  8. Codeforces 871C 872E Points, Lines and Ready-made Titles

    题 OvO http://codeforces.com/contest/871/problem/C ( Codeforces Round #440 (Div. 1, based on Technocu ...

  9. CodeForces 1000C Covered Points Count(区间线段覆盖问题,差分)

    https://codeforces.com/problemset/problem/1000/C 题意: 有n个线段,覆盖[li,ri],最后依次输出覆盖层数为1~n的点的个数. 思路: 区间线段覆盖 ...

随机推荐

  1. 来,让我们一起来学习VIM

    什么是VIM vim是一个高度可定制的文本编辑器,被很多专业的程序员使用,并获得了程序员的一致好评. 下图是Vim的官网vim.org 你可以在Vim的官网免费下载并使用Vim,同样可以在Vim官网学 ...

  2. docker-compose容器中redis权限问题

    遇到的问题:aof文件不断变大,导致服务器卡崩溃. 1.在服务器上拉取Bitnami/redis的镜像 2.出现aof权限不够问题,所以直接给aof文件加了权限,导致aof不断变大,最终服务器宕机. ...

  3. Swing组件中URL方法获取 图标

    13.3.2 图标的使用 1.创建图标 package lll; import java.awt.*; import javax.swing.*; public class DrawIcon impl ...

  4. 中阶d03.4 JDBC_DAO

    1.环境准备(单项目下用,在大jdbc项目下只用配置一次) jdbc的驱动(mysqlxxjdbc.jar).util工具(包装释放资源.建立连接.访问properties文件等方法) 2.dao的概 ...

  5. Volatile可见性分析(一)

    JUC(java.util.concurrent) 进程和线程 进程:后台运行的程序(我们打开的一个软件,就是进程) 线程:轻量级的进程,并且一个进程包含多个线程(同在一个软件内,同时运行窗口,就是线 ...

  6. AJ学IOS(25)UI之触摸事件

    AJ分享,必须精品 iOS中的事件 在用户使用app过程中,会产生各种各样的事件;iOS中的事件可以分为3大类型: 响应者对象–UIResponder 在iOS中不是任何对象都能处理事件,只有继承了U ...

  7. PDF阅读器

    1.SumatraPDF 非常小巧,打开很轻快 2.PDF Reader by Xodo window商店中可以找到,很好用 3. PDFXChange Editor这是我迄今为止见过的最好的PDF编 ...

  8. mysql搭建亿级cmd5数据库,毫秒级查询 完全过程

    前言: 最近也在玩数据库,感觉普通机子搞数据库,还是差了点,全文查找,慢的要查一分钟更久. 但是搞cmd5库很不错,亿级数据库,毫秒级. qq 944520563好吧,下面开始,首先你得需要一个mys ...

  9. SQL入门,就这么简单

    随着时代的发展,人类活动产生的信息越来越多,大家常说,现在这个时代是大数据时代.在这样一个前提下,数据的存储成为我们必须要认真对待和研究的问题了.SQL(Structured Query Langua ...

  10. C++枚举算法

    枚举算法 什么是枚举? 枚举,顾名思义,就是用最笨的方法,去解决问题(暴力枚举),一个集的枚举是列出某些有穷序列集的所有成员的程序,或者是一种特定类型对象的计数.这两种类型经常(但不总是)重叠. 枚举 ...