{"id":4697,"date":"2018-12-27T21:41:55","date_gmt":"2018-12-27T18:41:55","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=4697"},"modified":"2018-12-27T23:29:41","modified_gmt":"2018-12-27T20:29:41","slug":"e-olymp-2670-%d0%ba%d0%be%d0%be%d1%80%d0%b4%d0%b8%d0%bd%d0%b0%d1%82%d1%8b-%d1%81%d0%be%d1%81%d0%b5%d0%b4%d0%b5%d0%b9","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=4697","title":{"rendered":"e-olymp 2670.\u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0441\u043e\u0441\u0435\u0434\u0435\u0439"},"content":{"rendered":"<h1>\u0417\u0430\u0434\u0430\u0447\u0430<\/h1>\n<p>\u0414\u043b\u044f \u043a\u043b\u0435\u0442\u043a\u0438 \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 $\\left(x, y\\right)$ \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c $M\\times N$ \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0435\u0435 \u0441\u043e\u0441\u0435\u0434\u0435\u0439. \u0421\u043e\u0441\u0435\u0434\u043d\u0438\u043c\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u043b\u0435\u0442\u043a\u0438, \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u043e\u0431\u0449\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443.<\/p>\n<h1>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>\u0414\u0430\u043d\u044b \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 $M, N, x, y \\left(1 \\leqslant x \\leqslant M \\leqslant 109, 1 \\leqslant y \\leqslant N \\leqslant 109\\right).$<\/p>\n<h1>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>\u0412 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u0430\u0440\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0441\u043e\u0441\u0435\u0434\u0435\u0439 \u044d\u0442\u043e\u0439 \u043a\u043b\u0435\u0442\u043a\u0438 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435.<\/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\">3 3<br \/>\n2 2<\/td>\n<td style=\"text-align: center\">1 2<br \/>\n2 1<br \/>\n2 3<br \/>\n3 2<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">23 23<br \/>\n21 13<\/td>\n<td style=\"text-align: center\">20 13<br \/>\n22 13<br \/>\n21 12<br \/>\n21 14<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">11 8<br \/>\n10 5<\/td>\n<td style=\"text-align: center\">9 5<br \/>\n11 5<br \/>\n10 4<br \/>\n10 6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1>\u041a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h1>\n<pre class=\"lang:java decode:true \">import java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\nclass Main\r\n{\r\n\tpublic static void main (String[] args) throws java.lang.Exception\r\n\t{\r\n\t\t\r\n\t\tScanner in = new Scanner(System.in);\r\n                int n = in.nextInt();\r\n                int m = in.nextInt();\r\n                int x = in.nextInt();\r\n                int y = in.nextInt();\r\n\t\tif (x &gt; 1) System.out.print((x-1)+\" \"+y+\"\\n\");\r\n\t\tif (x  1) System.out.print(x+\" \"+(y-1)+\"\\n\");\r\n\t\tif (y &lt; m) System.out.print(x+&quot; &quot;+(y+1)+&quot;\\n&quot;);\r\n\t}\r\n}\r\n\r\n\r\n\r\n<\/pre>\n<h1>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h1>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0442\u043e\u0447\u0435\u043a. \u0422\u043e \u0435\u0441\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u043a \u0430\u0431\u0441\u0446\u0438\u0441\u0441\u0430\u043c \u0438 \u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438. \u041d\u043e \u0441\u0442\u043e\u0438\u0442 \u0443\u0447\u0435\u0441\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0443 \u043d\u0430\u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430: $1 \\leqslant x \\leqslant M, 1 \\leqslant y \\leqslant N$<\/p>\n<h1>\u0421\u0441\u044b\u043b\u043a\u0438<\/h1>\n<p><a href=\"https:\/\/www.e-olymp.com\/ru\/problems\/2670\" target=\"_blank\" rel=\"noopener\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 E-olymp<\/a><br \/>\n<a href=\"https:\/\/ideone.com\/Tnc8f8\" target=\"_blank\" rel=\"noopener\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0414\u043b\u044f \u043a\u043b\u0435\u0442\u043a\u0438 \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 $\\left(x, y\\right)$ \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c $M\\times N$ \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0435\u0435 \u0441\u043e\u0441\u0435\u0434\u0435\u0439. \u0421\u043e\u0441\u0435\u0434\u043d\u0438\u043c\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u043b\u0435\u0442\u043a\u0438, \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u043e\u0431\u0449\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443. \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0414\u0430\u043d\u044b \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 $M, N, x, y \\left(1 \\leqslant x \\leqslant M \\leqslant 109, 1 \\leqslant y \\leqslant N \\leqslant 109\\right).$ \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u0430\u0440\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0441\u043e\u0441\u0435\u0434\u0435\u0439 \u044d\u0442\u043e\u0439 &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=4697\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":125,"featured_media":4705,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[400,450,451],"jetpack_featured_media_url":"https:\/\/java.mazurok.com\/wp-content\/uploads\/\u043c\u043e\u044f-1-1.jpg","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4697"}],"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\/125"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4697"}],"version-history":[{"count":5,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4697\/revisions"}],"predecessor-version":[{"id":4717,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4697\/revisions\/4717"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/media\/4705"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}