Loutraki
Loutraki has a beautiful beach in front of it and the Gerania mountains on the other side. A hotel in Loutraki is considered privileged when it has a view of both the sea and the mountain, meaning it has a clear view of both without any other hotel interfering in either direction.
We consider hotels as points on the plane with known coordinates and . Hotel obstructs the view of hotel if, on one coordinate, and have equal values, and on the other coordinate, has a smaller value than .
Problem:
Develop a program in one of the IOI languages which: after reading the number and coordinates of the hotels in Loutraki, will calculate how many privileged hotels there are.
Input File:
The input files named loutraki.in are text files with the following structure: The first line contains an integer , the number of hotels. Each of the next lines contains two integers and , separated by a single space, representing the coordinates of the corresponding hotel . There will be no two hotels located at the same point.
Output File:
The output files named loutraki.out are text files with the following structure: they have one line with exactly one number: the number of privileged hotels.
Examples of Input - Output Files:
STDIN (loutraki.in)
9
1 8
4 8
8 8
6 6
1 4
4 4
6 4
8 2
4 1
STDOUT (loutraki.out)
3
Explanation of the Example
The privileged hotels are: H5, H8 and H9.
Formatting: In the output, each line terminates with a newline
character.
Maximum execution time: 2 sec.
Maximum available memory: 64 MB.
Comments