Description
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:
Any hotel which is closer to the seashore than M will be more expensive than M.
Any hotel which is cheaper than M will be farther away from the seashore than M.
题意
给出 n 对形如 (dist, cost) 的整数对,组成集合A,挑出其中 m 对,组成集合B,集合B中的元素需要满足如下条件:
一、if A[i].dist < B[j].dist , then A[i].cost > B[j].cost
二、if A[i].cost < B[j].cost , then A[i].dist > B[j].dist
三、if A[i].dist == B[j].dist , then B[j].cost < A[i].cost, similar as A[i].cost == B[j].cost .
INPUT
头一行输入整数对的个数 N(1<= N <= 10000) ,之后的 N 行分别输入 N 对整数对 (dist, cost) 。
输入 N = 0 时结束程序。
OUTPUT
输出集合B中的元素个数 ,占一行。
思路
待做