{"id":4505,"date":"2018-12-26T14:13:13","date_gmt":"2018-12-26T11:13:13","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=4505"},"modified":"2018-12-27T18:10:50","modified_gmt":"2018-12-27T15:10:50","slug":"%d0%b0329-%d0%ba%d0%b2%d0%b0%d0%b4%d1%80%d0%b0%d1%82-%d1%81%d1%83%d0%bc%d0%bc%d1%8b-%d1%86%d0%b8%d1%84%d1%80-%d1%87%d0%b8%d1%81%d0%bb%d0%b0-2","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=4505","title":{"rendered":"\u0410329. \u041a\u0432\u0430\u0434\u0440\u0430\u0442 \u0441\u0443\u043c\u043c\u044b \u0446\u0438\u0444\u0440 \u0447\u0438\u0441\u043b\u0430"},"content":{"rendered":"<h1>\u0417\u0430\u0434\u0430\u0447\u0430<\/h1>\n<p><i>\u0417\u0430\u0434\u0430\u0447\u0430 \u0438\u0437 \u0441\u0431\u043e\u0440\u043d\u0438\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0410\u0431\u0440\u0430\u043c\u043e\u0432\u0430 \u0421.\u0410. 2000 \u0433.<\/i><br \/>\n\u0414\u0430\u043d\u044b \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 $n$, $m$. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043c\u0435\u043d\u044c\u0448\u0438\u0435 $n$ \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430, \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0441\u0443\u043c\u043c\u044b \u0446\u0438\u0444\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0432\u0435\u043d $m$.<\/p>\n<h2>\u0412\u0432\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u0414\u0432\u0430 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u043b\u0430 $n$ \u0438 $m$.<\/p>\n<h2>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u0412\u0441\u0435 \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0438\u0437 $(0,n)$, \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0449\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044e.<\/p>\n<h2>\u0422\u0435\u0441\u0442\u044b<\/h2>\n<table>\n<tr>\n<td>\n\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\n<\/td>\n<td>\n\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\n<\/td>\n<\/tr>\n<tr>\n<td>\n$1234$ $9$\n<\/td>\n<td>\n$3$ $12$ $21$ $30$ $102$ $111$ $120$ $201$ $210$ $300$ $1002$ $1011$ $1020$ $1101$ $1110$ $1200$\n<\/td>\n<\/tr>\n<tr>\n<td>\n$100$ $4$\n<\/td>\n<td>\n$2$ $11$ $20$\n<\/td>\n<\/tr>\n<tr>\n<td>\n$49$ $49$\n<\/td>\n<td>\n$7$ $16$ $25$ $34$ $43$\n<\/td>\n<\/tr>\n<tr>\n<td>\n$1000$ $1$\n<\/td>\n<td>\n$1$ $10$ $100$\n<\/td>\n<\/tr>\n<\/table>\n<h2>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h2>\n<pre class=\"lang:java decode:true \">import java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\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 in = new Scanner(System.in);\r\n    \tlong n, m, t, sum;\r\n    \tn = in.nextLong(); \r\n    \tm = in.nextLong();\r\n    \tfor(long i = 1; i &lt; n; i++) {\r\n        \tt = i;\r\n        \tsum = 0;\r\n\t        while(t != 0)\r\n\t            sum += t%10;\r\n\t            t \/= 10;\r\n\t        }\r\n        if(sum*sum == m) System.out.print(i + \" \");\r\n    \t}\r\n    }\r\n}<\/pre>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431 \u043d\u0430\u0439\u0442\u0438 \u043a\u0430\u0436\u0434\u0443\u044e \u0446\u0438\u0444\u0440\u0443 \u0447\u0438\u0441\u043b\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 $10$, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0446\u0438\u0444\u0440\u0430 \u0447\u0438\u0441\u043b\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0434\u0435\u043b\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u043d\u0430\u0446\u0435\u043b\u043e \u043d\u0430 $10$, \u0447\u0442\u043e\u0431 \u043f\u0440\u0435\u0434\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0446\u0438\u0444\u0440\u0430 \u0441\u0442\u0430\u043b\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439. \u0411\u0443\u0434\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u044d\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u043f\u043e\u043a\u0430 \u0447\u0438\u0441\u043b\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e $0$. \u0412\u0441\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0446\u0438\u0444\u0440\u044b \u0447\u0438\u0441\u043b\u0430 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c. \u0422\u0430\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u0443\u043c\u043c\u0443 \u0446\u0438\u0444\u0440 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 $1$ \u0434\u043e $n-1$, \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u0432\u043e\u0434\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0441\u0443\u043c\u043c\u0443 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044f \u0441 $m$.<\/p>\n<h2>\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p><a>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/a>(\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 135)<br \/>\n\u041a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 <a href=\"https:\/\/ideone.com\/lB1sii\">ideone.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0417\u0430\u0434\u0430\u0447\u0430 \u0438\u0437 \u0441\u0431\u043e\u0440\u043d\u0438\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0410\u0431\u0440\u0430\u043c\u043e\u0432\u0430 \u0421.\u0410. 2000 \u0433. \u0414\u0430\u043d\u044b \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 $n$, $m$. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043c\u0435\u043d\u044c\u0448\u0438\u0435 $n$ \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430, \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0441\u0443\u043c\u043c\u044b \u0446\u0438\u0444\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0432\u0435\u043d $m$. \u0412\u0432\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0414\u0432\u0430 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u043b\u0430 $n$ \u0438 $m$. \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412\u0441\u0435 \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0438\u0437 $(0,n)$, \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0449\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044e. \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 $1234$ $9$ $3$ $12$ $21$ &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=4505\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":132,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[614,615,574],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4505"}],"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\/132"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4505"}],"version-history":[{"count":3,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4505\/revisions"}],"predecessor-version":[{"id":4508,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4505\/revisions\/4508"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}