{"id":4405,"date":"2018-12-25T15:35:17","date_gmt":"2018-12-25T12:35:17","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=4405"},"modified":"2018-12-25T21:10:38","modified_gmt":"2018-12-25T18:10:38","slug":"e-olymp-842-%d1%80%d0%b0%d0%b7%d0%bb%d0%be%d0%b6%d0%b5%d0%bd%d0%b8%d0%b5-%d0%bd%d0%b0-%d0%bf%d1%80%d0%be%d1%81%d1%82%d1%8b%d0%b5-%d0%bc%d0%bd%d0%be%d0%b6%d0%b8%d1%82%d0%b5%d0%bb%d0%b8","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=4405","title":{"rendered":"e-olymp 842. \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438"},"content":{"rendered":"<p><strong>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/strong><br \/>\n\u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 $n$ \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.<br \/>\n<strong>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 <\/strong><br \/>\n\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e $n (2 \\leq  n \\leq  2^{31} &#8212; 1).$<br \/>\n<strong>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 <\/strong><br \/>\n\u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0435\u0439 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043d\u0435\u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044f, \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u043a\u043e\u043c &#171;$*$&#187;.<br \/>\n<strong>\u0422\u0435\u0441\u0442\u044b <\/strong><\/p>\n<table style=\"width: 297px\">\n<tbody>\n<tr>\n<th style=\"width: 142px\">\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/th>\n<th style=\"width: 155px\">\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/th>\n<\/tr>\n<tr>\n<td style=\"width: 142px\">\n<h5>30<\/h5>\n<\/td>\n<td style=\"width: 155px\">\n<h5>2*3*5<\/h5>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 142px\">\n<h5>16<\/h5>\n<\/td>\n<td style=\"width: 155px\">\n<h5>2*2*2*2<\/h5>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 142px\">\n<h5>5<\/h5>\n<\/td>\n<td style=\"width: 155px\">\n<h5>5<\/h5>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/strong><\/p>\n<pre class=\"lang:java decode:true\" title=\"e-olymp 842. Prime factorization\">import java.io.BufferedReader;\r\nimport java.io.InputStreamReader;\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\tBufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));\r\n        String[] params1 = bufferedReader.readLine().split(\" \");\r\n        long numb, divisor = 2;\r\n        numb = Integer.parseInt(params1[0]);\r\n        while (divisor*divisor &lt;= numb)\r\n        {\r\n            if (numb%divisor == 0)\r\n            {\r\n                System.out.print(divisor);\r\n                numb = numb \/ divisor;\r\n                System.out.print('*');\r\n            }\r\n            else if (divisor == 2) divisor = 3;\r\n            else divisor = divisor + 2;\r\n        }\r\n        System.out.print(numb);\r\n\t}\r\n}<\/pre>\n<p><strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/strong><br \/>\n\u041f\u043e\u043a\u0430 \u043d\u0430\u0448\u0435 \u0447\u0438\u0441\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043b\u0438\u0431\u043e \u0440\u0430\u0432\u043d\u043e <code>divisor*divisor<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f:<\/p>\n<ol>\n<li>\u0415\u0441\u043b\u0438 <code>numb<\/code> \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430\u0446\u0435\u043b\u043e \u043d\u0430 <code>divisor<\/code>, \u043c\u044b \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u043d\u0430\u0448 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e <code>numb<\/code> \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 <code>divisor<\/code>;<\/li>\n<li>\u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435:<\/li>\n<ul>\n<li>\u0415\u0441\u043b\u0438 <code>divisor<\/code> \u0440\u0430\u0432\u0435\u043d $2$ , \u0442\u043e \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u0435\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 $3$ \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c;<\/li>\n<li>\u0412 \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0430 $2$;<\/li>\n<\/ul>\n<\/ol>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f $2$,$3$ \u0438 $5$, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u043c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0447\u0438\u0441\u0435\u043b.<br \/>\n<strong>\u0421\u0441\u044b\u043b\u043a\u0438<\/strong><br \/>\n\u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/www.e-olymp.com\/ru\/problems\/842\">e-olymp<\/a><br \/>\n\u041a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 <a href=\"https:\/\/ideone.com\/3RI8b0\">Ideone<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 $n$ \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0447\u0438\u0441\u0435\u043b. \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e $n (2 \\leq n \\leq 2^{31} &#8212; 1).$ \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0435\u0439 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043d\u0435\u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044f, \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u043a\u043e\u043c &#171;$*$&#187;. \u0422\u0435\u0441\u0442\u044b \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 30 2*3*5 16 2*2*2*2 5 5 \u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b import java.io.BufferedReader; import java.io.InputStreamReader; class Main &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=4405\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":112,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[592,591,590,75],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4405"}],"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\/112"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4405"}],"version-history":[{"count":1,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4405\/revisions"}],"predecessor-version":[{"id":4409,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4405\/revisions\/4409"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}