{"id":5182,"date":"2020-09-19T19:05:11","date_gmt":"2020-09-19T16:05:11","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=5182"},"modified":"2020-11-25T12:12:13","modified_gmt":"2020-11-25T09:12:13","slug":"e-olymp-9405-%d0%bf%d1%80%d0%be%d1%84%d0%b5%d1%81%d1%81%d0%be%d1%80-%d0%b8-%d1%88%d0%b0%d1%80%d1%8b","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=5182","title":{"rendered":"e-olymp 9405. \u041f\u0440\u043e\u0444\u0435\u0441\u0441\u043e\u0440 \u0438 \u0448\u0430\u0440\u044b"},"content":{"rendered":"<h1>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/h1>\n<p>\u0414\u043b\u044f \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u0430 \u041f\u0440\u043e\u0444\u0435\u0441\u0441\u043e\u0440 \u043a\u0443\u043f\u0438\u043b \u0433\u043e\u043b\u0443\u0431\u044b\u0435, \u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u0438 \u0436\u0451\u043b\u0442\u044b\u0435 \u0432\u043e\u0437\u0434\u0443\u0448\u043d\u044b\u0435 \u0448\u0430\u0440\u044b. \u0412\u0441\u0435\u0433\u043e $n$ \u0448\u0442\u0443\u043a. \u0416\u0451\u043b\u0442\u044b\u0445 \u0438 \u0433\u043e\u043b\u0443\u0431\u044b\u0445 \u0432\u043c\u0435\u0441\u0442\u0435 &#8212; $a$. \u041a\u0440\u0430\u0441\u043d\u044b\u0445 \u0438 \u0433\u043e\u043b\u0443\u0431\u044b\u0445 &#8212; $b$ \u0448\u0442\u0443\u043a.<\/p>\n<p>\u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u043e\u043b\u0443\u0431\u044b\u0445, \u043a\u0440\u0430\u0441\u043d\u044b\u0445 \u0438 \u0436\u0451\u043b\u0442\u044b\u0445 \u0448\u0430\u0440\u043e\u0432 \u043a\u0443\u043f\u0438\u043b \u041f\u0440\u043e\u0444\u0435\u0441\u0441\u043e\u0440?<\/p>\n<h1>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>\u0422\u0440\u0438 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u043b\u0430\u00a0$n$,\u00a0$a$,\u00a0$b$.<\/p>\n<h1>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>\u0412 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u043e\u043b\u0443\u0431\u044b\u0445, \u043a\u0440\u0430\u0441\u043d\u044b\u0445 \u0438 \u0436\u0451\u043b\u0442\u044b\u0445 \u0448\u0430\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0443\u043f\u0438\u043b \u041f\u0440\u043e\u0444\u0435\u0441\u0441\u043e\u0440.<\/p>\n<h1>\u0422\u0435\u0441\u0442\u044b<\/h1>\n<table style=\"height: 31px\" width=\"342\">\n<tbody>\n<tr>\n<td>\u2116<\/td>\n<td>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/td>\n<td>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>10 6 8<\/td>\n<td>4 4 2<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>12 8 10<\/td>\n<td>6 4 2<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>14 10 12<\/td>\n<td>8 4 2<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>16 14 12<\/td>\n<td>10 2 4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u043a\u043e\u0434<\/h1>\n<pre class=\"lang:java decode:true\">public class Main\r\n{\r\n\tpublic static void main(String[] args) {\r\n\t\tjava.util.Scanner Javain = new java.util.Scanner(System.in);\r\n\t    int n, a, b, blue, yellow, red; \r\n        n = Javain.nextInt();\r\n        a = Javain.nextInt();\r\n        b = Javain.nextInt(); \r\n        blue = b + a - n; \/\/\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b-\u0432\u043e \u0441\u0438\u043d\u0438\u0445 \u0448\u0430\u0440\u043e\u0432\r\n        red = b - blue; \/\/\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b-\u0432\u043e \u043a\u0440\u0430\u0441\u043d\u044b\u0445 \u0448\u0430\u0440\u043e\u0432\r\n        yellow = a - blue; \/\/\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b-\u0432\u043e \u0436\u0451\u043b\u0442\u044b\u0445 \u0448\u0430\u0440\u043e\u0432\r\n        System.out.print(blue + \" \" + red + \" \" + yellow); \r\n\t}\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 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0436\u0451\u043b\u0442\u044b\u0445 ($y$), \u0441\u0438\u043d\u0438\u0445 ($u$) \u0438 \u043a\u0440\u0430\u0441\u043d\u044b\u0445 ($r$) \u0448\u0430\u0440\u043e\u0432. \u0418\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438\u043c\u0435\u0435\u043c, \u0447\u0442\u043e:<\/p>\n<blockquote><p>$$\\left.\\begin{matrix}<br \/>\n&amp;u&amp;+&amp;y&amp;=a&amp;\\\\<br \/>\n&amp;r&amp;+&amp;u&amp;=b&amp;\\\\<br \/>\n&amp;r&amp;+&amp;u&amp;+&amp;y&amp;=n&amp;<br \/>\n\\end{matrix}\\right\\}$$<\/p><\/blockquote>\n<p>\u0412\u044b\u0440\u0430\u0437\u0438\u043c $r$ \u0438 $y$ \u0447\u0435\u0440\u0435\u0437 $u$:<\/p>\n<blockquote><p>$$\\left.\\begin{matrix}<br \/>\nr=&amp;b&amp;-&amp;u&amp;\\\\<br \/>\ny=&amp;a&amp;-&amp;u&amp;<br \/>\n\\end{matrix}\\right\\}$$<\/p><\/blockquote>\n<p>\u041f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 $r+u+y=n$:<\/p>\n<blockquote><p>$n=b-u+u+a-u$<\/p><\/blockquote>\n<p>$u$ \u0438 $-u$ \u0432\u0437\u0430\u0438\u043c\u043e\u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0442\u0441\u044f \u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c, \u0447\u0442\u043e:<\/p>\n<blockquote><p>$n=a+b-u$<\/p><\/blockquote>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0438\u043d\u0438\u0445 \u0448\u0430\u0440\u043e\u0432:<\/p>\n<blockquote><p>$u=b+a-n$<\/p><\/blockquote>\n<h1>\u0421\u0441\u044b\u043b\u043a\u0438<\/h1>\n<ul>\n<li>\u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0430\u00a0<a href=\"https:\/\/www.e-olymp.com\/uk\/problems\/9405\">e-olymp<\/a><\/li>\n<li>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 <a>Ideone<\/a><\/li>\n<li>\u0417\u0430\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0435 <a href=\"https:\/\/www.e-olymp.com\/uk\/submissions\/7351578\">\u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0414\u043b\u044f \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u0430 \u041f\u0440\u043e\u0444\u0435\u0441\u0441\u043e\u0440 \u043a\u0443\u043f\u0438\u043b \u0433\u043e\u043b\u0443\u0431\u044b\u0435, \u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u0438 \u0436\u0451\u043b\u0442\u044b\u0435 \u0432\u043e\u0437\u0434\u0443\u0448\u043d\u044b\u0435 \u0448\u0430\u0440\u044b. \u0412\u0441\u0435\u0433\u043e $n$ \u0448\u0442\u0443\u043a. \u0416\u0451\u043b\u0442\u044b\u0445 \u0438 \u0433\u043e\u043b\u0443\u0431\u044b\u0445 \u0432\u043c\u0435\u0441\u0442\u0435 &#8212; $a$. \u041a\u0440\u0430\u0441\u043d\u044b\u0445 \u0438 \u0433\u043e\u043b\u0443\u0431\u044b\u0445 &#8212; $b$ \u0448\u0442\u0443\u043a. \u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u043e\u043b\u0443\u0431\u044b\u0445, \u043a\u0440\u0430\u0441\u043d\u044b\u0445 \u0438 \u0436\u0451\u043b\u0442\u044b\u0445 \u0448\u0430\u0440\u043e\u0432 \u043a\u0443\u043f\u0438\u043b \u041f\u0440\u043e\u0444\u0435\u0441\u0441\u043e\u0440? \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0422\u0440\u0438 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u043b\u0430\u00a0$n$,\u00a0$a$,\u00a0$b$. \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u043e\u043b\u0443\u0431\u044b\u0445, \u043a\u0440\u0430\u0441\u043d\u044b\u0445 \u0438 \u0436\u0451\u043b\u0442\u044b\u0445 \u0448\u0430\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0443\u043f\u0438\u043b \u041f\u0440\u043e\u0444\u0435\u0441\u0441\u043e\u0440. &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=5182\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":136,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[484,69,720,147,384,102],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/5182"}],"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\/136"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5182"}],"version-history":[{"count":5,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/5182\/revisions"}],"predecessor-version":[{"id":5214,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/5182\/revisions\/5214"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}