{"id":332067,"date":"2022-04-18T21:00:17","date_gmt":"2022-04-18T21:00:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=332067"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=332067","title":{"rendered":"<span>\u0413\u043e\u0440\u043e\u0434\u0430, \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0438 \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u043a\u0430: \u0440\u0430\u0437\u0431\u043e\u0440 \u0437\u0430\u0434\u0430\u0447 \u0434\u043b\u044f QA-\u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\u0414\u0440\u0443\u0437\u044c\u044f, \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043c\u044b \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438 \u0440\u0430\u0437\u0431\u043e\u0440 \u0437\u0430\u0434\u0430\u0447 \u0438\u0437 \u043e\u0442\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0441\u0442\u0430 \u043d\u0430 \u043a\u0443\u0440\u0441 <a href=\"https:\/\/route256.ozon.ru\/qa-engineer\">\u00ab\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0430 Go\u00bb<\/a>. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u043f\u043e\u043b\u043e\u043c\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0432\u0443 \u043d\u0430\u0434 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438 \u0434\u043b\u044f QA-\u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435 \u0441 \u043d\u0430\u0448\u0438\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/lq\/v6\/cm\/lqv6cmsp9l7a13pz-vktiq2igsm.png\" data-src=\"https:\/\/habrastorage.org\/webt\/lq\/v6\/cm\/lqv6cmsp9l7a13pz-vktiq2igsm.png\"\/><\/div>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0425\u044d\u0448<\/h2>\n<p>  \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0441\u043a\u043b\u0430\u0434\u0441\u043a\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0410\u043d\u0434\u0440\u0435\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u044e \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0437\u0430\u043a\u0430\u0437\u0430\u0445 \u0438 \u0434\u0435\u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0435\u0439. \u041d\u0430 \u0432\u0445\u043e\u0434 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u043c <i>\u043d\u043e\u043c\u0435\u0440 \u0437\u0430\u043a\u0430\u0437\u0430, \u0438\u043c\u044f, \u0444\u0430\u043c\u0438\u043b\u0438\u044e \u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u0430<\/i>:<\/p>\n<pre><code class=\"plaintext\">order_id first_name second_name price <\/code><\/pre>\n<p>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 Bash (\u0437\u0430\u043f\u0443\u0441\u043a \u043f\u043e\u0434 Ubuntu 20.04), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0442\u0435 \u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u043e \u0441 \u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0438\u043c\u0435\u043d\u0435\u043c \u0438 \u0444\u0430\u043c\u0438\u043b\u0438\u0435\u0439. \u0425\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 <strong>sha1sum<\/strong>.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u0423\u0442\u0438\u043b\u0438\u0442\u0430 sha1sum \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u0432\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f: \u0445\u044d\u0448 \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430. \u0415\u0451 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u0441\u0442\u0440\u043e\u043a\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>echo $string | sha1sum<\/code>, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043c\u0438\u043c\u043e \u0438\u0441\u043a\u043e\u043c\u043e\u0439 \u0445\u044d\u0448-\u0441\u0443\u043c\u043c\u044b \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0435\u0449\u0451 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b \u0441\u0438\u043c\u0432\u043e\u043b \u00ab-\u00bb. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043e\u0442 \u043d\u0435\u0433\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f? \u041e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u2014 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 head \u0441 \u043e\u043f\u0446\u0438\u0435\u0439 <code>-c40<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 40 \u0431\u0430\u0439\u0442 \u0432\u044b\u0432\u043e\u0434\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u044b sha1sum, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0438\u0441\u043a\u043e\u043c\u044b\u0439 \u0445\u044d\u0448, \u0438 \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0442 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435.<\/p>\n<p>  \u0424\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<ol>\n<li>\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: <br \/> \n<pre><code class=\"plaintext\">read order_id first_name second_name price <\/code><\/pre>\n<p>  <\/li>\n<li>\u0417\u0430\u0442\u0435\u043c \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0445\u044d\u0448 \u0438 \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u043c \u043b\u0438\u0448\u043d\u0435\u0435:<br \/> \n<pre><code class=\"plaintext\">hash1=$(echo $first_name | sha1sum | head -c40) hash2=$(echo $second_name | sha1sum | head -c40) <\/code><\/pre>\n<p>  <\/li>\n<li>\u0412\u044b\u0432\u0435\u0434\u0435\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<br \/> \n<pre><code class=\"plaintext\">echo $order_id $hash1 $hash2 $price <\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<h2>\u0413\u043e\u0440\u043e\u0434\u0430<\/h2>\n<p>  \u0421\u0432\u0435\u0442\u0430 \u043b\u044e\u0431\u0438\u0442 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u043d\u043e\u0432\u044b\u043c \u0441\u0442\u0440\u0430\u043d\u0430\u043c. \u0421\u043e\u0431\u0438\u0440\u0430\u044f\u0441\u044c \u0432 \u0411\u0440\u0430\u0437\u0438\u043b\u0438\u044e, \u043e\u043d\u0430 \u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0430 \u0432\u0441\u0435\u0445 \u0441\u0432\u043e\u0438\u0445 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445, \u0432 \u043a\u0430\u043a\u0438\u0445 \u0433\u043e\u0440\u043e\u0434\u0430\u0445 \u0411\u0440\u0430\u0437\u0438\u043b\u0438\u0438 \u043e\u043d\u0438 \u0431\u044b\u043b\u0438. \u041a\u0430\u0436\u0434\u044b\u0439 \u0433\u043e\u0440\u043e\u0434 \u0421\u0432\u0435\u0442\u0430 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043b\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0430 \u0438\u0437 \u0432\u0441\u0435\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0434\u0440\u0443\u0437\u0435\u0439 \u0434\u043b\u0438\u043d\u043d\u0443\u044e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443. \u0422\u0435\u043f\u0435\u0440\u044c \u0435\u0439 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0430\u043c\u044b\u0439 \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0441\u0435\u0449\u0430\u0435\u043c\u044b\u0439 \u0433\u043e\u0440\u043e\u0434. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0441\u0442\u0440\u043e\u043a\u0438, \u043a\u0440\u043e\u043c\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u0447\u0430\u0441\u0442\u043e\u0433\u043e, \u043d\u0430 \u0441\u0438\u043c\u0432\u043e\u043b \u00ab*\u00bb.<\/p>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0412 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u0434\u0430\u043d\u0430 \u043d\u0435\u043f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0438\u0437 \u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0445 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u0438\u0445 \u0431\u0443\u043a\u0432, \u0434\u043b\u0438\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 100 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441\u0440\u0435\u0434\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0441\u0442\u0440\u043e\u043a\u0438 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439, \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0442\u0440\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<\/p>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u0441\u043a\u043e\u043c\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0437\u0430\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u043c\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u042d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0438\u0441\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u0430\u043c\u044b\u0439 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u0441\u0442\u0440\u043e\u043a\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043d\u0430 \u0441\u0438\u043c\u0432\u043e\u043b \u00ab*\u00bb.<\/p>\n<p>  \u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 (<code>map<\/code> \u0438\u043b\u0438 <code>dict<\/code> \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f) \u0438 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u043e\u043c \u043d\u0430\u0439\u0442\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u0438\u0435 \u0431\u0443\u043a\u0432\u044b \u043a\u043e\u0434\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u043e\u0434\u0440\u044f\u0434, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0447\u0435\u0441\u0442\u044c \u0438\u0437 \u043a\u043e\u0434\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0431\u0443\u043a\u0432\u044b \u043a\u043e\u0434 \u0431\u0443\u043a\u0432\u044b \u00aba\u00bb \u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0434\u043b\u0438\u043d\u043e\u0439 26.<\/p>\n<p>  \u0410 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u043e\u043c \u043f\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438 \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u043b\u0438\u0431\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u0447\u0430\u0441\u0442\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u043b\u0438\u0431\u043e \u00ab*\u00bb.  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<h2>\u0418\u043d\u0432\u0435\u0440\u0441\u0438\u0438<\/h2>\n<p>  \u0410\u043d\u0442\u043e\u043d \u0445\u043e\u0447\u0435\u0442 \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0441\u0442\u0438 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u044b\u0433\u043e\u0434\u043e\u0439. \u0412\u044b\u0431\u0440\u0430\u0432 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u0435\u043c\u0443 \u043c\u043e\u0434\u0435\u043b\u044c, \u043f\u0440\u043e\u0434\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430\u0445, \u043e\u043d \u0445\u043e\u0447\u0435\u0442 \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0443\u0449\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u043e\u0440\u0433\u043e\u0432\u044b\u0445 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0430\u0445, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0431\u043b\u0430\u0433\u043e\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u043e\u043a\u0443\u043f\u043a\u0438. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0431\u043b\u0430\u0433\u043e\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c \u0410\u043d\u0442\u043e\u043d \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0446\u0435\u043d\u0430 \u0443\u0436\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043d\u0438\u0436\u0430\u0442\u044c\u0441\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u043d \u0440\u0435\u0448\u0438\u043b \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0443 \u0446\u0435\u043d \u043d\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0430\u0445. \u0427\u0435\u0440\u0435\u0437 \u0434\u0432\u0430 \u043c\u0435\u0441\u044f\u0446\u0430 \u0443 \u043d\u0435\u0433\u043e \u043d\u0430\u0431\u0440\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443 \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u0446\u0435\u043d\u044b (\u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0446\u0435\u043d\u043e\u0439 \u0437\u0430 \u043f\u0435\u0440\u0438\u043e\u0434). \u0421\u043e\u0431\u0440\u0430\u0432 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0445\u0440\u043e\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0446\u0435\u043d, \u0410\u043d\u0442\u043e\u043d \u0440\u0435\u0448\u0438\u043b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0438 \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>  \u0414\u0430\u043d \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/35b\/a56\/5f3\/35ba565f36734f3a55aa01ac67868762.svg\" alt=\"$n$\" data-tex=\"inline\"\/> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/83a\/d7e\/b79\/83ad7eb794bc34d0de23f350c10017e5.svg\" alt=\"$a_0$\" data-tex=\"inline\"\/>, <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6ed\/7f2\/dea\/6ed7f2dea581700f308de45f26c48b49.svg\" alt=\"$a_1$\" data-tex=\"inline\"\/>,\u2026 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d71\/baf\/94c\/d71baf94ce7b8d9e69956cc026464226.svg\" alt=\"$a_n-1$\" data-tex=\"inline\"\/>. \u0418\u043d\u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u044e\u0431\u0430\u044f \u043f\u0430\u0440\u0430 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b87\/c43\/419\/b87c4341953d9930499c99cfd4f7de89.svg\" alt=\"$i$\" data-tex=\"inline\"\/>, <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3ed\/351\/e10\/3ed351e10e635d7d2bd575abe9da3b32.svg\" alt=\"$j$\" data-tex=\"inline\"\/>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/357\/b36\/f4f\/357b36f4ff1ffc35fda61f139bc7e6c9.svg\" alt=\"$i &lt; j$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/237\/5a6\/71f\/2375a671f56dbfd0c1696987ffb1746c.svg\" alt=\"$a_i > a_j$&#187; data-tex=&#187;inline&#187;\/>. \u041d\u0430\u0437\u043e\u0432\u0435\u043c \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u043e\u0439 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 i, j \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0443\u044e \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/062\/cd0\/082\/062cd00820cfb76735d50d8df6b7d9a6.svg\" alt=\"$|a_i - a_j|$\" data-tex=\"inline\"\/>. \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u043e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0435 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u044e \u0432 \u044d\u0442\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435.<\/p>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043e\u0434\u043d\u043e \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/35b\/a56\/5f3\/35ba565f36734f3a55aa01ac67868762.svg\" alt=\"$n$\" data-tex=\"inline\"\/> \u2014 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (<img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4bd\/76c\/17e\/4bd76c17e5f5bed8a1a16c47f02ada18.svg\" alt=\"$2 &lt;= n &lt;= 10^5$\" data-tex=\"inline\"\/>). \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f n \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/83a\/d7e\/b79\/83ad7eb794bc34d0de23f350c10017e5.svg\" alt=\"$a_0$\" data-tex=\"inline\"\/>, <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6ed\/7f2\/dea\/6ed7f2dea581700f308de45f26c48b49.svg\" alt=\"$a_1$\" data-tex=\"inline\"\/>,\u2026 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/888\/8f5\/ed0\/8888f5ed07f55f8e86d19575953a83e0.svg\" alt=\"$a_{n-1}$\" data-tex=\"inline\"\/>, \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u043c \u2014 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (<img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6bc\/220\/d19\/6bc220d19691758a5d577187da6aab29.svg\" alt=\"$-10^9 &lt;= a_i &lt;= 10^9$\" data-tex=\"inline\"\/>).<\/p>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e \u2014 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435. \u0415\u0441\u043b\u0438 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043d\u0435\u0442, \u0442\u043e \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 0.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u043e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0435 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u044e \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u043d\u0430\u0439\u0434\u0451\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/934\/407\/165\/934407165e9db0f4657d1b5cbce84204.svg\" alt=\"$a_k$\" data-tex=\"inline\"\/> \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u043e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0435 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u044e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/15d\/8f3\/75d\/15d8f375da90503b20e8cdc70bb08879.svg\" alt=\"$i, j$\" data-tex=\"inline\"\/>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/357\/b36\/f4f\/357b36f4ff1ffc35fda61f139bc7e6c9.svg\" alt=\"$i &lt; j$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e34\/d78\/afd\/e34d78afddf1814f081add22593d1a81.svg\" alt=\"$j = k$\" data-tex=\"inline\"\/>. \u0415\u0441\u043b\u0438 \u0431\u044b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u0438 \u0440\u0435\u0448\u0430\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0437\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u0443\u044e \u0430\u0441\u0438\u043c\u043f\u0442\u043e\u0442\u0438\u043a\u0443, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2f3\/a75\/94b\/2f3a7594b7732c40d19dd6cf1db2279a.svg\" alt=\"$i &lt; k$\" data-tex=\"inline\"\/>, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u0435\u0440\u043d\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/99c\/64f\/9e0\/99c64f9e0fd42fc799ba3453282aa080.svg\" alt=\"$a_i > a_k$&#187; data-tex=&#187;inline&#187;\/> (\u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043a\u0438\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b87\/c43\/419\/b87c4341953d9930499c99cfd4f7de89.svg\" alt=\"$i$\" data-tex=\"inline\"\/> \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u044e \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/fce\/525\/2bd\/fce5252bde946816c2cf744d932890f7.svg\" alt=\"$k$\" data-tex=\"inline\"\/>), \u0438 \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d3d\/383\/fa7\/d3d383fa7bcb075db7920d28c481f28d.svg\" alt=\"$a_i - a_k$\" data-tex=\"inline\"\/> \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043e \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u0441\u0438\u043c\u043f\u0442\u043e\u0442\u0438\u043a\u0438. \u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/fce\/525\/2bd\/fce5252bde946816c2cf744d932890f7.svg\" alt=\"$k$\" data-tex=\"inline\"\/> \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4db\/08e\/666\/4db08e666ad4c1346c2da9333ff961dd.svg\" alt=\"$a_i \u2014 a_k$\" data-tex=\"inline\"\/> \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430 \u043f\u0440\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/86c\/49d\/578\/86c49d57817f9cd369f158fd9ec22a28.svg\" alt=\"$a_i $\" data-tex=\"inline\"\/>. \u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0441\u0440\u0435\u0434\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/026\/b78\/4bd\/026b784bd08baf75c13877be76fd6900.svg\" alt=\"$a_0, a_1 \\dots a_{k-1}$\" data-tex=\"inline\"\/> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u0430 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/fce\/525\/2bd\/fce5252bde946816c2cf744d932890f7.svg\" alt=\"$k$\" data-tex=\"inline\"\/>.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0437\u044f\u0432 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0438\u0437 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/502\/f96\/0ea\/502f960ea92bcba31646e66cccd41554.svg\" alt=\"$0$\" data-tex=\"inline\"\/> \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430.  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<h2>\u041e\u0431\u0449\u0435\u0435 \u043f\u043e\u043b\u0435<\/h2>\n<p>  \u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0432 \u0430\u0441\u0441\u043e\u0440\u0442\u0438\u043c\u0435\u043d\u0442\u0435 \u043c\u0430\u0440\u043a\u0435\u0442\u043f\u043b\u0435\u0439\u0441\u0430 Ozon \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0438, \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u2014 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a \u0442\u043e\u0432\u0430\u0440\u0430. \u0425\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u043e\u0432\u0430\u0440\u043d\u044b\u0445 \u0433\u0440\u0443\u043f\u043f \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0437\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438 \u0432 \u043e\u0431\u0449\u0435\u043c \u0432\u0438\u0434\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043b\u0435\u0439. \u041d\u0430 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435\u0441\u0442\u0438 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0439, \u043d\u043e \u0438 \u0438\u0445 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 JSON. \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u0438 \u0442\u043e\u0432\u0430\u0440\u043e\u0432. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0438\u0441\u043a \u043e\u0431\u0449\u0438\u0445 \u043f\u043e\u043b\u0435\u0439 \u0432 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0445 JSON.<\/p>\n<p>  \u0412\u0430\u043c \u0434\u0430\u043d\u043e \u0434\u0432\u0430 JSON. \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0432 \u043d\u0438\u0445 \u0442\u0430\u043a\u043e\u0435 \u043e\u0431\u0449\u0435\u0435 \u043f\u043e\u043b\u0435, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0430\u043c\u0430\u044f \u0434\u043b\u0438\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u044e\u0449\u0430\u044f \u043f\u0443\u0442\u044c \u0434\u043e \u043d\u0435\u0433\u043e. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0439\u0442\u0438 \u043b\u0435\u043a\u0441\u0438\u043a\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0443\u044e \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<h3>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c<\/h3>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443 JSON-\u043e\u0432 \u0434\u0432\u0430 \u043e\u0431\u0449\u0438\u0445 \u043f\u043e\u043b\u044f \u0441 \u043f\u0443\u0442\u0451\u043c \u0434\u043b\u0438\u043d\u043e\u0439 \u0442\u0440\u0438: <code>fps<\/code> \u0438 <code>a.z<\/code>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c <code>a.z<\/code> \u043b\u0435\u043a\u0441\u0438\u043a\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u0435\u043d\u044c\u0448\u0435.<\/p>\n<p>  \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c JSON \u0435\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u043f\u0443\u0442\u044c <code>a[2].b[0][0]<\/code>, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c JSON \u043f\u0443\u0442\u044c \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435, \u0430 <code>a[1].b[0][0]<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0449\u0438\u043c. <\/p>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u0434\u0430\u043d \u043f\u0435\u0440\u0432\u044b\u0439 JSON. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u0434\u0430\u043d \u0432\u0442\u043e\u0440\u043e\u0439 JSON. \u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u043b\u0438\u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 3000.<\/p>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e \u0434\u043b\u0438\u043d\u0435 \u0438 \u043b\u0435\u043a\u0441\u0438\u043a\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0439 \u043f\u0443\u0442\u044c \u0434\u043e \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 JSON-\u043e\u0432.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u0417\u0430\u0434\u0430\u0447\u0430 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438: \u043f\u0430\u0440\u0441\u0438\u043d\u0433 JSON-\u0430 \u0438 \u043e\u0431\u0445\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. <\/p>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0439\u0442\u0438 \u0442\u0440\u0443\u0434\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c \u0438 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0430\u0440\u0441\u0438\u043d\u0433, \u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 Python \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c json, \u0430 \u0432 JavaScript \u043e\u0431\u044a\u0435\u043a\u0442 JSON.<\/p>\n<p>  \u0412\u0442\u043e\u0440\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438: \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0445\u043e\u0434 \u0434\u0432\u0443\u0445 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e JSON-\u0430 \u043d\u0430\u0431\u043e\u0440 \u043f\u043e\u043b\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439 \u0434\u043e \u043f\u043e\u043b\u0435\u0439 \u0438 \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0441\u0430\u043c\u044b\u0439 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043b\u0435\u043a\u0441\u0438\u043a\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0439.<\/p>\n<p>  \u0412\u043e\u0442 \u0430\u0432\u0442\u043e\u0440\u0441\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 Python:<\/p>\n<pre><code class=\"python\">import json  def get_paths(json, prefix, ans):     if type(json) is dict:         for k, v in json.items():             get_paths(v, prefix + '.' + k, ans)     elif type(json) is list:         for i in range(len(json)):             get_paths(json[i], prefix + '[' + str(i) + ']', ans)             else:         ans.append(prefix[1:])  first = json.loads(input()) second = json.loads(input()) ans1 = [] ans2 = [] get_paths(first, '', ans1) get_paths(second, '', ans2)  intersection_set = set.intersection(set(ans1), set(ans2)) intersection_list = list(intersection_set) intersection_list = sorted(intersection_list, key=lambda x: (-len(x), x)) print(intersection_list[0]) <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<h2>\u0414\u0430\u0442\u044b<\/h2>\n<p>  \u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043d\u0430 \u0432\u0445\u043e\u0434 <code>stdin<\/code> \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <code>d1<\/code> \u0438 <code>d2<\/code> \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 YYYY-MM-DD, \u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0434\u0430\u0442\u0430\u043c\u0438 \u0432 \u0434\u043d\u044f\u0445. \u0421\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 Bash 5.1.4 (\u0437\u0430\u043f\u0443\u0441\u043a \u043f\u043e\u0434 Ubuntu 20.04).<\/p>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0414\u0432\u0435 \u0434\u0430\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 YYYY-MM-DD.<\/p>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u041e\u0434\u043d\u043e \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u2014 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0434\u043d\u044f\u0445.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043c\u0435\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>date<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u0430\u0442\u0443 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0435\u0451 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 unix time. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0430\u043a \u0438 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043c, \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u0439\u0434\u0451\u043c \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043c \u0435\u0451 \u0432 \u0434\u043d\u0438:<\/p>\n<ol>\n<li>\u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u0442\u044b \u0438\u0437 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430:<br \/> \n<pre><code class=\"bash\">read s1 s2 d1=`date -d \"$s1\" \"+%Y-%m-%d\"` d2=`date -d \"$s2\" \"+%Y-%m-%d\"` <\/code><\/pre>\n<p>  <\/li>\n<li>\u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c \u0434\u0430\u0442\u044b \u0432 unix time:<br \/> \n<pre><code class=\"bash\">ut1=`date -d \"$d1\" +%s` ut2=`date -d \"$d2\" +%s` <\/code><\/pre>\n<p>  <\/li>\n<li>\u0421\u0447\u0438\u0442\u0430\u0435\u043c \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u043a\u0443\u043d\u0434 \u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c \u0432 \u0434\u043d\u0438:<br \/> \n<pre><code class=\"bash\">diff=$(($ut1 - $ut2)) diff_days=$(($diff \/ (60 * 60 * 24))) <\/code><\/pre>\n<p>  <\/li>\n<li>\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438 (\u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c <code>if<\/code>, \u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u00ab\u0447\u0438\u0442\u00bb \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0435\u0435: \u043e\u043d \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u043b\u0438\u0434\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043c\u0438\u043d\u0443\u0441, \u0435\u0441\u043b\u0438 \u043e\u043d \u0435\u0441\u0442\u044c):<br \/> \n<pre><code class=\"bash\">echo ${diff_days#-} <\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  \u0411\u043e\u043d\u0443\u0441:<\/p>\n<p>  \u0423\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u043e\u0441\u044c \u0434\u0432\u0430 \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0445 \u0444\u0430\u043a\u0442\u0430:<\/p>\n<ol>\n<li>\u0412\u043e \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u0432\u0442\u043e\u0440\u0430\u044f \u0434\u0430\u0442\u0430 \u0438\u0434\u0451\u0442 \u0445\u0440\u043e\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0437\u0436\u0435 \u043f\u0435\u0440\u0432\u043e\u0439.<\/li>\n<li>\u0424\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u0442\u044b \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043d\u0435 \u043d\u0430\u0434\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0430\u0440\u0441\u0438\u0442\u044c, \u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0432 unix time.<\/li>\n<\/ol>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">read d1 d2  ut1=`date -d $d1 +%s` ut2=`date -d $d2 +%s`  diff=$(($ut2 - $ut1)) diff_days=$(($diff \/ (60 * 60 * 24)))  echo $diff_days <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<h2>\u0420\u0435\u0433\u0438\u043e\u043d\u044b<\/h2>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0430\u043d\u0434\u0435\u043c\u0438\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0444\u0438\u0441\u0430 Ozon \u0440\u0430\u0437\u044a\u0435\u0445\u0430\u043b\u0430\u0441\u044c \u043f\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u043c \u0441\u0442\u0440\u0430\u043d\u044b. \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043e\u043d\u043b\u0430\u0439\u043d-\u0432\u0441\u0442\u0440\u0435\u0447, \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u043f\u043e\u044f\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0436\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e HR-\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c (\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0447\u0430\u0441\u0442\u044c \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u0436\u0438\u0432\u0451\u0442 \u0432 \u041c\u043e\u0441\u043a\u0432\u0435, \u0430 \u0447\u0430\u0441\u0442\u044c \u2014 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445). \u0414\u0430\u043d\u043d\u044b\u0435 \u043e \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0430\u0445 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445:<\/p>\n<p>  <strong>local_employees<\/strong><\/p>\n<pre><code class=\"plaintext\">id   name      second_name 1    \u0410\u043d\u0434\u0440\u0435\u0439    \u0418\u0432\u0430\u043d\u043e\u0432 2    \u041e\u043b\u044c\u0433\u0430     \u0421\u043c\u0438\u0440\u043d\u043e\u0432\u0430 3    \u0418\u0432\u0430\u043d      \u0418\u0432\u0430\u043d\u043e\u0432 <\/code><\/pre>\n<p>  <strong>remote_employees<\/strong><\/p>\n<pre><code class=\"plaintext\">Id   first_name   second_name    region 1    \u0421\u0435\u0440\u0433\u0435\u0439       \u041a\u0443\u0437\u043d\u0435\u0446\u043e\u0432       \u041a\u0430\u0437\u0430\u043d\u044c 2    \u0418\u043b\u044c\u044f         \u0424\u043e\u043c\u0438\u043d          \u0418\u0436\u0435\u0432\u0441\u043a 3    \u0410\u043d\u043d\u0430         \u0421\u0435\u0440\u0433\u0435\u0435\u0432\u043d\u0430      \u041a\u0430\u0437\u0430\u043d\u044c 4    \u0410\u0440\u0442\u0451\u043c        \u0421\u0438\u0434\u043e\u0440\u043e\u0432        \u0412\u043b\u0430\u0434\u0438\u043c\u0438\u0440 <\/code><\/pre>\n<p>  \u041d\u0430\u043f\u0438\u0448\u0438 \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0435\u0445 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u0432 <abbr title=\"\u041f\u0443\u043d\u043a\u0442 \u0432\u044b\u0434\u0430\u0447\u0438 \u0437\u0430\u043a\u0430\u0437\u043e\u0432\">\u041f\u0412\u0417<\/abbr> Ozon \u0432 \u043e\u0434\u043d\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0440\u0435\u0433\u0438\u043e\u043d\u0430. \u0414\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0435\u0433\u0438\u043e\u043d \u00ab\u041c\u043e\u0441\u043a\u0432\u0430\u00bb. \u0417\u0430\u0442\u0435\u043c \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0451 \u043f\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0443.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430:<\/p>\n<pre><code class=\"plaintext\">\u0410\u0440\u0442\u0451\u043c   \u0421\u0438\u0434\u043e\u0440\u043e\u0432  \u0412\u043b\u0430\u0434\u0438\u043c\u0438\u0440 \u0418\u043b\u044c\u044f    \u0424\u043e\u043c\u0438\u043d    \u0418\u0436\u0435\u0432\u0441\u043a \u0421\u0435\u0440\u0433\u0435\u0439  \u041a\u0443\u0437\u043d\u0435\u0446\u043e\u0432 \u041a\u0430\u0437\u0430\u043d\u044c \u0410\u043d\u043d\u0430    \u0421\u0435\u0440\u0433\u0435\u0435\u0432\u0430 \u041a\u0430\u0437\u0430\u043d\u044c \u0410\u043d\u0434\u0440\u0435\u0439  \u0418\u0432\u0430\u043d\u043e\u0432   \u041c\u043e\u0441\u043a\u0432\u0430 \u041e\u043b\u044c\u0433\u0430   \u0421\u043c\u0438\u0440\u043d\u043e\u0432\u0430 \u041c\u043e\u0441\u043a\u0432\u0430 \u0418\u0432\u0430\u043d    \u0418\u0432\u0430\u043d\u043e\u0432   \u041c\u043e\u0441\u043a\u0432\u0430 <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u041d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043b\u043e\u043d\u043a\u0443 \u043a local_employees, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0443\u044e\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 remote_employees. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 local_employees \u0441 \u043a\u043e\u043b\u043e\u043d\u043a\u043e\u0439 \u0440\u0435\u0433\u0438\u043e\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<pre><code class=\"sql\">SELECT         name, second_name, \"\u041c\u043e\u0441\u043a\u0432\u0430\" FROM         local_employees <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>UNION ALL<\/code> (\u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>UNION<\/code> \u043d\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443). \u041e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0442\u044c \u0438\u0442\u043e\u0433\u043e\u0432\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0443, \u0447\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0418\u0442\u043e\u0433\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a:<\/p>\n<pre><code class=\"sql\">SELECT     first_name, second_name, region FROM     remote_employees UNION ALL     SELECT             name, second_name, \"\u041c\u043e\u0441\u043a\u0432\u0430\"     FROM             local_employees ORDER BY region <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<h2>\u041b\u043e\u0433\u0438\u0441\u0442\u0438\u043a\u0430<\/h2>\n<p>  \u0412 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438-\u0433\u0440\u0443\u0437\u043e\u043f\u0435\u0440\u0435\u0432\u043e\u0437\u0447\u0438\u043a\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0434\u043b\u044f \u0433\u0440\u0443\u0437\u043e\u0432\u0438\u043a\u0430 (\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u0435\u0449\u0430\u0435\u043c\u044b\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u043f\u043e\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438). \u041d\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u043c\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0442\u0430\u043a \u0441\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0451\u043c\u044b \u0433\u0440\u0443\u0437\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043a\u0430\u0437\u0430\u043d\u044b \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u043e\u0447\u043a\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u043b\u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u043e\u0431\u044a\u0451\u043c \u0437\u0430\u043d\u044f\u0442\u043e\u0433\u043e \u0432 \u043a\u0443\u0437\u043e\u0432\u0435 \u043c\u0435\u0441\u0442\u0430 \u00ab\u043a\u043e\u043b\u0435\u0431\u0430\u043b\u0441\u044f\u00bb \u0432\u043e\u043a\u0440\u0443\u0433 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u043a\u0440\u0443\u0433 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b \u043e\u0442 \u0432\u0441\u0435\u0433\u043e \u043e\u0431\u044a\u0451\u043c\u0430 \u043a\u0443\u0437\u043e\u0432\u0430). \u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0431\u044a\u0451\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b, \u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u0438 \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0442\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b, \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u0446\u0435\u043b\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443 \u0437\u0430\u043a\u0430\u0437\u0430 (\u0432 \u0448\u0442\u0443\u043a\u0430\u0445) \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430. \u041f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043f\u043e\u0433\u0440\u0443\u0437\u043a\u0443 \u0432 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c, \u0430 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u2014 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0443 \u0438\u0437 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 \u0433\u0440\u0443\u0437\u043e\u0432\u0438\u043a \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d \u0440\u043e\u0432\u043d\u043e \u043d\u0430\u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443. \u041d\u0443\u0436\u043d\u043e \u0442\u0430\u043a \u0441\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0451\u043c\u044b \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u043d\u0430 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0443\u0441\u043b\u043e\u0432\u0438\u044e \u00ab\u043a\u043e\u043b\u0435\u0431\u0430\u043d\u0438\u044f\u00bb \u0437\u0430\u043d\u044f\u0442\u043e\u0433\u043e \u043e\u0431\u044a\u0451\u043c\u0430. \u0424\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  \u0414\u0430\u043d \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/35b\/a56\/5f3\/35ba565f36734f3a55aa01ac67868762.svg\" alt=\"$n$\" data-tex=\"inline\"\/> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/83a\/d7e\/b79\/83ad7eb794bc34d0de23f350c10017e5.svg\" alt=\"$a_0$\" data-tex=\"inline\"\/>, <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6ed\/7f2\/dea\/6ed7f2dea581700f308de45f26c48b49.svg\" alt=\"$a_1$\" data-tex=\"inline\"\/>,\u2026 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d71\/baf\/94c\/d71baf94ce7b8d9e69956cc026464226.svg\" alt=\"$a_n-1$\" data-tex=\"inline\"\/>. \u0422\u0430\u043a\u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u044b <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/807\/8a2\/467\/8078a2467c59d813e46878092d2987e2.svg\" alt=\"$prefix\\_sum(i) = a_0 + a_1 + ... + a_i$\" data-tex=\"inline\"\/>.<\/p>\n<p>  \u0412\u0430\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443.<\/li>\n<li>\u0423\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443.<\/li>\n<\/ul>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0430\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043b\u044e\u0431\u0430\u044f \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043d\u0430\u044f \u0441\u0443\u043c\u043c\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2bb\/229\/e11\/2bb229e111f1c431c7df9dc99dc97359.svg\" alt=\"$prefix\\_sum(i)$\" data-tex=\"inline\"\/> \u043b\u0438\u0431\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f, \u043b\u0438\u0431\u043e \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c17\/46c\/f90\/c1746cf9026447ff9a351f370badb3bd.svg\" alt=\"$i &lt; n \u2014 1$\" data-tex=\"inline\"\/> \u0437\u043d\u0430\u043a <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2bb\/229\/e11\/2bb229e111f1c431c7df9dc99dc97359.svg\" alt=\"$prefix\\_sum(i)$\" data-tex=\"inline\"\/> \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u0435\u043d \u0437\u043d\u0430\u043a\u0443 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f17\/611\/dcf\/f17611dcfb84eb08dd1c3ea05134701c.svg\" alt=\"$prefix\\_sum(i + 1)$\" data-tex=\"inline\"\/>.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/2a7\/965\/818\/2a796581866261879085038927b35b74.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/2a7\/965\/818\/2a796581866261879085038927b35b74.png\"\/><\/div>\n<p>  <\/p>\n<h3>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c<\/h3>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430 \u0434\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1a4\/98b\/92a\/1a498b92a120d1d2ede9b2535f274e55.svg\" alt=\"$[-1, 2, -2]$\" data-tex=\"inline\"\/>. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u043c\u0430\u0441\u0441\u0438\u0432 \u0443\u0436\u0435 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f.<\/p>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043e\u0434\u043d\u043e \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/35b\/a56\/5f3\/35ba565f36734f3a55aa01ac67868762.svg\" alt=\"$n$\" data-tex=\"inline\"\/> \u2014 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (<img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/064\/1c2\/0b9\/0641c20b958b9360cd5d7ddac00c28e0.svg\" alt=\"$1 &lt; n &lt; 10^5$\" data-tex=\"inline\"\/>). \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f n \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/83a\/d7e\/b79\/83ad7eb794bc34d0de23f350c10017e5.svg\" alt=\"$a_0$\" data-tex=\"inline\"\/>, <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6ed\/7f2\/dea\/6ed7f2dea581700f308de45f26c48b49.svg\" alt=\"$a_1$\" data-tex=\"inline\"\/>,\u2026 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d71\/baf\/94c\/d71baf94ce7b8d9e69956cc026464226.svg\" alt=\"$a_n-1$\" data-tex=\"inline\"\/>, \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u043c \u2014 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (<img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a15\/f64\/2d7\/a15f642d7e26ed49e80bd1d212e39ea8.svg\" alt=\"$-10^9 &lt; a_i &lt; 10^9$\" data-tex=\"inline\"\/>).<\/p>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e \u2014 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u043b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u0415\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0437\u043d\u0430\u043a \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0432\u0435\u043d <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c07\/e68\/d83\/c07e68d83a39d1758c075679fcee3a8a.svg\" alt=\"$prefix\\_sum(0)$\" data-tex=\"inline\"\/>, \u0442\u043e \u0437\u043d\u0430\u043a\u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043d\u044b\u0445 \u0441\u0443\u043c\u043c \u043d\u0430\u043c \u0443\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/491\/cee\/748\/491cee7488e5c72928fccee6bdca9700.svg\" alt=\"$a_0 = prefix\\_sum(0) > 0$&#187; data-tex=&#187;inline&#187;\/>, \u0442\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7be\/e8e\/9f2\/7bee8e9f2f8fd2e3be5f04c585ab95f6.svg\" alt=\"$prefix\\_sum(0), prefix\\_sum(2), prefix\\_sum(4) \\dots$\" data-tex=\"inline\"\/> \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438, \u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/45c\/fb2\/19c\/45cfb219cfbc0b448f45272cef6a5301.svg\" alt=\"$prefix\\_sum(1), prefix\\_sum(3), prefix\\_sum(5) \\dots$\" data-tex=\"inline\"\/> \u2014 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438.<\/p>\n<p>  \u041f\u0443\u0441\u0442\u044c \u043c\u044b \u0437\u043d\u0430\u0435\u043c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e32\/580\/a28\/e32580a28d5bcbe40d22ea0544a6d799.svg\" alt=\"$prefix\\_sum(i-1)$\" data-tex=\"inline\"\/>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0439 \u0437\u043d\u0430\u043a \u0434\u043b\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2bb\/229\/e11\/2bb229e111f1c431c7df9dc99dc97359.svg\" alt=\"$prefix\\_sum(i)$\" data-tex=\"inline\"\/>. \u041a\u0430\u043a\u043e\u0435 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/86c\/49d\/578\/86c49d57817f9cd369f158fd9ec22a28.svg\" alt=\"$a_i$\" data-tex=\"inline\"\/>, \u0447\u0442\u043e\u0431\u044b \u0441\u0443\u043c\u043c\u0430 <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/437\/aee\/af7\/437aeeaf76b0bb23d7935b858cbcb2b9.svg\" alt=\"$prefix\\_sum(i) = prefix\\_sum(i-1) + a_i$\" data-tex=\"inline\"\/> \u0441\u0442\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u0430? \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0432\u0430 \u0441\u043b\u0443\u0447\u0430\u044f:<\/p>\n<ol>\n<li>\u0415\u0441\u043b\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/437\/aee\/af7\/437aeeaf76b0bb23d7935b858cbcb2b9.svg\" alt=\"$prefix\\_sum(i) = prefix\\_sum(i-1) + a_i$\" data-tex=\"inline\"\/> \u0443\u0436\u0435 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u0430, \u0442\u043e\u0433\u0434\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u043b\u044e.<br \/>  \u0418\u043d\u0430\u0447\u0435 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u043f\u043e\u0434\u0441\u043b\u0443\u0447\u0430\u044f:\n<ol>\n<li>\u0415\u0441\u043b\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e4d\/83d\/5d3\/e4d83d5d336911dd34ffcadf9cdbad81.svg\" alt=\"$prefix\\_sum(i-1) + a_i > 0$&#187; data-tex=&#187;inline&#187;\/>, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/db4\/ade\/2a9\/db4ade2a90709677c297371800ed6970.svg\" alt=\"$prefix\\_sum(i-1) + a_i + 1$\" data-tex=\"inline\"\/> \u0440\u0430\u0437, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b3a\/b1c\/80e\/b3ab1c80e8061efe071d9b3cfb959003.svg\" alt=\"$-1$\" data-tex=\"inline\"\/> \u2014 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043d\u0430\u044f \u0441\u0443\u043c\u043c\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/502\/f96\/0ea\/502f960ea92bcba31646e66cccd41554.svg\" alt=\"$0$\" data-tex=\"inline\"\/> \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u0430 \u0441\u0443\u043c\u043c\u0443 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f14\/aab\/73f\/f14aab73f9299934c8bd991a6ffdec2a.svg\" alt=\"$-2$\" data-tex=\"inline\"\/> \u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043c\u044b\u0441\u043b\u0430 \u043d\u0435\u0442: \u043c\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0431\u043e\u043b\u044c\u0448\u0435, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. <\/li>\n<li>\u0415\u0441\u043b\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/ff2\/84d\/9d4\/ff284d9d4560cc0b12566abb0f8ee357.svg\" alt=\"$prefix\\_sum(i-1) + a_i &lt; 0$\" data-tex=\"inline\"\/>, \u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/31f\/7d8\/129\/31f7d81291ada3a1084e448ccc5f83b9.svg\" alt=\"$-(prefix\\_sum(i-1) + a_i ) + 1$\" data-tex=\"inline\"\/> \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/>. <\/li>\n<li>\u0415\u0441\u043b\u0438 \u0436\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/bc2\/99a\/f34\/bc299af3420d2ca5aebb57cecfedf020.svg\" alt=\"$prefix\\_sum(i-1) + a_i = 0$\" data-tex=\"inline\"\/>, \u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0434\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u0430.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435, \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u0432\u0430 \u0441\u043b\u0443\u0447\u0430\u044f: \u043a\u043e\u0433\u0434\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e6e\/65d\/916\/e6e65d91665352cb7638f11b2a9f7285.svg\" alt=\"$prefix\\_sum(0) > 0$&#187; data-tex=&#187;inline&#187;\/> \u0438 \u043a\u043e\u0433\u0434\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/198\/b68\/9bf\/198b689bf0cf9a8a6cda83f6407d53dc.svg\" alt=\"$prefix\\_sum(0) &lt; 0$\" data-tex=\"inline\"\/>; \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043d\u0438\u0445 \u043d\u0430\u0439\u0442\u0438 \u043e\u0442\u0432\u0435\u0442 \u0438 \u0432\u0437\u044f\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0434\u0432\u0443\u0445. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u0443\u044e \u0430\u0441\u0438\u043c\u043f\u0442\u043e\u0442\u0438\u043a\u0443.  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u042d\u0442\u043e \u0431\u044b\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0437 \u043e\u0442\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0440\u0430\u0443\u043d\u0434\u0430 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0443\u0440\u0441 \u00ab<a href=\"https:\/\/route256.ozon.ru\/qa-engineer\">\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0430 Go<\/a>\u00bb. \u041a\u0430\u043a\u0438\u0435 \u0434\u0430\u043b\u0438\u0441\u044c \u0432\u0430\u043c \u043b\u0435\u0433\u0447\u0435 \u0432\u0441\u0435\u0433\u043e, \u0430 \u043a\u0430\u043a\u0438\u0435 \u0442\u0440\u0443\u0434\u043d\u0435\u0435? \u0418 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u043e \u0441\u0432\u043e\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u043e\u0449\u0435 \u0438\u043b\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u043d\u0430\u0448\u0438\u0445 \ud83d\ude42<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <\/p>\n<div class=\"tm-article-poll\">\n<div class=\"tm-notice tm-article-poll__notice tm-notice_positive\"><!----> <\/p>\n<div class=\"tm-notice__inner\"><!----> <\/p>\n<div class=\"tm-notice__content\"><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/company\/vk\/blog\/661557\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__header\">\u041a\u0430\u043a\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0432\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0441\u0430\u043c\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439?<\/div>\n<div class=\"tm-article-poll__answers\">\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">             0%           <\/span> <span class=\"tm-article-poll__answer-label\">\u0425\u044d\u0448<\/span> <span class=\"tm-article-poll__answer-votes\">             0           <\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width:0%;\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">             0%           <\/span> <span class=\"tm-article-poll__answer-label\">\u0413\u043e\u0440\u043e\u0434\u0430<\/span> <span class=\"tm-article-poll__answer-votes\">             0           <\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width:0%;\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">             0%           <\/span> <span class=\"tm-article-poll__answer-label\">\u0418\u043d\u0432\u0435\u0440\u0441\u0438\u0438<\/span> <span class=\"tm-article-poll__answer-votes\">             0           <\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width:0%;\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">             50%           <\/span> <span class=\"tm-article-poll__answer-label\">\u041e\u0431\u0449\u0435\u0435 \u043f\u043e\u043b\u0435<\/span> <span class=\"tm-article-poll__answer-votes\">             1           <\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width:50%;\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">             0%           <\/span> <span class=\"tm-article-poll__answer-label\">\u0414\u0430\u0442\u044b<\/span> <span class=\"tm-article-poll__answer-votes\">             0           <\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width:0%;\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">             0%           <\/span> <span class=\"tm-article-poll__answer-label\">\u0420\u0435\u0433\u0438\u043e\u043d\u044b<\/span> <span class=\"tm-article-poll__answer-votes\">             0           <\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width:0%;\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">             50%           <\/span> <span class=\"tm-article-poll__answer-label\">\u041b\u043e\u0433\u0438\u0441\u0442\u0438\u043a\u0430<\/span> <span class=\"tm-article-poll__answer-votes\">             1           <\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width:50%;\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">             0%           <\/span> <span class=\"tm-article-poll__answer-label\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b<\/span> <span class=\"tm-article-poll__answer-votes\">             0           <\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width:0%;\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__stats\">        \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 2 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.           \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0435\u0442.      <\/div>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/vk\/blog\/661557\/\"> https:\/\/habr.com\/ru\/company\/vk\/blog\/661557\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\u0414\u0440\u0443\u0437\u044c\u044f, \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043c\u044b \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438 \u0440\u0430\u0437\u0431\u043e\u0440 \u0437\u0430\u0434\u0430\u0447 \u0438\u0437 \u043e\u0442\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0441\u0442\u0430 \u043d\u0430 \u043a\u0443\u0440\u0441 <a href=\"https:\/\/route256.ozon.ru\/qa-engineer\">\u00ab\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0430 Go\u00bb<\/a>. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u043f\u043e\u043b\u043e\u043c\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0432\u0443 \u043d\u0430\u0434 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438 \u0434\u043b\u044f QA-\u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435 \u0441 \u043d\u0430\u0448\u0438\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/lq\/v6\/cm\/lqv6cmsp9l7a13pz-vktiq2igsm.png\" data-src=\"https:\/\/habrastorage.org\/webt\/lq\/v6\/cm\/lqv6cmsp9l7a13pz-vktiq2igsm.png\"\/><\/div>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-332067","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=332067"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332067\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=332067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=332067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=332067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}