/ OPS / 题库 /

Holiday Hotel

Holiday Hotel

#描述#
Mr. and Mrs. Smith are going to the seaside for their holiday. Before they start off, they need to choose a hotel. They got a list of hotels from the Internet, and want to choose some candidate hotels which are cheap and close to the seashore. A candidate hotel M meets two requirements: <br>
Any hotel which is closer to the seashore than M will be more expensive than M. <br>
Any hotel which is cheaper than M will be farther away from the seashore than M.

#格式#
##输入格式##
There are several test cases. The first line of each test case is an integer N (1 &lt= N &lt= 10000), which is the number of hotels. Each of the following N lines describes a hotel, containing two integers D and C (1 &lt= D, C &lt= 10000). D means the distance from the hotel to the seashore, and C means the cost of staying in the hotel. A test case with N = 0 ends the input, and should not be processed.

##输出格式##
For each test case, you should output one line containing an integer, which is the number of all the candidate hotels.

#样例1#
##样例输入1##

5
300 100
100 300
400 200
200 400
100 500
0

##样例输出1##

2

#限制#
1000ms
32768KB

#提示#

#来源#

信息

ID
1573
难度
5
分类
category1 点击显示
标签
递交数
0
已通过
0
通过率
?
上传者