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. 2017蓝桥杯最大公共子串(C++B组)

    题目: 最大公共子串长度问题就是:求两个串的所有子串中能够匹配上的最大长度是多少.比如:"abcdkkk" 和 "baabcdadabc",可以找到的最长的公共 ...

  2. TP基础

    一.目录结构 解压缩到web目录下面,可以看到初始的目录结构如下: www WEB部署目录(或者子目录)├─index.php 入口文件├─README.md README文件├─Applicatio ...

  3. "着重内容"组件:<strong> —— 快应用组件库H-UI

     <import name="strong" src="../Common/ui/h-ui/text/c_tag_b"></import&g ...

  4. Struts2-学习笔记系列(15)-ajax支持和JSON

    7.1stream类型的result 使用stream就无需jsp页面,直接在action想浏览者生成指定的响应 @Override public java.lang.String execute() ...

  5. mybatis一级缓存让我憔悴

    Mybatis对缓存提供支持,是默认开启一级缓存. 来一段代码,这边使用的是mybatis-plus框架,通过构建 QueryWrapper 查询类来实现的. @Transactional publi ...

  6. Git敏捷开发--stash命令

    save 执行git stash,默认以commit info保存当前的stash信息 当在某个commit下,执行多次stash时,无法友好地区分每个stash的改动.save 命令可以清晰地标识每 ...

  7. 配置CORS代理请求

    参考资料: Vue-CLI 3.x 跨域问题处理 使用代理设置:见官方文档 配置代理 新建配置文件 在 package.json 文件的同级目录下创建 vue.config.js 文件,文件的格式应该 ...

  8. web测试流程

    1.立项后测试需要拿到文档(需求说明书,原型图,接口文档,) 2.需求评审 3.用例编写(主流程,备流程,异常流,业务规则,正常类,异常类,页面检查) 测试用例编写方法(等价类划分,边界值分析法,错误 ...

  9. 必须先理解的RocketMQ入门手册,才能再次深入解读

    RocketMQ入门手册 RocketMQ是一个分布式.队列模型的开源消息中间件,前身是MetaQ,是阿里研发的一个队列模型的消息中间件,后开源给apache基金会成为了apache的顶级开源项目,具 ...

  10. 小白初学Java的一点点收获

    作为刚刚学习Java没有几天的小白,我想把我在学习过程中,所学习到的知识和注意事项和大家一起分享分享.在这个过程中,希望大家可以有所收获,有什么不对的地方,希望大家指出并且私信我. 首先说说第一次记事 ...