{"id":3760,"date":"2018-11-04T21:34:40","date_gmt":"2018-11-04T18:34:40","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=3760"},"modified":"2018-11-19T21:38:56","modified_gmt":"2018-11-19T18:38:56","slug":"e-olymp-2501-%d0%ba%d1%80%d1%83%d0%b3%d0%be%d0%b2%d0%b0%d1%8f-%d0%b4%d0%b8%d0%b0%d0%b3%d1%80%d0%b0%d0%bc%d0%bc%d0%b0","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=3760","title":{"rendered":"e-olymp 2501. \u041a\u0440\u0443\u0433\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430"},"content":{"rendered":"<h1>\u0417\u0430\u0434\u0430\u0447\u0430<\/h1>\n<p><a href=\"http:\/\/cpp.mazurok.com\/wp-content\/uploads\/2018\/11\/1_1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/cpp.mazurok.com\/wp-content\/uploads\/2018\/11\/1_1-300x166.png\" alt=\"\" width=\"300\" height=\"166\" class=\"alignright size-medium wp-image-25203\" \/><\/a><br \/>\n\u0414\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u043e\u0439 \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0438 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0442\u0438\u043f\u043e\u0432 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u043a\u0440\u0443\u0433\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0447\u0438\u0441\u0435\u043b $a_1,\\ldots, a_n, \u0430$ \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u0440\u0443\u0433 \u0440\u0430\u0434\u0438\u0443\u0441\u0430 $r$, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0441\u0435\u043a\u0442\u043e\u0440\u044b. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u0447\u0438\u0441\u0435\u043b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u043e\u0434\u0438\u043d \u0441\u0435\u043a\u0442\u043e\u0440, \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430 \u044d\u0442\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443. \u041e\u0431\u0449\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0440\u0430\u0432\u043d\u0430 \u043f\u043b\u043e\u0449\u0430\u0434\u0438 \u043a\u0440\u0443\u0433\u0430.<\/p>\n<p>\u0412\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e \u043d\u0430\u0431\u043e\u0440\u0443 \u0447\u0438\u0441\u0435\u043b \u0438 \u043f\u043e \u0440\u0430\u0434\u0438\u0443\u0441\u0443 \u043a\u0440\u0443\u0433\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<h2>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0432\u0430 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u043b\u0430 $n$ \u0438 $r \\space (1 \\leq n, r \\leq 100)$. \u0412\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 $n$ \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b $a_1,\\ldots, a_n \\space (1 \\leq a_i \\leq 100 \\space \\forall \\space i = \\overline{1, n})$.<\/p>\n<h2>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 $n$ \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b &#8212; \u043f\u043b\u043e\u0449\u0430\u0434\u0438 \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0447\u0438\u0441\u043b\u0430\u043c $a_1,\\ldots, a_n$. \u0412\u044b\u0432\u043e\u0434\u0438\u0442\u0435 \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u0447\u0438\u0441\u0435\u043b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435.<\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u0447\u0438\u0441\u043b\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u044b \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435 \u0445\u0443\u0436\u0435 $10^{-6}$.<\/p>\n<h2>\u0422\u0435\u0441\u0442\u044b<\/h2>\n<table>\n<tbody>\n<tr>\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>\n3 2<br \/>\n1 4 3\n<\/td>\n<td>\n1.570796327<br \/>\n6.283185307<br \/>\n4.712388980\n<\/td>\n<\/tr>\n<tr>\n<td>\n2 3<br \/>\n3 8\n<\/td>\n<td>\n7.711181968<br \/>\n20.563151914\n<\/td>\n<\/tr>\n<tr>\n<td>\n4 5<br \/>\n2 5 9 1\n<\/td>\n<td>\n9.239978393<br \/>\n23.099945982<br \/>\n41.579902768<br \/>\n4.619989196\n<\/td>\n<\/tr>\n<tr>\n<td>\n5 9<br \/>\n4 16 8 20 11\n<\/td>\n<td>\n17.252135928<br \/>\n69.008543713<br \/>\n34.504271856<br \/>\n86.260679641<br \/>\n47.443373803\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h2>\n<pre class=\"lang:java decode:true \" title=\"e-olymp 2501. \u041a\u0440\u0443\u0433\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430\">import java.io.*;\r\nimport java.util.*;\r\n \r\npublic class Main\r\n{\r\n\tpublic static void main(String[] args) {\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tPrintWriter out = new PrintWriter(System.out);\r\n\t\t\r\n\t\tint n = in.nextInt();\r\n\t\tint r = in.nextInt();\r\n\t\tint sum = 0;\r\n\t\tdouble S;\r\n\t\tint[] x = new int[n];\r\n\t\tfor (int i = 0; i &lt; n; i++)\r\n\t\t\tx[i] = in.nextInt();\r\n\t\tfor (int i = 0; i &lt; n; i++)\r\n\t\t\tsum += x[i];\r\n\t\tS = Math.PI * r * r;\r\n\t\tfor (int i = 0; i &lt; n; i++)\r\n\t\t\tout.format(\"%.9f%n\", (S \/ sum) * x[i]);\r\n\t\t\r\n\t\tout.flush();\r\n\t}\r\n}<\/pre>\n<h1>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h1>\n<p>\u041d\u0430\u0439\u0434\u0435\u043c \u0441\u043f\u0435\u0440\u0432\u0430 \u0441\u0443\u043c\u043c\u0443 \u0432\u0441\u0435\u0445 \u0447\u0438\u0441\u0435\u043b $a_i$ \u0438 \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b (\u043f\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435 \u043f\u043b\u043e\u0449\u0430\u0434\u0438 \u043a\u0440\u0443\u0433\u0430). \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043b\u043e\u0449\u0430\u0434\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043d\u0430\u0448\u0435\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b, \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0432 \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043d\u0430 \u0440\u0430\u043d\u0435\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u0443\u044e \u0441\u0443\u043c\u043c\u0443 \u0438 \u0443\u043c\u043d\u043e\u0436\u0438\u0432 \u0438\u0445 \u0447\u0430\u0441\u0442\u043d\u043e\u0435 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0447\u0438\u0441\u043b\u043e $a_i$.<\/p>\n<h2>\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p><a href=\"https:\/\/www.e-olymp.com\/ru\/problems\/2501\">\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 e-olymp<\/a><br \/>\n<a href=\"https:\/\/ideone.com\/7YbkqW\">\u041a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 Ideone<\/a><br \/>\n<a href=\"http:\/\/cpp.mazurok.com\/e-olymp_2501\/\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 C++<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0414\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u043e\u0439 \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0438 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0442\u0438\u043f\u043e\u0432 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u043a\u0440\u0443\u0433\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0447\u0438\u0441\u0435\u043b $a_1,\\ldots, a_n, \u0430$ \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u0440\u0443\u0433 \u0440\u0430\u0434\u0438\u0443\u0441\u0430 $r$, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0441\u0435\u043a\u0442\u043e\u0440\u044b. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u0447\u0438\u0441\u0435\u043b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u043e\u0432\u043d\u043e &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=3760\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":114,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[196,410,395,411,412],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/3760"}],"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\/114"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3760"}],"version-history":[{"count":4,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/3760\/revisions"}],"predecessor-version":[{"id":3800,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/3760\/revisions\/3800"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}