{"id":5173,"date":"2020-09-19T16:44:50","date_gmt":"2020-09-19T13:44:50","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=5173"},"modified":"2020-11-25T12:11:10","modified_gmt":"2020-11-25T09:11:10","slug":"e-olymp-8659-%d0%b1%d0%b0%d0%b9%d1%82%d0%b8%d0%ba-%d1%82%d0%b0-%d1%88%d0%b0%d1%85%d0%b8","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=5173","title":{"rendered":"e-olymp 8659. \u0411\u0430\u0439\u0442\u0438\u043a \u0442\u0430 \u0448\u0430\u0445\u0438"},"content":{"rendered":"<h1>\u0417\u0430\u0434\u0430\u0447\u0430<\/h1>\n<p>\u0412\u043a\u043e\u0442\u0440\u0435 \u0437\u0430\u043f\u0456\u0437\u043d\u0438\u0432\u0448\u0438\u0441\u044c \u043d\u0430 \u0443\u0440\u043e\u043a, \u0411\u0430\u0439\u0442\u0438\u043a, \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0447\u0438 \u043f\u043e\u0432\u0437 \u0456\u0433\u0440\u043e\u0432\u0443 \u043a\u0456\u043c\u043d\u0430\u0442\u0443, \u043f\u043e\u043c\u0456\u0442\u0438\u0432 \u0448\u0430\u0445\u043e\u0432\u0443 \u0434\u043e\u0448\u043a\u0443. \u041f\u043e\u0440\u0430\u0445\u0443\u0432\u0430\u0432 \u0443\u0441\u0456 \u043a\u043b\u0456\u0442\u0438\u043d\u043a\u0438 \u043d\u0430 \u043d\u0456\u0439, \u0456 \u0439\u043e\u043c\u0443 \u0441\u0442\u0430\u043b\u043e \u0446\u0456\u043a\u0430\u0432\u043e: \u0441\u043a\u0456\u043b\u044c\u043a\u0438 \u0440\u0456\u0437\u043d\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0456\u0432 \u0437\u0456 \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u044e $k(1 \\leqslant k \\leqslant n)$ \u043c\u043e\u0436\u043d\u0430 \u0440\u043e\u0437\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u043d\u0430 \u0434\u043e\u0448\u0446\u0456 \u0440\u043e\u0437\u043c\u0456\u0440\u0443 $n$.<\/p>\n<h2>\u0412\u0445\u0456\u0434\u043d\u0456 \u0434\u0430\u043d\u0456<\/h2>\n<p>\u041d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u0435 \u0447\u0438\u0441\u043b\u043e $n$ $( n\\leqslant 10000)$ \u0440\u043e\u0437\u043c\u0456\u0440 \u0448\u0430\u0445\u043e\u0432\u043e\u0457 \u0434\u043e\u0448\u043a\u0438.<\/p>\n<h2>\u0412\u0438\u0445\u0456\u0434\u043d\u0456 \u0434\u0430\u043d\u0456<\/h2>\n<p>\u0404\u0434\u0438\u043d\u0435 \u0447\u0438\u0441\u043b\u043e \u2013 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0440\u0456\u0437\u043d\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0456\u0432, \u044f\u043a\u0456 \u043c\u043e\u0436\u043d\u0430 \u0440\u043e\u0437\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u043d\u0430 \u0448\u0430\u0445\u043e\u0432\u0456\u0439 \u0434\u043e\u0448\u0446\u0456.<\/p>\n<h1>\u0422\u0435\u0441\u0442\u0438<\/h1>\n<table>\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<\/td>\n<td>14<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>10<\/td>\n<td>385<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>99<\/td>\n<td>328350<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>999<\/td>\n<td>332833500<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>10000<\/td>\n<td>333383335000<\/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:c++ decode:true\">\r\n\r\nimport java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\nimport java.util.Scanner;\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\tScanner i = new Scanner(System.in);\r\n\t\tlong n = i.nextInt();\r\n\t\tlong result = n*(n + 1)*(2*n + 1) \/ 6;\r\n\t\tSystem.out.println(result);\r\n\t}\r\n}\r\n<\/pre>\n<h1>\u0420\u0456\u0448\u0435\u043d\u043d\u044f<\/h1>\n<p>\u0412\u0438\u0440\u0456\u0448\u0438\u0442\u0438 \u0446\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u043e\u0436\u043d\u0430 \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e <a href=\"https:\/\/en.wikipedia.org\/wiki\/Square_pyramidal_number#:~:text=The%20first%20few%20square%20pyramidal,sequence%20A000330%20in%20the%20OEIS).&amp;text=This%20is%20a%20special%20case,proved%20by%20a%20mathematical%20induction.\" target=\"_blank\" rel=\"noopener noreferrer\">\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u0456\u0440\u0430\u043c\u0456\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430<\/a> &#8212; \u0447\u0438\u0441\u043b\u0430, \u044f\u043a\u0435 \u0432\u0438\u0441\u043b\u043e\u0432\u043b\u044e\u0454 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0456\u0432 \u0437 \u0440\u0456\u0437\u043d\u0438\u043c\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u0430\u043c\u0438 \u0432 \u0441\u0456\u0442\u0446\u0456 $n$*$n$. \u0417\u0430\u0433\u0430\u043b\u044c\u043d\u0430 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0434\u043b\u044f \u043f\u0456\u0440\u0430\u043c\u0456\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043f\u043e\u0440\u044f\u0434\u043a\u0443 $n$: $\\sum\\limits_{k = 1}^{n} k^{2} = \\frac{n(n+1)(2n+1)}{6}$. \u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0454\u043c\u043e \u0432\u0438\u0432\u0435\u0434\u0435\u043d\u0443 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0434\u043b\u044f \u043b\u0456\u043d\u0456\u0439\u043d\u043e\u0433\u043e \u043e\u0431\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044f, \u0449\u043e\u0431 \u043d\u0435 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0446\u0438\u043a\u043b\u0438 \u0456 \u0437\u043c\u0435\u043d\u0448\u0438\u0442\u0438 \u0447\u0430\u0441 \u0440\u043e\u0431\u043e\u0442\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438.<\/p>\n<h2>\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.e-olymp.com\/ru\/problems\/8659\" target=\"_blank\" rel=\"noopener noreferrer\">\u0423\u043c\u043e\u0432\u0430 (e-olymp)<\/a><\/li>\n<li><a href=\"https:\/\/ideone.com\/QxKxiQ\" target=\"_blank\" rel=\"noopener noreferrer\">\u041a\u043e\u0434 \u0440\u0456\u0448\u0435\u043d\u043d\u044f (Ideone)<\/a><\/li>\n<li><a href=\"https:\/\/www.e-olymp.com\/ru\/submissions\/7139636\" target=\"_blank\" rel=\"noopener noreferrer\">\u0417\u0430\u0440\u0430\u0445\u043e\u0432\u0430\u043d\u0435 \u0440\u0456\u0448\u0435\u043d\u043d\u044f<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0412\u043a\u043e\u0442\u0440\u0435 \u0437\u0430\u043f\u0456\u0437\u043d\u0438\u0432\u0448\u0438\u0441\u044c \u043d\u0430 \u0443\u0440\u043e\u043a, \u0411\u0430\u0439\u0442\u0438\u043a, \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0447\u0438 \u043f\u043e\u0432\u0437 \u0456\u0433\u0440\u043e\u0432\u0443 \u043a\u0456\u043c\u043d\u0430\u0442\u0443, \u043f\u043e\u043c\u0456\u0442\u0438\u0432 \u0448\u0430\u0445\u043e\u0432\u0443 \u0434\u043e\u0448\u043a\u0443. \u041f\u043e\u0440\u0430\u0445\u0443\u0432\u0430\u0432 \u0443\u0441\u0456 \u043a\u043b\u0456\u0442\u0438\u043d\u043a\u0438 \u043d\u0430 \u043d\u0456\u0439, \u0456 \u0439\u043e\u043c\u0443 \u0441\u0442\u0430\u043b\u043e \u0446\u0456\u043a\u0430\u0432\u043e: \u0441\u043a\u0456\u043b\u044c\u043a\u0438 \u0440\u0456\u0437\u043d\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0456\u0432 \u0437\u0456 \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u044e $k(1 \\leqslant k \\leqslant n)$ \u043c\u043e\u0436\u043d\u0430 \u0440\u043e\u0437\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u043d\u0430 \u0434\u043e\u0448\u0446\u0456 \u0440\u043e\u0437\u043c\u0456\u0440\u0443 $n$. \u0412\u0445\u0456\u0434\u043d\u0456 \u0434\u0430\u043d\u0456 \u041d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u0435 \u0447\u0438\u0441\u043b\u043e $n$ $( n\\leqslant 10000)$ \u0440\u043e\u0437\u043c\u0456\u0440 \u0448\u0430\u0445\u043e\u0432\u043e\u0457 \u0434\u043e\u0448\u043a\u0438. \u0412\u0438\u0445\u0456\u0434\u043d\u0456 \u0434\u0430\u043d\u0456 \u0404\u0434\u0438\u043d\u0435 \u0447\u0438\u0441\u043b\u043e \u2013 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=5173\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":174,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[719,716,611],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/5173"}],"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\/174"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5173"}],"version-history":[{"count":4,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/5173\/revisions"}],"predecessor-version":[{"id":5177,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/5173\/revisions\/5177"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}