{"id":4891,"date":"2019-02-24T17:36:45","date_gmt":"2019-02-24T14:36:45","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=4891"},"modified":"2019-04-11T00:40:33","modified_gmt":"2019-04-10T21:40:33","slug":"%d1%8e4-8","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=4891","title":{"rendered":"\u042e4.8"},"content":{"rendered":"<h3>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/h3>\n<p>\u0412 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 [latex]C(m)[\/latex] \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0440\u0435\u0442\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0441\u0443\u043c\u043c\u043e\u0439 \u0434\u0432\u0443\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445, \u0430 \u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043f\u0435\u0440\u0435\u0434 \u043d\u0438\u043c \u2014 \u043f\u043e\u043b\u0443\u0441\u0443\u043c\u043c\u043e\u0439 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0441 \u043d\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<h3>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p>1.\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e [latex]n[\/latex], \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u0441\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432 [latex]a[\/latex];<br \/>\n   2.\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0432\u043e\u0434\u0430 \u0437\u0430\u0434\u0430\u0435\u043c \u0434\u043b\u0438\u043d\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430;<br \/>\n   3.\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0446\u0438\u043a\u043b\u0430 \u0438 \u0432\u0432\u043e\u0434\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432;<br \/>\n   3.\u041c\u0435\u043d\u044f\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0440\u0435\u0442\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u043e \u0432\u0442\u043e\u0440\u043e\u0433\u043e;<br \/>\n   4.\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u043b\u0443\u0441\u0443\u043c\u043c\u0443 \u0434\u0432\u0443\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432;<br \/>\n   5.\u0411\u0435\u0440\u0435\u043c \u0447\u0438\u0441\u043b\u043e \u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u043f\u0435\u0440\u0435\u0434 \u0447\u0438\u0441\u043b\u043e\u043c \u043a\u0440\u0430\u0442\u043d\u044b\u043c \u0442\u0440\u0435\u043c;<br \/>\n   6.\u0417\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u043f\u043e\u043b\u0443\u0441\u0443\u043c\u043c\u0443 \u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u0440\u044f\u0434\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.\n<\/p>\n<h3>\u0422\u0435\u0441\u0442\u044b<\/h3>\n<table>\n<tbody>\n<tr>\n<td>\u041a\u043e\u043b-\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/td>\n<td>\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b<\/td>\n<td>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>5 9 1<\/td>\n<td>5 3 7<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>8 7 6 9 4 0<\/td>\n<td>8  7  7,5  9  4,5  6,5<\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td>2 5 7 3 6 9 4 6<\/td>\n<td> 2  4,5  3,5  3  6  4,5  4  5,5 5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h4>\n<pre class=\"lang:java decode:true \">import java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\n \r\nclass Ideone\r\n{\r\n\tpublic static void main (String[] args) throws java.lang.Exception\r\n\t{\r\n\t\tint n;\t\t\t\t\t\t\/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e n;\r\n\t\tdouble a[];\t\t\t\t\t\/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 a;\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tn = sc.nextInt();\t\t\t\t\/\/\u0412\u0432\u043e\u0434\u0438\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430;\r\n\t\ta = new double[n];\t\t\t\t\t\t\r\n\t\tfor(int i = 0; i &lt; n ; ++i){\r\n\t\t\ta[i] = sc.nextInt();\t\t\t\/\/\u0412\u0432\u043e\u0434\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430;\r\n\t\t}\r\n\t\tif(n &gt;= 3){\r\n\t\t\tfor(int i = 2; i &lt; n; i+=3){\r\n\t\t\t\tdouble tmp = a[i - 1];\r\n\t\t\t\ta[i - 1] = (a[i] + a[i - 2])\/2;\t\/\/\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u043b\u0443\u0441\u0443\u043c\u043c\u0443 \u0434\u0432\u0443\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432;\r\n\t\t\t\ta[i] = (tmp + a[i - 2])\/2;\t\/\/\u0417\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0447\u0438\u0441\u043b\u043e \u043a\u0440\u0430\u0442\u043d\u043e\u0435 \u0442\u0440\u0435\u043c \u043d\u0430 \u043f\u043e\u043b\u0443\u0441\u0443\u043c\u043c\u0443 \u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u0440\u044f\u0434\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432;\r\n\t\t\t}\r\n\t\t\tfor(int i = 0; i &lt; n ; ++i){\r\n\t\t\tSystem.out.println(a[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tsc.close();\r\n\t}\r\n}<\/pre>\n<p>\u041a\u043e\u0434 \u043d\u0430 <a href=\"https:\/\/ideone.com\/yl9UFE\">ideone.com.<\/a><\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421++(\u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0430) \u043d\u0430 <a href=\"http:\/\/cpp.mazurok.com\/\u044e4-8\/\"> java.mazurok.com.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0412 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 [latex]C(m)[\/latex] \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0440\u0435\u0442\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0441\u0443\u043c\u043c\u043e\u0439 \u0434\u0432\u0443\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445, \u0430 \u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043f\u0435\u0440\u0435\u0434 \u043d\u0438\u043c \u2014 \u043f\u043e\u043b\u0443\u0441\u0443\u043c\u043c\u043e\u0439 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0441 \u043d\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f 1.\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e [latex]n[\/latex], \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u0441\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432 [latex]a[\/latex]; 2.\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0432\u043e\u0434\u0430 \u0437\u0430\u0434\u0430\u0435\u043c \u0434\u043b\u0438\u043d\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430; 3.\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0446\u0438\u043a\u043b\u0430 \u0438 \u0432\u0432\u043e\u0434\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432; 3.\u041c\u0435\u043d\u044f\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0440\u0435\u0442\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u043e \u0432\u0442\u043e\u0440\u043e\u0433\u043e; &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=4891\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":129,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[41,111],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4891"}],"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\/129"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4891"}],"version-history":[{"count":4,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4891\/revisions"}],"predecessor-version":[{"id":4907,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4891\/revisions\/4907"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}