{"id":4647,"date":"2018-12-27T20:47:01","date_gmt":"2018-12-27T17:47:01","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=4647"},"modified":"2018-12-27T23:17:06","modified_gmt":"2018-12-27T20:17:06","slug":"e-olymp-662-%d0%bd%d0%b0%d0%bb%d0%be%d0%b3","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=4647","title":{"rendered":"e-olymp 662. \u041d\u0430\u043b\u043e\u0433"},"content":{"rendered":"<p><strong>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/strong><\/p>\n<p style=\"text-align: right\">\u00ab\u041a\u0443\u0440\u0441 \u0432\u0430\u043b\u044e\u0442\u044b \u0417\u0438\u043c\u0431\u0430\u0431\u0432\u0435 \u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u043d\u0430\u043a\u0430\u043d\u0443\u043d\u0435 \u0434\u043e \u0440\u0435\u043a\u043e\u0440\u0434\u043d\u043e \u043d\u0438\u0437\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u2014 $1.2$ \u043c\u043b\u0440\u0434. \u0437\u0438\u043c\u0431\u0430\u0431\u0432\u0438\u0439\u0441\u043a\u0438\u0445 \u0434\u043e\u043b\u043b\u0430\u0440\u043e\u0432 \u0437\u0430 \u043e\u0434\u0438\u043d \u0434\u043e\u043b\u043b\u0430\u0440 \u0421\u0428\u0410\u00bb<br \/>\n(\u041d\u043e\u0432\u043e\u0441\u0442\u0438 \u043e\u0442 $07.06.2009$ )<\/p>\n<p>\u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435 \u0438\u043d\u0444\u043b\u044f\u0446\u0438\u044f \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u0430 \u0442\u0430\u043a\u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432, \u0447\u0442\u043e \u0434\u043e\u0445\u043e\u0434\u044b \u0433\u0440\u0430\u0436\u0434\u0430\u043d \u0441\u0442\u0430\u043b\u0438 \u0432\u044b\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0447\u0438\u0441\u043b\u0430\u043c\u0438, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u043d\u0430\u043a\u043e\u0432 \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u043e $200$. \u042d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043b\u043e \u0437\u0430\u0434\u0430\u0447\u0443 \u0432\u0437\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430\u043b\u043e\u0433\u043e\u0432.<\/p>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u043b\u043e\u0433\u043e\u0432 \u043d\u0430 \u0434\u043e\u0445\u043e\u0434\u044b \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 $1$. \u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 $D$ (\u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0435 \u0434\u043e\u0445\u043e\u0434\u0430 \u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0438\u043d\u0430) \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442 \u044d\u0442\u043e\u0442 \u043d\u0430\u043b\u043e\u0433.<\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f:<\/p>\n<ol>\n<li>\u0415\u0441\u043b\u0438 \u043d\u0430\u043b\u043e\u0433 \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c, \u0442\u043e \u043e\u043d \u043d\u0435 \u043e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u0442\u0441\u044f.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u043d\u0430\u043b\u043e\u0433 \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0434\u0440\u043e\u0431\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c, \u0442\u043e \u043e\u043d \u043e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0446\u0435\u043b\u043e\u0433\u043e (\u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0430).<\/li>\n<\/ol>\n<p><strong>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 <\/strong><br \/>\n\u0412\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e $D$ (\u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435,$10^{5}\u2a7dD&lt;10^{200}$ ) \u2013 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u0434\u043e\u0445\u043e\u0434\u0430 \u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0438\u043d\u0430.<br \/>\n<strong>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 <\/strong><br \/>\n\u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043e\u0434\u043d\u043e \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u2013 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443 \u043d\u0430\u043b\u043e\u0433\u0430.<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>12345600<\/h5>\n<\/td>\n<td style=\"width: 155px\">\n<h5>123456<\/h5>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 142px\">\n<h5>158874554<\/h5>\n<\/td>\n<td style=\"width: 155px\">\n<h5>1588746<\/h5>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 142px\">\n<h5>1000001<\/h5>\n<\/td>\n<td style=\"width: 155px\">\n<h5>10001<\/h5>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 142px\">\n<h5>555555<\/h5>\n<\/td>\n<td style=\"width: 155px\">\n<h5>5556<\/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 662. Taxes\">import java.io.BufferedReader;\r\nimport java.io.InputStreamReader;\r\n\r\nclass Main\r\n{\r\n  public static void main (String[] args) throws java.lang.Exception\r\n  {\r\n    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));\r\n    String s = bufferedReader.readLine().split(\" \")[0];\r\n    if (s.substring(s.length() - 2, s.length() - 2 + 2).equals(\"00\"))\r\n    {\r\n      System.out.print(s.substring(0, s.length() - 2));\r\n    }\r\n    else\r\n    {\r\n      for (int i = s.length() - 3; i &gt;= 0; --i)\r\n      {\r\n        if ((int)s.charAt(i) - 48 + 1 == 10)\r\n        {\r\n          s = s.substring(0, i) + \"0\" + s.substring(i + 1);\r\n          if (i == 0)\r\n          {\r\n            System.out.print(\"1\");\r\n          }\r\n          continue;\r\n        }\r\n        else\r\n        {\r\n        \ts = s.substring(0, i) + (char)(s.charAt(i) + 1) + s.substring(i + 1);\r\n          break;\r\n        }\r\n      }\r\n      System.out.print(s.substring(0, s.length() - 2));\r\n    }\r\n    return;\r\n  }\r\n}<\/pre>\n<p><strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/strong><br \/>\n\u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e $10^{200}$ \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>String<\/code>, \u0438\u0431\u043e \u0432 <code>long<\/code> \u0442\u0430\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043d\u0435 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0441\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0430, \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u043a\u043e\u0442\u043e\u0440\u043e\u0439, \u044d\u0442\u043e \u0446\u0438\u0444\u0440\u0430. \u041e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u043c \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e, \u0442\u043e \u0435\u0441\u0442\u044c \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0434\u0432\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u2014 \u043d\u0443\u043b\u0438, \u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0434\u0430\u0435\u043c \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443, \u0431\u0435\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0434\u0432\u0443\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 <code>( s.substring(0, s.length() - 2) )<\/code>. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0443\u0436\u043d\u043e \u043e\u043a\u0440\u0443\u0433\u043b\u044f\u0442\u044c \u0432\u0432\u0435\u0440\u0445, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043a \u0442\u0440\u0435\u0442\u0435\u0439 \u0441 \u043a\u043e\u043d\u0446\u0430 \u0446\u0438\u0444\u0440\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0434\u0438\u043d. \u0415\u0441\u043b\u0438 \u0446\u0438\u0444\u0440\u0430 \u0431\u044b\u043b\u0430 $9$, \u0442\u043e \u043e\u043d\u0430 \u0441\u0442\u0430\u043d\u0435\u0442 $0$, \u0430 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e \u0446\u0438\u0444\u0440\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0442\u0430\u043a\u043e\u0435-\u0436\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u0415\u0441\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0446\u0438\u0444\u0440\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u043d\u0435\u0439 \u0435\u0449\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u0443.<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\/662\">e-olymp<\/a><br \/>\n\u041a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 <a href=\"https:\/\/ideone.com\/FQkj7f\">Ideone<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u00ab\u041a\u0443\u0440\u0441 \u0432\u0430\u043b\u044e\u0442\u044b \u0417\u0438\u043c\u0431\u0430\u0431\u0432\u0435 \u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u043d\u0430\u043a\u0430\u043d\u0443\u043d\u0435 \u0434\u043e \u0440\u0435\u043a\u043e\u0440\u0434\u043d\u043e \u043d\u0438\u0437\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u2014 $1.2$ \u043c\u043b\u0440\u0434. \u0437\u0438\u043c\u0431\u0430\u0431\u0432\u0438\u0439\u0441\u043a\u0438\u0445 \u0434\u043e\u043b\u043b\u0430\u0440\u043e\u0432 \u0437\u0430 \u043e\u0434\u0438\u043d \u0434\u043e\u043b\u043b\u0430\u0440 \u0421\u0428\u0410\u00bb (\u041d\u043e\u0432\u043e\u0441\u0442\u0438 \u043e\u0442 $07.06.2009$ ) \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435 \u0438\u043d\u0444\u043b\u044f\u0446\u0438\u044f \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u0430 \u0442\u0430\u043a\u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432, \u0447\u0442\u043e \u0434\u043e\u0445\u043e\u0434\u044b \u0433\u0440\u0430\u0436\u0434\u0430\u043d \u0441\u0442\u0430\u043b\u0438 \u0432\u044b\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0447\u0438\u0441\u043b\u0430\u043c\u0438, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u043d\u0430\u043a\u043e\u0432 \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u043e $200$. \u042d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043b\u043e \u0437\u0430\u0434\u0430\u0447\u0443 \u0432\u0437\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430\u043b\u043e\u0433\u043e\u0432. \u041e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u043b\u043e\u0433\u043e\u0432 &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=4647\" 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":[105],"tags":[657,656,151],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4647"}],"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=4647"}],"version-history":[{"count":1,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4647\/revisions"}],"predecessor-version":[{"id":4652,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4647\/revisions\/4652"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}