{"id":4132,"date":"2018-12-15T16:40:04","date_gmt":"2018-12-15T13:40:04","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=4132"},"modified":"2018-12-25T20:38:47","modified_gmt":"2018-12-25T17:38:47","slug":"e-olymp-7492-%d0%b1%d1%83%d0%b4%d0%b8%d0%bb%d1%8c%d0%bd%d0%b8%d0%ba","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=4132","title":{"rendered":"e-olymp 7492. \u0411\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a"},"content":{"rendered":"<h1>\u0417\u0430\u0434\u0430\u0447\u0430<\/h1>\n<p>\u0410\u043b\u0438\u0441\u0430 \u043b\u044e\u0431\u0438\u0442 \u0441\u0432\u043e\u0439 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a. \u041e\u043d\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0435\u0447\u0435\u0440. \u041f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u043e\u0447\u044c\u044e \u0410\u043b\u0438\u0441\u0435 \u043f\u0440\u0438\u0441\u043d\u0438\u043b\u0438\u0441\u044c \u0435\u0435 \u0447\u0430\u0441\u044b. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u043e\u043d\u0430 \u043f\u043e\u043c\u043d\u0438\u0442 \u2014 \u0442\u0430\u043a \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u0445 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0447\u0430\u0441\u0430\u0445. \u0410\u043b\u0438\u0441\u0430 \u0445\u043e\u0447\u0435\u0442 \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u0435\u0435 \u0447\u0430\u0441\u044b \u0432\u043e \u0441\u043d\u0435.<\/p>\n<p>\u0427\u0430\u0441\u044b \u0410\u043b\u0438\u0441\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u0446\u0438\u0444\u0440\u044b: \u0434\u0432\u0435 \u0434\u043b\u044f \u0447\u0430\u0441\u043e\u0432 \u0438 \u0434\u0432\u0435 \u0434\u043b\u044f \u043c\u0438\u043d\u0443\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0430\u0441\u044b \u043d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 [latex]9[\/latex]:[latex]30[\/latex] (\u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u043d\u043e\u043b\u044c \u0432\u044b\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f).<\/p>\n<p>\u0427\u0430\u0441\u044b \u0438\u043c\u0435\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0446\u0438\u0444\u0440:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4133\" src=\"http:\/\/java.mazurok.com\/wp-content\/uploads\/chasu.gif\" alt=\"\" width=\"163\" height=\"67\" \/><\/p>\n<p>h1&gt;\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<p>\u041e\u0434\u043d\u043e \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e [latex]n (0\u2264 n \u226430)[\/latex] \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0447\u0430\u0441\u0430\u0445 \u0410\u043b\u0438\u0441\u044b \u0432\u043e \u0441\u043d\u0435.<\/p>\n<h1>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>\u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u043f\u044f\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 [latex]hh:mm[\/latex] \u2014 \u0432\u0440\u0435\u043c\u044f, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0435 \u0447\u0430\u0441\u0430\u043c\u0438 \u0410\u043b\u0438\u0441\u044b \u0432\u043e \u0441\u043d\u0435. \u0412\u0440\u0435\u043c\u044f \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c: [latex]0 \u2264 hh &lt; 24[\/latex] and [latex]0 \u2264 mm &lt; 60[\/latex]. \u0415\u0441\u043b\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0442\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043b\u044e\u0431\u043e\u0435. \u0415\u0441\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 [latex]Impossible[\/latex].<\/p>\n<h1>\u0422\u0435\u0441\u0442\u044b<\/h1>\n<table>\n<tbody>\n<tr>\n<th>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/th>\n<th>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/th>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">23<\/td>\n<td style=\"text-align: center\">00:02<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">28<\/td>\n<td style=\"text-align: center\">Impossible<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">0<\/td>\n<td style=\"text-align: center\">Impossible<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">15<\/td>\n<td style=\"text-align: center\">01:12<\/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: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\t\tint n;\r\n\t\twhile (in.hasNextInt()) {\r\n\t\t\tn = in.nextInt();\r\n\t\t\tint[] seg = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};\r\n\t\t\tfor (int i = 0; i &lt; 24; i++)\r\n\t\t\t\tfor (int j = 0; j &lt; 60; j++) {\r\n\t\t\t\t\tint a = 0;\r\n\t\t\t\t\ta = a + seg[i \/ 10];\r\n\t\t\t\t\ta = a + seg[i % 10];\r\n\t\t\t\t\ta = a + seg[j \/ 10];\r\n\t\t\t\t\ta = a + seg[j % 10];\r\n\t\t\t\t\tif (a == n) {\r\n\t\t\t\t\t\tif (i &lt; 10) System.out.printf(\"0%d\", i);\r\n\t\t\t\t\t\telse System.out.print(i);\r\n\t\t\t\t\t\tSystem.out.print(\":\");\r\n\t\t\t\t\t\tif (j &lt; 10) System.out.printf(\"0%d\", j);\r\n\t\t\t\t\t\telse System.out.print(j);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.print(\"Impossible\");\r\n\t\t}\r\n\t\tin.close();\r\n\t\treturn;\r\n\t}\r\n}<\/pre>\n<h1>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h1>\n<p>\u041f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c [latex]i[\/latex] \u0438 [latex]j[\/latex] (\u043e\u0442 [latex]0[\/latex] \u0434\u043e [latex]24[\/latex] \u0438 [latex]60[\/latex] \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e). [latex]a=seg[i\/10][\/latex] (\u0434\u043b\u044f \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432) \u0438 [latex]a=seg[i[\/latex]%[latex]10][\/latex] (\u0434\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b) \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u0434\u043b\u044f [latex]j[\/latex]. \u0422\u0435\u043c \u0441\u0430\u043c\u044b\u043c, \u043c\u044b \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 [latex]a==n[\/latex] (\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432) \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0435 \u0438 \u0432 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442, \u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u043d\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u0446\u0438\u043a\u043b\u0430. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0436\u0435 \u0447\u0438\u0441\u043b\u0430 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u0430\u043a \u0432 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0435\u0442 \u0438 \u043c\u044b, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u044b\u0432\u043e\u0434\u0438\u043c <em><strong>Impossible<\/strong><\/em><\/p>\n<h1>\u0421\u0441\u044b\u043b\u043a\u0438<\/h1>\n<p><a href=\"https:\/\/www.e-olymp.com\/ru\/problems\/7492\">e-olymp<\/a><br \/>\n<a href=\"https:\/\/ideone.com\/GOdvdm\">Ideone<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0410\u043b\u0438\u0441\u0430 \u043b\u044e\u0431\u0438\u0442 \u0441\u0432\u043e\u0439 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a. \u041e\u043d\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0435\u0447\u0435\u0440. \u041f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u043e\u0447\u044c\u044e \u0410\u043b\u0438\u0441\u0435 \u043f\u0440\u0438\u0441\u043d\u0438\u043b\u0438\u0441\u044c \u0435\u0435 \u0447\u0430\u0441\u044b. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u043e\u043d\u0430 \u043f\u043e\u043c\u043d\u0438\u0442 \u2014 \u0442\u0430\u043a \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u0445 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0447\u0430\u0441\u0430\u0445. \u0410\u043b\u0438\u0441\u0430 \u0445\u043e\u0447\u0435\u0442 \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u0435\u0435 \u0447\u0430\u0441\u044b \u0432\u043e \u0441\u043d\u0435. \u0427\u0430\u0441\u044b \u0410\u043b\u0438\u0441\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u0446\u0438\u0444\u0440\u044b: \u0434\u0432\u0435 \u0434\u043b\u044f \u0447\u0430\u0441\u043e\u0432 \u0438 \u0434\u0432\u0435 \u0434\u043b\u044f \u043c\u0438\u043d\u0443\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0430\u0441\u044b &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=4132\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":127,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[542,135,543,75],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4132"}],"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\/127"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4132"}],"version-history":[{"count":4,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4132\/revisions"}],"predecessor-version":[{"id":4285,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4132\/revisions\/4285"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}