ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Functions > задача:


50067 - The Number of Points in a Rectangle

Задачи сборника

• 50248 - School Mail Merge
• 50250 - Shifting rows and columns
• 50251 - Sum of the Biggest Neighbors
• 50253 - Max Discount
• 50265 - Palindrome-k
• 50013 - John's Tasks
• 50014 - Palindromes
• 50060 - Total Salary Paid
• 50067 - The Number of Points i...
• 50087 - Three Times
• 50112 - Random Numbers
• 50156 - Armstrong Numbers - 2
• 50157 - Palindromic Numbers
• 50019 - Pig Latin
• 50054 - Sum of the given digits
• 50063 - Palindromic Numbers
• 50075 - Random Password Generator

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Prepared by Ibrahim Mesecan. Сложность Альфа

The Number of Points in a Rectangle

For an experiment, your professor wants to count the number of points in his interest region.

Question:
Write a program that takes the position of a rectangle and coordinates of n points. The program will then count the number of points inside the rectangle.



Note:
  • If a point is on boder, it's count in the interest region.
  • point(1, 1) is in the upper left corner of the picture

Input specification
You will be first given two corners of the rectangle: 4 integers (x and y coordinates of two corners: corner1 and corner2). Then, the number of points (n) is given where 1 ≤ n ≤ 10000. And, next n lines contain two integers x and y representing the coordinates of the points which are between 1 and 10000.

Output specification
Show one integer number: the number of points in the rectangle

Sample Input   
  41 50 51 64
  6
  45 58
  47 15
  46 64
  36 52
  51 57
  24 13
Sample Output   
  3

Explanation
Only the points (45,58), (46,64) and (51,57) are in the interest region.


Для отправки решений необходимо выполнить вход.

www.contester.ru