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

Турниры > CEN303_2016Questions > задача:


HW081. 51044 - Number of Trees

CEN303_2016Questions

Старт: 28.окт.2016 в 17:00:00
Финиш: 01.ноя.2016 в 05:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (6)

Задачи турнира

• HW032. 51014 - Nine Men's Morris g...
• HW033. 50925 - Optimizing Elevator...
• HW051. 51019 - Finding the hidden...
• HW052. 51020 - Number of nodes r...
• HW061. 50448 - Paint Buckets
• HW062. 51021 - Number of Nodes
• HW071. 51042 - The most frequent ...
• HW072. 51043 - Genome Sequencing
• HW081. 51044 - Number of Trees
• HW082. 50699 - Fighting Vampires
• HW083. 50671 - Phalanx
• HW091. 51061 - The Longest Path
• HW101. 50682 - Hotel Durres
• HW102. 51067 - Jumping frog
• HW111. 50506 - The Biggest Island
• HW112. 50698 - Ayran Delivery
• PE11. 51023 - Preparing Keyword I...

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Number of Trees

Question: You have X-by-Y rectangular field and you want to plant trees. There are k parts in the field where you cannot plant anything. And, every tree requires at least w-square-meter. Write a program, that defines the maximum number of trees that you can plant.

Input specification: You will be given four integers in the beginning,

  • the width of the field (X)
  • the length of the field (Y)
  • the width required for every tree (w)
  • the number of objects in the field (k)
where 1 ≤ (X,Y) ≤ 10, 2 ≤ w ≤ 7 and 0 ≤ k ≤ 100. Then, each of the following k lines will have two integers (x, y) coordinates of k objects.

Output specification: Show one integer (the number of trees that can be planted).

Sample Input I
6 5 2 3
1 1
3 2
4 5
Sample Input II
6 5 3 3
1 1
3 2
4 5
Sample Output I
5
Sample Output II
2



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

www.contester.ru