{"id":1443,"date":"2016-10-11T13:54:48","date_gmt":"2016-10-11T10:54:48","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=1443"},"modified":"2016-11-06T17:32:07","modified_gmt":"2016-11-06T14:32:07","slug":"e-olymp-904-%d1%83%d0%b2%d0%b5%d0%bb%d0%b8%d1%87%d0%b8%d1%82%d1%8c-%d0%bd%d0%b0-2","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=1443","title":{"rendered":"e-olymp 904. \u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043d\u0430 2"},"content":{"rendered":"<h3>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h3>\n<p>\u0417\u0430\u0434\u0430\u043d \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 [latex]A[\/latex] \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b. \u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043d\u0430 [latex]2[\/latex]\n\u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u0435\u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<h3>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u0434\u0430\u043d\u043e \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e [latex]n[\/latex] \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 [latex]n &lt;= 100[\/latex]. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b \u0437\u0430\u0434\u0430\u043d\u044b \u0441\u0430\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 100.<\/p>\n<h3>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>\u0412 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b [latex]n[\/latex] \u0447\u0438\u0441\u0435\u043b: \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0432 \u0442\u043e\u043c \u0436\u0435 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0437\u0430\u0434\u0430\u043d\u044b.<\/p>\n<h3>\u041a\u043e\u0434<\/h3>\n<pre class=\"lang:java decode:true\">import java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\nclass Ideone\r\n{\r\n\tpublic static void main (String[] args) {\r\n\t\t\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\t\t\r\n\t\tint n = in.nextInt();\r\n\t\tint a = 0;\r\n\t\t\t\r\n\t\tfor(int i = 0; i &lt; n; i++){\r\n\t\t\ta = in.nextInt();\r\n\t\t\tSystem.out.printf(&quot;%d&quot;, (a &lt; 0)? a : a + 2);\t\r\n\t\t}\r\n}<\/pre>\n<h3>\u0422\u0435\u0441\u0442\u044b<\/h3>\n<table style=\"width: 299.95px;height: 323px\">\n<tbody>\n<tr style=\"height: 31px\">\n<td style=\"width: 132.567px;height: 31px\">\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/td>\n<td style=\"width: 152.583px;height: 31px\">\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/td>\n<\/tr>\n<tr style=\"height: 24px\">\n<td style=\"width: 132.567px;height: 24px\">4<br \/>\n1 2 3 4<\/td>\n<td style=\"width: 152.583px;height: 24px\">3 4 5 6<\/td>\n<\/tr>\n<tr style=\"height: 24px\">\n<td style=\"width: 132.567px;height: 24px\">4<br \/>\n1 2 3 -4<\/td>\n<td style=\"width: 152.583px;height: 24px\">3 4 5 -4<\/td>\n<\/tr>\n<tr style=\"height: 24px\">\n<td style=\"width: 132.567px;height: 24px\">4<br \/>\n-1 2 3 4<\/td>\n<td style=\"width: 152.583px;height: 24px\">-1 4 5 6<\/td>\n<\/tr>\n<tr style=\"height: 24px\">\n<td style=\"width: 132.567px;height: 24px\">4<br \/>\n0 2 3 4<\/td>\n<td style=\"width: 152.583px;height: 24px\">2 4 5 6<\/td>\n<\/tr>\n<tr style=\"height: 42.5333px\">\n<td style=\"width: 132.567px;height: 24px\">4<br \/>\n1 2 2 4<\/td>\n<td style=\"width: 152.583px;height: 24px\">4<br \/>\n1 2 2 4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412\u0432\u043e\u0434\u0438\u043c \u0447\u0438\u0441\u043b\u043e [latex]n[\/latex]. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0446\u0438\u043a\u043b for \u0438 \u0432\u0432\u043e\u0434\u0438\u043c \u0447\u0438\u0441\u043b\u043e [latex]a[\/latex]. \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u043d\u0435\u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e [latex]a[\/latex], \u043b\u0438\u0431\u043e \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043b\u0438\u0431\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043d\u0430 \u0434\u0432\u0430.<br \/>\n<a href=\"https:\/\/www.e-olymp.com\/ru\/submissions\/2820135\">e-olymp.com<\/a><br \/>\n<a href=\"http:\/\/ideone.com\/g0tRGm\">ideone.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u0417\u0430\u0434\u0430\u043d \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 [latex]A[\/latex] \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b. \u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043d\u0430 [latex]2[\/latex] \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u0435\u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \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 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e [latex]n[\/latex] \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 [latex]n &lt;= 100[\/latex]. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b \u0437\u0430\u0434\u0430\u043d\u044b \u0441\u0430\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 100. \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=1443\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":85,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[73,75],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/1443"}],"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\/85"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1443"}],"version-history":[{"count":37,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/1443\/revisions"}],"predecessor-version":[{"id":1616,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/1443\/revisions\/1616"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}