Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. Question by Ibrahim Mesecan.
Number of Chairs - 2
Question:
Mr. Shehu is preparing for the wedding ceremony of
his son. He wants to arrange the event in their garden.
But he doesn't have enough tables and chairs at home.
He has asked tables and chairs from his neighbors.
Given the widths and lengths of n rectangular tables
and square chairs, find out how many chairs can fit
around all the tables?
Input specification
First you will be given an integer (n), the number of table-chair
pairs. Then in the following n lines,
you will be given three integers: the width (tw) and
length (tl) of the table and the width of a chair (cw)
where 9 cm ≤ (tw and tl) ≤ 280 cm and
15 cm ≤ cw ≤ 40 cm.
Note: All chairs around one table have the
same square shape.
Output specification
Find and show the number of chairs that can be placed
around all the tables.
Sample Input I
4
70 40 20
80 50 25
65 37 22
92 45 21
|
Sample Output I
38
|
Explanation:
There can be 10 chairs placed around the first table.
(70/20=>3 and 40/20=2 and (3+2)x2 =10)
Similarly, 10, 6, 12 can be placed around the other tables.
Для отправки решений необходимо выполнить вход.
|