{"id":5029,"date":"2020-09-12T20:00:48","date_gmt":"2020-09-12T17:00:48","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=5029"},"modified":"2020-09-13T21:31:53","modified_gmt":"2020-09-13T18:31:53","slug":"e-olymp-124-%d0%ba%d0%b2%d0%b0%d0%b4%d1%80%d0%b0%d1%82","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=5029","title":{"rendered":"e-olymp 124. \u041a\u0432\u0430\u0434\u0440\u0430\u0442"},"content":{"rendered":"<h1>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/h1>\n<p>\u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u043f\u0435\u0440\u0438\u043c\u0435\u0442\u0440 \u0438 \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430.<\/p>\n<p>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<br \/>\n\u041a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u043e\u043c \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0434\u043d\u043e \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e &#8212; \u0434\u043b\u0438\u043d\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430 $n$ (1 $\\leqslant$ $n$ $\\leqslant$ 1000).<\/p>\n<p>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<br \/>\n\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0435\u0440\u0438\u043c\u0435\u0442\u0440 \u0438 \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430.<\/p>\n<h1>\u0422\u0435\u0441\u0442\u044b<\/h1>\n<table style=\"height: 203px\" width=\"791\">\n<tbody>\n<tr>\n<td>\u2116<\/td>\n<td>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/td>\n<td>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>3<br \/>\n5<br \/>\n10<\/td>\n<td>12 9<br \/>\n20 25<br \/>\n40 100<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>3<br \/>\n3<br \/>\n3<\/td>\n<td>12 9<br \/>\n12 9<br \/>\n12 9<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>1000<br \/>\n1<br \/>\n500<\/td>\n<td>4000 1000000<br \/>\n4 1<br \/>\n2000 250000<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1>\u041a\u043e\u0434<\/h1>\n<pre class=\"lang:Java decode:true\">import java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\nimport java.util.Scanner;\r\n\r\npublic class Ideone{\r\n\tpublic static void main (String[] args) throws java.lang.Exception{\r\n\t\tint n,P,S;\r\n\t\tScanner myObj = new Scanner(System.in);\r\n\t\twhile(myObj.hasNext()){\r\n\t\t\tn = myObj.nextInt();\r\n\t\t\tP = 4*n;\r\n\t\t\tS = n*n;\r\n\t\t\tSystem.out.println(P + \" \"+ S);\r\n\t\t}\r\n\t\t\r\n\t}\r\n}<\/pre>\n<h1>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h1>\n<p>\u0423 \u043d\u0430\u0441 \u0434\u0430\u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430 $n$.<\/p>\n<ul>\n<li>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u0435\u0440\u0438\u043c\u0435\u0442\u0440 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0443 $P = 4n$.<\/li>\n<li>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0443 $S = n^{2}$.<\/li>\n<li>\u0422\u0430\u043a \u043a\u0430\u043a \u043a\u0430\u0436\u0434\u0430\u044f \u043d\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 &#8212; \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0438 \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <span class=\"lang:c++ decode:true crayon-inline \">myObj.hasNext()<\/span> \u0434\u043b\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<\/ul>\n<h1>\u0421\u0441\u044b\u043b\u043a\u0438<\/h1>\n<ul>\n<li>\u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/www.e-olymp.com\/ru\/problems\/124\">e-olymp<\/a><\/li>\n<li>\u043a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f <a href=\"https:\/\/ideone.com\/OvAEN7\">Ideone<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u043f\u0435\u0440\u0438\u043c\u0435\u0442\u0440 \u0438 \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430. \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u041a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u043e\u043c \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0434\u043d\u043e \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e &#8212; \u0434\u043b\u0438\u043d\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430 $n$ (1 $\\leqslant$ $n$ $\\leqslant$ 1000). \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0435\u0440\u0438\u043c\u0435\u0442\u0440 \u0438 \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430. \u0422\u0435\u0441\u0442\u044b \u2116 \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 1 3 5 10 12 9 20 &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=5029\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":172,"featured_media":5080,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[196,537,333,692],"jetpack_featured_media_url":"https:\/\/java.mazurok.com\/wp-content\/uploads\/16545476_3031.jpg","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/5029"}],"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\/172"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5029"}],"version-history":[{"count":2,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/5029\/revisions"}],"predecessor-version":[{"id":5031,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/5029\/revisions\/5031"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/media\/5080"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}