问题 C:数山峰

文件提交:无需freopen 内存限制:128 MB 时间限制:1.000 S
评测方式:普通裁判 命题人:
提交:7 解决:3

题目描述

在平面直角坐标系上有 lns="http://www.w3.org/1998/Math/MathML"> 座像山峰一样的图案。每座山峰是一个直角等腰三角形,它们的底边都是坐标系的X轴,第 lns="http://www.w3.org/1998/Math/MathML"> 座山峰的峰顶坐标为 lns="http://www.w3.org/1998/Math/MathML">(,)

如果一座山峰的峰顶在另一座山峰的内部,或者恰好在山峰的边界上,那么这座山峰就被遮蔽了。给定每个山峰的峰顶坐标,请统计有多少山峰是能被看见的。

输入

第一行:单个整数 lns="http://www.w3.org/1998/Math/MathML">
第二行到第 lns="http://www.w3.org/1998/Math/MathML">+1 行:第 lns="http://www.w3.org/1998/Math/MathML">+1 行两个整数,表示一个峰顶的坐标 lns="http://www.w3.org/1998/Math/MathML"> 与 lns="http://www.w3.org/1998/Math/MathML">


  • 对于 lns="http://www.w3.org/1998/Math/MathML">30% 的数据,lns="http://www.w3.org/1998/Math/MathML">11,000
  • 对于 lns="http://www.w3.org/1998/Math/MathML">60% 的数据,lns="http://www.w3.org/1998/Math/MathML">110,000
  • 对于 lns="http://www.w3.org/1998/Math/MathML">100% 的数据,lns="http://www.w3.org/1998/Math/MathML">1100,000
  • lns="http://www.w3.org/1998/Math/MathML">1,1,000,000,000


输出

单个整数:表示能被看到山峰数量。

样例输入-1 复制

4
1 1
2 2
4 1
4 2

样例输出-1 复制

2

提示

样例说明:(1,1)被(2,2)遮蔽,(4,1)被(4,2)遮蔽