{"id":172,"date":"2015-07-28T07:48:56","date_gmt":"2015-07-28T04:48:56","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=172"},"modified":"2015-08-18T07:36:07","modified_gmt":"2015-08-18T04:36:07","slug":"whitewashe","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=172","title":{"rendered":"Wallpainter"},"content":{"rendered":"<h1><strong>Task<\/strong><\/h1>\n<p> One construction company wants to minimize paint expenses. For this reason has to be made a program which can calculate an amount of a paint for the each order. Usually the owner know the longness <strong> L <\/strong>, wideness\u00a0<strong> W <\/strong>, and highness\u00a0<strong> H <\/strong> of the each room. Also one can of pain is good enough to paint\u00a016 m<sup>2<\/sup>, and the size of windows and doors are not important in this calculation<\/p>\n<h1><strong> \u00a0Input:\u00a0<\/strong><\/h1>\n<p>In the first line should be orders` amount. In the each next line &#8212;\u00a0<strong> L, W, H\u00a0<\/strong> and the wideness, longness, and highness are not more than <strong> 1000 <\/strong>.<\/p>\n<h1><strong> \u00a0Output:\u00a0<\/strong><\/h1>\n<p>For the each order will be shown one one number, what is required amount of the paint cans \u00a0<\/p>\n<h1>Tests<\/h1>\n<table border=\"2\">\n<tbody>\n<tr>\n<th>Input<\/th>\n<th>Output<\/th>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>\n<td><\/tr>\n<tr>\n<td>\u00a08 8 2<\/td>\n<td>4<\/td>\n<\/tr>\n<tr>\n<td>1 1 3<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>10 6 2<\/td>\n<td>4<\/td>\n<\/tr>\n<tr>\n<td>11 6 2<\/td>\n<td>5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1>Solution<\/h1>\n<p>Task &#171;<a href=\"http:\/\/www.e-olymp.com\/en\/problems\/500\" target=\"_blank\">Repair<\/a>&#187; can be solved by using Data Strim processing.<\/p>\n<pre class=\"lang:java decode:true \">import java.util.*;\r\nimport java.io.*;\r\n\r\nclass Main{\r\n\tpublic static void main (String[] args) throws java.lang.Exception{\r\n\t\tScanner s = new Scanner(System.in);\r\n\t\tdouble order = s.nextDouble();\r\n\t\tfor(int i = 0; i &lt; order; i++){\r\n\t\t\tdouble l = s.nextDouble();\r\n\t\t\tdouble w = s.nextDouble();\r\n\t\t\tdouble h = s.nextDouble();\r\n\t\t\tint quantity =(int)Math.ceil(h * (l + w) \/ 8);\r\n\t\t\tSystem.out.println(quantity);\r\n\t\t}\r\n\t}\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Task One construction company wants to minimize paint expenses. For this reason has to be made a program which can calculate an amount of a paint for the each order. Usually the owner know the longness L , wideness\u00a0 W , and highness\u00a0 H of the each room. Also one can of pain is good &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=172\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":174,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,13],"tags":[36,37],"jetpack_featured_media_url":"https:\/\/java.mazurok.com\/wp-content\/uploads\/7831144444_120fb091ce_z.jpg","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/172"}],"collection":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=172"}],"version-history":[{"count":13,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/172\/revisions"}],"predecessor-version":[{"id":232,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/172\/revisions\/232"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/media\/174"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}