{"id":4808,"date":"2019-01-01T18:37:41","date_gmt":"2019-01-01T15:37:41","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=4808"},"modified":"2019-01-03T19:42:36","modified_gmt":"2019-01-03T16:42:36","slug":"e-olymp-7365-%d0%bc%d0%be%d0%bb%d0%be%d0%ba%d0%be-%d0%b8-%d0%bf%d0%b8%d1%80%d0%be%d0%b6%d0%be%d0%ba","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=4808","title":{"rendered":"e-olymp 7365. \u041c\u043e\u043b\u043e\u043a\u043e \u0438 \u043f\u0438\u0440\u043e\u0436\u043e\u043a"},"content":{"rendered":"<h1>\u0417\u0430\u0434\u0430\u0447\u0430<\/h1>\n<p>\u0423\u0447\u0435\u043d\u0438\u043a\u0430\u043c \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0430\u044e\u0442 \u0441\u0442\u0430\u043a\u0430\u043d \u043c\u043e\u043b\u043e\u043a\u0430 \u0438 \u043f\u0438\u0440\u043e\u0436\u043e\u043a, \u0435\u0441\u043b\u0438 \u0432\u0435\u0441 \u043f\u0435\u0440\u0432\u043e\u043a\u043b\u0430\u0441\u0441\u043d\u0438\u043a\u0430 \u043c\u0435\u043d\u0435\u0435 [latex]30 [\/latex] \u043a\u0433. \u0412 \u043f\u0435\u0440\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u0448\u043a\u043e\u043b\u044b \u0443\u0447\u0438\u0442\u0441\u044f [latex]n[\/latex] \u0443\u0447\u0435\u043d\u0438\u043a\u043e\u0432. \u0421\u0442\u0430\u043a\u0430\u043d \u043c\u043e\u043b\u043e\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u0435\u043c\u043a\u043e\u0441\u0442\u044c [latex]200 [\/latex] \u043c\u043b, \u0430 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u043c\u043e\u043b\u043e\u043a\u0430 &#8212; [latex]0,9 [\/latex] \u043b. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043c\u043e\u043b\u043e\u043a\u0430 \u0438 \u043f\u0438\u0440\u043e\u0436\u043a\u043e\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c.<\/p>\n<h1>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u0434\u0430\u043d\u043e \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e [latex]n[\/latex] [latex](0 &lt; n \u2264 100)[\/latex]. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438\u0434\u0443\u0442 [latex]n[\/latex] \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u2013 \u043c\u0430\u0441\u0441\u044b \u043f\u0435\u0440\u0432\u043e\u043a\u043b\u0430\u0441\u0441\u043d\u0438\u043a\u043e\u0432.<\/p>\n<h1>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>\u0412 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0434\u0432\u0430 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u043b\u0430 &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043c\u043e\u043b\u043e\u043a\u0430 \u0438 \u043f\u0438\u0440\u043e\u0436\u043a\u043e\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c.<\/p>\n<h1>\u0422\u0435\u0441\u0442\u044b<\/h1>\n<table>\n<tbody>\n<tr>\n<th>#<\/th>\n<th>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/th>\n<th>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/th>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td> 4 30 36 29 47 <\/td>\n<td> 1 1<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td> 5 30 36 29 47 26<\/td>\n<td> 1 2 <\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>8 30 36 29 47 26 27 30 31 <\/td>\n<td> 1 3<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>1 29<\/td>\n<td> 1 1<\/td>\n<\/tr>\n<td>5<\/td>\n<td> 5 26 27 28 29 25<\/td>\n<td> 2 5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h1>\n<pre class=\"lang:java decode:true \">import java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\nimport java.text.DecimalFormat;\r\n\r\n\r\nclass Main\r\n{\r\n\tpublic static void main (String[] args) throws java.lang.Exception\r\n\t{\r\n\t\tDecimalFormat format = new DecimalFormat();\r\n        format.setDecimalSeparatorAlwaysShown(false);\r\n\t\tdouble children ;\r\n\t\tdouble cakes = 0 ;\r\n\t\tdouble milk = 0; \r\n\t\tdouble child ;\r\n\t\tScanner in= new Scanner(System.in);\r\n\t\tchildren= in.nextDouble();\r\n    \twhile (in.hasNextDouble()){\r\n    \t\tchild= in.nextDouble();\r\n        \tif ( child &lt; 30) {\r\n            \tcakes++; \r\n            \tmilk += 2;\r\n        \t}\r\n\t\t}\r\n    \tSystem.out.print(format.format(Math.ceil(milk\/9)));\r\n    \tSystem.out.print(\" \");\r\n    \tSystem.out.print(format.format(cakes));\r\n    \t\r\n\t}\r\n}<\/pre>\n<h1>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h1>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0437\u043d\u0430\u0442\u044c: \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u043e\u043a \u043c\u043e\u043b\u043e\u043a\u0430 \u0438 \u043f\u0438\u0440\u043e\u0436\u043a\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0434\u0435\u0442\u0435\u0439.<br \/>\n\u0427\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0438\u0440\u043e\u0436\u043a\u043e\u0432 \u043c\u044b \u0437\u0430\u0432\u043e\u0434\u0438\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443, \u0435\u0441\u043b\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0440\u0435\u0431\u0435\u043d\u043e\u043a.<br \/>\n\u0410 \u0434\u043b\u044f \u043c\u043e\u043b\u043e\u043a\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 (0,2 \u0434\u043e\u043c\u043d\u043e\u0436\u0438\u043c \u043d\u0430 10 \u0438 0,9 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043c\u043d\u043e\u0436\u0438\u043c \u043d\u0430 10). \u0411\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0435\u0433\u043e \u0442\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u043c\u043e\u043b\u043e\u043a\u0430, \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u0434\u0435\u043b\u0438\u043c \u043d\u0430 9 \u0438 \u0443\u0437\u043d\u0430\u0435\u043c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0447\u0435\u043a \u043c\u043e\u043b\u043e\u043a\u0430 \u043d\u0443\u0436\u043d\u043e. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u043b\u043e\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0431\u044b\u0442\u044c \u0446\u0435\u043b\u044b\u043c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u043a\u0440\u0443\u0433\u043b\u044f\u0442\u044c \u0432\u0432\u0435\u0440\u0445.<br \/>\n\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430:<\/p>\n<ul>\n<li>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f \u0432\u0432\u0435\u0440\u0445:<\/li>\n<pre class=\"lang:java decode:true \">Math.ceil();<\/pre>\n<li>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 [latex]n.0[\/latex], \u0433\u0434\u0435 [latex]n[\/latex]- \u043b\u044e\u0431\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u041e\u0442\u0432\u0435\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c, \u043d\u043e, \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043a\u043e\u0434\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0430\u0439\u0442\u0430 e-olymp, \u043c\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u0447\u0442\u043e \u0432\u043e \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u043e\u0448\u0438\u0431\u043a\u0430. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c:\n<pre class=\"lang:java decode:true \">DecimalFormat format = new DecimalFormat();\r\nformat.setDecimalSeparatorAlwaysShown(false);\r\n\r\nformat.format(Math.ceil(milk\/9));<\/pre>\n<p>\u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438  java.text.DecimalFormat;<br \/>\n\u0414\u0430\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0442\u0438\u043f double.<\/li>\n<\/ul>\n<h1>\u0421\u0441\u044b\u043b\u043a\u0438<\/h1>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0430 <a href=\"https:\/\/www.e-olymp.com\/ru\/problems\/7365\">e-olymp<\/a><\/p>\n<p>\u041a\u043e\u0434 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 <a href=\"https:\/\/ideone.com\/3TqE7e\">ideone<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0423\u0447\u0435\u043d\u0438\u043a\u0430\u043c \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0430\u044e\u0442 \u0441\u0442\u0430\u043a\u0430\u043d \u043c\u043e\u043b\u043e\u043a\u0430 \u0438 \u043f\u0438\u0440\u043e\u0436\u043e\u043a, \u0435\u0441\u043b\u0438 \u0432\u0435\u0441 \u043f\u0435\u0440\u0432\u043e\u043a\u043b\u0430\u0441\u0441\u043d\u0438\u043a\u0430 \u043c\u0435\u043d\u0435\u0435 [latex]30 [\/latex] \u043a\u0433. \u0412 \u043f\u0435\u0440\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u0448\u043a\u043e\u043b\u044b \u0443\u0447\u0438\u0442\u0441\u044f [latex]n[\/latex] \u0443\u0447\u0435\u043d\u0438\u043a\u043e\u0432. \u0421\u0442\u0430\u043a\u0430\u043d \u043c\u043e\u043b\u043e\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u0435\u043c\u043a\u043e\u0441\u0442\u044c [latex]200 [\/latex] \u043c\u043b, \u0430 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u043c\u043e\u043b\u043e\u043a\u0430 &#8212; [latex]0,9 [\/latex] \u043b. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043c\u043e\u043b\u043e\u043a\u0430 \u0438 \u043f\u0438\u0440\u043e\u0436\u043a\u043e\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c. \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u0434\u0430\u043d\u043e \u0446\u0435\u043b\u043e\u0435 &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=4808\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":111,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[647,681,682,10,683],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4808"}],"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\/111"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4808"}],"version-history":[{"count":6,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4808\/revisions"}],"predecessor-version":[{"id":4814,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4808\/revisions\/4814"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}