{"id":375060,"date":"2024-05-21T06:15:16","date_gmt":"2024-05-21T06:15:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=375060"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=375060","title":{"rendered":"<span>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u0435\u043b\u0435\u043d\u0438\u044f 2W-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c\u044e W<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 32-\u0431\u0438\u0442\u043d\u044b\u0445 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0447\u0438\u0441\u043b\u0430 \u0441 \u0434\u0432\u0443\u043a\u0440\u0430\u0442\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435\u0439 (16 \u0431\u0438\u0442) \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c\u044e. \u0414\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421++.<\/p>\n<h3>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430<\/h3>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"{2W}\" alt=\"{2W}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/290\/24d\/b7e\/29024db7e260aec3ea96fe0165bbc617.svg\" width=\"30\" height=\"17\"\/>-\u0431\u0438\u0442\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"X\" alt=\"X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9c7\/5f9\/082\/9c75f90828d8815e04417f288985e2f7.svg\" width=\"16\" height=\"17\"\/> \u0432 \u0432\u0438\u0434\u0435:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"X = (A, B) = A \\cdot {2}^{W} + B,\" alt=\"X = (A, B) = A \\cdot {2}^{W} + B,\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/459\/372\/2e4\/4593722e40c405e911cf693209de17ac.svg\" width=\"218\" height=\"25\"\/><\/p>\n<p>\u0433\u0434\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A\" alt=\"A\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/056\/f47\/c96\/056f47c96e3429eb12fc4b7a48660d0c.svg\" width=\"14\" height=\"17\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"B\" alt=\"B\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0d6\/0dc\/a62\/0d60dca62c70171d97c17138b54400fe.svg\" width=\"15\" height=\"17\"\/> &#8212; \u0441\u0442\u0430\u0440\u0448\u0430\u044f \u0438 \u043c\u043b\u0430\u0434\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"{W}\" alt=\"{W}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fb1\/973\/1dd\/fb19731ddb0d71ab339c547cd368d265.svg\" width=\"20\" height=\"17\"\/>-\u0431\u0438\u0442\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0447\u0438\u0441\u043b\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"X\" alt=\"X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b1c\/2de\/7c9\/b1c2de7c92e9d262214fc635d69a62fd.svg\" width=\"16\" height=\"17\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Y\" alt=\"Y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/191\/fd5\/8c8\/191fd58c8a2560ef0630639a0604603d.svg\" width=\"15\" height=\"16\"\/>, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0434\u0440\u043e\u0431\u0438:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Z = {{X} \\over {Y}} = {{A \\cdot {2}^{W} + B} \\over {C \\cdot {2}^{W} + D}}.\" alt=\"Z = {{X} \\over {Y}} = {{A \\cdot {2}^{W} + B} \\over {C \\cdot {2}^{W} + D}}.\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/040\/cf0\/643\/040cf064348d65be513f6ac26ed3631c.svg\" width=\"195\" height=\"50\"\/><\/p>\n<p>\u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 <img class=\"formula inline\" source=\"C>0&#8243; alt=&#187;C>0&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4fb\/660\/495\/4fb6604952678952f3d37508f77ceaf3.svg&#187; width=&#187;50&#8243; height=&#187;17&#8243;\/>, \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f &#8212; \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"{W}\" alt=\"{W}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/411\/22f\/ce9\/41122fce9ef2243395df1a04cdc98143.svg\" width=\"20\" height=\"17\"\/>-\u0431\u0438\u0442\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c\u0441\u044f \u044d\u0442\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c. \u0414\u043b\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"C=0\" alt=\"C=0\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/adf\/9d0\/05c\/adf9d005cd4b03164fb5a66590382d14.svg\" width=\"50\" height=\"17\"\/>\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435 \u043d\u0430 \u0421++ \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u0435\u043b\u0435\u043d\u0438\u044f &#171;\u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e&#187; \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 &#171;\u0443\u0437\u043a\u043e\u0435&#187;, \u0441\u043c. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0410.<\/p>\n<p>\u0421\u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u043b\u0435\u0435, \u0447\u0442\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A \\geq C\" alt=\"A \\geq C\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/311\/29e\/e87\/31129ee87e8c620262744891c6de6954.svg\" width=\"55\" height=\"19\"\/>, \u0438\u043d\u0430\u0447\u0435 &#8212; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0432\u0435\u043d \u043d\u0443\u043b\u044e. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0447\u0438\u0441\u043b\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A\" alt=\"A\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c54\/9a4\/804\/c549a480466426af8638ff2366e6435e.svg\" width=\"14\" height=\"17\"\/> \u0432 \u0432\u0438\u0434\u0435: <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"A = \\left \\lfloor {{A} \\over {C}} \\right \\rfloor \\cdot C + A \\mod C = q \\cdot C + r.\" alt=\"A = \\left \\lfloor {{A} \\over {C}} \\right \\rfloor \\cdot C + A \\mod C = q \\cdot C + r.\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4ab\/8c5\/e68\/4ab8c5e68d76146b5cf148a4b8763add.svg\" width=\"335\" height=\"49\"\/><\/p>\n<p>\u0417\u0434\u0435\u0441\u044c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"q = \\left \\lfloor {{A} \\over {C}} \\right \\rfloor\" alt=\"q = \\left \\lfloor {{A} \\over {C}} \\right \\rfloor\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/154\/a10\/59b\/154a1059b96704ad08d8414f41a16ef2.svg\" width=\"79\" height=\"49\"\/> &#8212; \u0446\u0435\u043b\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"r = A \\mod C\" alt=\"r = A \\mod C\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/abc\/7fc\/d25\/abc7fcd25643249aef2a3f1311692011.svg\" width=\"132\" height=\"17\"\/> &#8212; \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A\" alt=\"A\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/629\/1fe\/5f3\/6291fe5f3dc7fd9badaa577e6ca873ac.svg\" width=\"14\" height=\"17\"\/> \u043d\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"C\" alt=\"C\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a98\/538\/91a\/a9853891a7c8668737a4d40a7f7b3a41.svg\" width=\"15\" height=\"17\"\/>.<\/p>\n<p>\u041f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u0434\u0440\u043e\u0431\u044c: <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Z = {{q \\cdot C \\cdot {2}^{W} + B + r \\cdot {2}^{W} } \\over {C \\cdot {2}^{W} + D}}.\" alt=\"Z = {{q \\cdot C \\cdot {2}^{W} + B + r \\cdot {2}^{W} } \\over {C \\cdot {2}^{W} + D}}.\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/687\/2ae\/8d0\/6872ae8d0e51401d2b3e688e83b002bb.svg\" width=\"239\" height=\"50\"\/><\/p>\n<p>\u041f\u0440\u0435\u043d\u0435\u0431\u0440\u0435\u0436\u0435\u043c \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u043c  <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"B\" alt=\"B\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/871\/746\/a5c\/871746a5cbceaadea60cd618045e900d.svg\" width=\"15\" height=\"17\"\/>, \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u0443:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Z_1 = {(q \\cdot C + r)}{{{2}^{W}} \\over {C \\cdot {2}^{W} + D}} \\leq Z.\" alt=\"Z_1 = {(q \\cdot C + r)}{{{2}^{W}} \\over {C \\cdot {2}^{W} + D}} \\leq Z.\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/57d\/92d\/51c\/57d92d51c4f1a8f9d7e670472851555e.svg\" width=\"278\" height=\"50\"\/><\/p>\n<p>\u0412\u044b\u0434\u0435\u043b\u0438\u043c \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"q\" alt=\"q\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/43a\/bcb\/3af\/43abcb3af9f9f1bef89dd702da103a79.svg\" width=\"9\" height=\"15\"\/> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b: <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Z_1 = q + {{r \\cdot {2}^{W} - D \\cdot q} \\over {C \\cdot {2}^{W} + D}}.\" alt=\"Z_1 = q + {{r \\cdot {2}^{W} - D \\cdot q} \\over {C \\cdot {2}^{W} + D}}.\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2bb\/74c\/c06\/2bb74cc061cac1c9ee34d03bceb29cde.svg\" width=\"203\" height=\"50\"\/><\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\Delta=2^W-D.\" alt=\"\\Delta=2^W-D.\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6e2\/387\/281\/6e23872818358de30b13cf35e91bad02.svg\" width=\"113\" height=\"22\"\/> \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e &#171;\u0442\u044f\u0436\u0435\u043b\u044b\u0435&#187; \u0441\u043b\u0443\u0447\u0430\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"D\" alt=\"D\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9ba\/c84\/cdd\/9bac84cddef1bb0d976430f6347bc666.svg\" width=\"16\" height=\"17\"\/> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 &#171;\u0434\u0435\u043b\u044c\u0442\u0430&#187; \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043b \u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Z_1 = q + {{(r-q) \\cdot {2}^{W} + \\Delta \\cdot q} \\over {(C+1) \\cdot {2}^{W} - \\Delta}}.\" alt=\"Z_1 = q + {{(r-q) \\cdot {2}^{W} + \\Delta \\cdot q} \\over {(C+1) \\cdot {2}^{W} - \\Delta}}.\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/247\/a23\/40b\/247a2340b7d08f28d82439d7fb9de7ad.svg\" width=\"251\" height=\"55\"\/><\/p>\n<p>\u0412 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0435 \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0435 \u0434\u0440\u043e\u0431\u0438 \u0441\u0442\u043e\u044f\u0442 &#171;\u0448\u0438\u0440\u043e\u043a\u0438\u0435&#187; \u0447\u0438\u0441\u043b\u0430 (\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c\u044e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"2W\" alt=\"2W\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/75f\/c35\/30c\/75fc3530c38770167bf29ee08e866bc7.svg\" width=\"30\" height=\"17\"\/>). \u0422\u0430\u043a \u043a\u0430\u043a \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u0443\u0437\u043a\u043e\u0435, \u0442\u043e \u0434\u043e\u0431\u044c\u0435\u043c\u0441\u044f &#171;\u0443\u0437\u043e\u0441\u0442\u0438&#187; \u0447\u0438\u0441\u043b\u0430 \u0432 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0435, \u0432\u044b\u043d\u0435\u0441\u044f \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"C+1\" alt=\"C+1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9b0\/00f\/ddf\/9b000fddfa8b9814ca1455d091d7932d.svg\" width=\"48\" height=\"18\"\/> \u0437\u0430 \u0441\u043a\u043e\u0431\u043a\u0438 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Z_1 = q + { { {(r-q) \\cdot {2}^{W} + \\Delta \\cdot q} \\over {{2}^{W} - {{\\Delta} \\over {C+1}}} } \\over {C + 1} }.\" alt=\"Z_1 = q + { { {(r-q) \\cdot {2}^{W} + \\Delta \\cdot q} \\over {{2}^{W} - {{\\Delta} \\over {C+1}}} } \\over {C + 1} }.\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d1b\/ab3\/168\/d1bab3168add4d6c2921974a6a95dd25.svg\" width=\"187\" height=\"69\"\/><\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, &#171;\u0448\u0438\u0440\u043e\u043a\u0438\u0439&#187; \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c <strong>\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e<\/strong> \u0434\u0435\u043b\u0438\u043c \u043d\u0430 &#171;\u0443\u0437\u043a\u0438\u0435&#187; \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0438. \u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0432\u043d\u044f\u0442\u044c\u0441\u044f \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"2^W\" alt=\"2^W\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2a1\/d5d\/04f\/2a1d5d04f0b065229180bcc611d4fc8a.svg\" width=\"26\" height=\"21\"\/>, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435: \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0445 \u0426\u041f\u0423 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0431\u043d\u0443\u043b\u0438\u0442\u0441\u044f \u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0432\u044b\u0447\u0435\u0441\u0442\u044c \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0438 \u043d\u0435 \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u043e \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 <img class=\"formula inline\" source=\"C>0&#8243; alt=&#187;C>0&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/99b\/2d7\/ac9\/99b2d7ac9de96008d7b7389903514908.svg&#187; width=&#187;50&#8243; height=&#187;17&#8243;\/>. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\Delta\" alt=\"\\Delta\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d8e\/208\/0b6\/d8e2080b6a2e28824087ba1b83be422b.svg\" width=\"16\" height=\"17\"\/>, \u0447\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0434\u0430\u0441\u0442 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\Delta = 2^W - 1 - D,\" alt=\"\\Delta = 2^W - 1 - D,\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/184\/2ba\/496\/1842ba4966ac8ddb021730d75aa7e399.svg\" width=\"146\" height=\"24\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Z_1 = q + {{ {(r-q) \\cdot {2}^{W} + \\Delta \\cdot q} \\over {{2}^{W} - 1 - {{\\Delta} \\over {C+1}}} } \\over {C + 1} },\" alt=\"Z_1 = q + {{ {(r-q) \\cdot {2}^{W} + \\Delta \\cdot q} \\over {{2}^{W} - 1 - {{\\Delta} \\over {C+1}}} } \\over {C + 1} },\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/61e\/326\/375\/61e3263759ee61bca88c545d74a59473.svg\" width=\"187\" height=\"69\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"q = \\left \\lfloor {{A} \\over {C}} \\right \\rfloor,\" alt=\"q = \\left \\lfloor {{A} \\over {C}} \\right \\rfloor,\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/283\/cfb\/16a\/283cfb16a7d4b0b9e93bcebabd573fd3.svg\" width=\"87\" height=\"49\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"r = A \\mod C.\" alt=\"r = A \\mod C.\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ae\/ffe\/11f\/5aeffe11f14782ea407a25be409fa503.svg\" width=\"137\" height=\"17\"\/><\/p>\n<p>\u0427\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0434\u043d\u043e\u0439 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438. \u0424\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f <img class=\"formula inline\" source=\"C>0&#8243; alt=&#187;C>0&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b52\/48d\/bdb\/b5248dbdbdd7efd5880883f7be179a15.svg&#187; width=&#187;50&#8243; height=&#187;17&#8243;\/>, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 \u0432 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0435 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0447\u0430\u0441\u0442\u043d\u043e\u043c\u0443. \u041e\u0434\u043d\u0430\u043a\u043e, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f &#171;fine tuning&#187; &#8212; \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0446\u0438\u043a\u043b\u0435 \u0438 \u0437\u0430 \u043e\u0434\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f &#171;\u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e&#187; \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 &#171;\u0443\u0437\u043a\u043e\u0435&#187;, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u043d\u043e\u0435 \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443.<\/p>\n<p>\u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a \u0442\u0438\u043f\u0443 \u0447\u0438\u0441\u0435\u043b: \u0446\u0435\u043b\u043e\u0435, \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439, \u0432 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438 \u0442. \u043f. \u041e\u0441\u043d\u043e\u0432\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0434\u0432\u0443\u0445 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u043e\u043a: \u0441\u0442\u0430\u0440\u0448\u0435\u0439 \u0438 \u043c\u043b\u0430\u0434\u0448\u0435\u0439. \u0417\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0431\u0438\u0442\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439, \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0447\u0438\u0441\u043b\u0430 \u0431\u0435\u0437 \u0437\u043d\u0430\u043a\u0430.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0421++<\/h3>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;limits.h> #include &lt;algorithm> #include &lt;cassert> #include &lt;cmath> #include &lt;cstdint> #include &lt;iostream> #include &lt;list> #include &lt;random> #include &lt;string>  using u64 = uint64_t; using i64 = int64_t; using u32 = uint32_t; using u16 = uint16_t;  using ULOW = u16; \/\/ \u0422\u0438\u043f \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u043e\u043a: \u0441\u0442\u0430\u0440\u0448\u0435\u0439 \u0438 \u043c\u043b\u0430\u0434\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0435\u0439 \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.  static_assert(CHAR_BIT == 8);  struct Quadrupole { \/\/ \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0434\u0440\u043e\u0431\u0438 (A*M + B) \/ (C*M + D).                     \/\/ M - \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, 2^W, W - \u0431\u0438\u0442\u043e\u0432\u0430\u044f \u0448\u0438\u0440\u0438\u043d\u0430 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u043e\u043a.     ULOW A;     ULOW B;     ULOW C;     ULOW D; };  struct Signess { \/\/ \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u043a\u043e\u0432 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b.     int s1;     int s2; };  static auto const seed = std::random_device{}();  \/***  * \u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.  *\/ auto roll_ulow = [urbg = std::mt19937{seed},                 distr = std::uniform_int_distribution&lt;ULOW>{}]() mutable -> ULOW {     return distr(urbg); };  static constexpr char DIGITS[10]{'0', '1', '2', '3', '4',                                  '5', '6', '7', '8', '9'};  \/\/ High\/Low \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 32-\u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0438 \u0444\u043b\u0430\u0433\u043e\u043c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \/\/ \u0414\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 U32 \u0447\u0438\u0441\u0435\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \/\/ \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u043a\u0440\u043e\u043c\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 U32 \u0447\u0438\u0441\u0435\u043b. \/\/ \u0415\u0441\u043b\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430,  \/\/ \u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0435\u0431\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c: \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c 128-\u0431\u0438\u0442\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430,  \/\/ 256-\u0431\u0438\u0442\u043d\u044b\u0435 \u0438 \u0442.\u0434. struct U32 {     \/\/ \u0411\u0438\u0442\u043e\u0432\u0430\u044f \u043f\u043e\u043b\u0443\u0448\u0438\u0440\u0438\u043d\u0430 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u043e\u043a.     static constexpr int mHalfWidth = (sizeof(ULOW) * CHAR_BIT) \/ 2;     \/\/ \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u043e\u043a, M-1.     static constexpr ULOW mMaxULOW = ULOW(-1);     ULOW mHigh = 0;     ULOW mLow = 0;     int mSign = 0;     int mOverflow = 0;  bool is_negative() const {     return mSign != 0; }  bool is_overflow() const {     return mOverflow != 0; }  bool is_zero() const {     return (mLow | mHigh | mOverflow) == 0; }  constexpr static U32 get_zero() {     return U32 {.mHigh = 0, .mLow = 0, .mSign = 0, .mOverflow = 0}; }  constexpr static U32 get_unit() {     return U32 {.mHigh = 0, .mLow = 1, .mSign = 0, .mOverflow = 0}; }  constexpr static U32 get_unit_neg() {     return U32 {.mHigh = 0, .mLow = 1, .mSign = 1, .mOverflow = 0}; }  U32 operator+(U32 rhs) const {     U32 result{};     U32 X = *this;     if (X.is_negative() &amp;&amp; !rhs.is_negative()) {         X.mSign = 0;         result = rhs - X;         return result;     }     if (!X.is_negative() &amp;&amp; rhs.is_negative()) {         rhs.mSign = 0;         result = X - rhs;         return result;     }     result.mLow = X.mLow + rhs.mLow;     const ULOW c1 = result.mLow &lt; std::min(X.mLow, rhs.mLow);     result.mHigh = X.mHigh + rhs.mHigh;     const int c2 = result.mHigh &lt; std::min(X.mHigh, rhs.mHigh);     ULOW tmp = result.mHigh;     result.mHigh = tmp + c1;     const int c3 = result.mHigh &lt; std::min(tmp, c1);     result.mOverflow = c2 || c3;     if (X.mSign &amp;&amp; rhs.mSign) {         result.mSign = 1;     }     return result; }  U32&amp; operator+=(U32 other) {     *this = *this + other;     return *this; }  U32 operator-(U32 rhs) const {     U32 result{};     U32 X = *this;     if (X.is_negative() &amp;&amp; !rhs.is_negative()) {         rhs.mSign = 1;         result = rhs + X;         return result;     }     if (!X.is_negative() &amp;&amp; rhs.is_negative()) {         rhs.mSign = 0;         result = X + rhs;         return result;     }     if (X.is_negative() &amp;&amp; rhs.is_negative()) {         rhs.mSign = 0;         X.mSign = 0;         result = rhs - X;         return result;     }     if (X.is_zero()) {         result = rhs;         result.mSign = rhs.mSign ^ 1;         return result;     }     result.mLow = X.mLow - rhs.mLow;     result.mHigh = X.mHigh - rhs.mHigh;     const bool borrow = X.mLow &lt; rhs.mLow;     const bool hasUnit = X.mHigh > rhs.mHigh;     if (borrow &amp;&amp; hasUnit) {         result.mHigh -= ULOW(1);     }     if (borrow &amp;&amp; !hasUnit) {         result = rhs - X;         result.mSign ^= 1;         return result;     }     if (!borrow &amp;&amp; X.mHigh &lt; rhs.mHigh) {         result.mHigh = -result.mHigh - ULOW(result.mLow != 0);         result.mLow = -result.mLow;         result.mSign = 1;     }     return result; }  U32&amp; operator-=(U32 other) {     *this = *this - other;     return *this; }  U32 mult16(ULOW x, ULOW y) const {     constexpr ULOW MASK = (ULOW(1) &lt;&lt; mHalfWidth) - 1;     const ULOW x_low = x &amp; MASK;     const ULOW y_low = y &amp; MASK;     const ULOW x_high = x >> mHalfWidth;     const ULOW y_high = y >> mHalfWidth;     const ULOW t1 = x_low * y_low;     const ULOW t = t1 >> mHalfWidth;     const ULOW t21 = x_low * y_high;     const ULOW q = t21 >> mHalfWidth;     const ULOW p = t21 &amp; MASK;     const ULOW t22 = x_high * y_low;     const ULOW s = t22 >> mHalfWidth;     const ULOW r = t22 &amp; MASK;     const ULOW t3 = x_high * y_high;     U32 result{};     result.mLow = t1;     const ULOW div = (q + s) + ((p + r + t) >> mHalfWidth);     const ULOW mod = (t21 &lt;&lt; mHalfWidth) + (t22 &lt;&lt; mHalfWidth);     result.mLow += mod;     result.mHigh += div;     result.mHigh += t3;     result.mOverflow = result.mHigh &lt; t3 ? 1 : 0;     return result; }  U32 operator*(ULOW rhs) const {     U32 result = mult16(mLow, rhs);     U32 tmp = mult16(mHigh, rhs);     tmp.mHigh = tmp.mLow;     tmp.mLow = 0;     result += tmp;     result.mSign = this->mSign;     return result; }  U32 operator\/(ULOW y) const {     U32 X = *this;     const int sign = X.mSign;     X.mSign = 0;     ULOW Q = X.mHigh \/ y;     ULOW R = X.mHigh % y;     ULOW N = R * (mMaxULOW \/ y) + (X.mLow \/ y);     U32 result{.mHigh = Q, .mLow = N};     U32 E = X - result * y;     while (E.mHigh != 0 || E.mLow >= y) {         Q = E.mHigh \/ y;         R = E.mHigh % y;         N = R * (mMaxULOW \/ y) + (E.mLow \/ y);         const U32 tmp {.mHigh = Q, .mLow = N};         result += tmp;         E -= tmp * y;     }     result.mSign = sign;     return result; }  U32&amp; operator\/=(ULOW y) {     *this = *this \/ y;     return *this; }  U32 operator\/(const U32 other) const {     U32 X = *this;     U32 Y = other;     constexpr U32 ZERO = get_zero();     constexpr U32 UNIT = get_unit();     constexpr U32 UNIT_NEG = get_unit_neg();     if (X.mHigh &lt; Y.mHigh) {         return ZERO;     }     if (Y.mHigh == 0) {         U32 result = X \/ Y.mLow;         result.mSign ^= (Y.is_negative());         return result;     }     const int make_sign_inverse = (X.mSign != Y.mSign);     X.mSign = 0;     Y.mSign = 0;     const ULOW Q = X.mHigh \/ Y.mHigh;     const ULOW R = X.mHigh % Y.mHigh;     const ULOW Delta = mMaxULOW - Y.mLow;     const U32 DeltaQ = mult16(Delta, Q);     U32 W1 = U32{.mHigh = R, .mLow = 0} - U32{.mHigh = Q, .mLow = 0};     W1 = W1 + DeltaQ;     ULOW C1 = (Y.mHigh &lt; mMaxULOW) ? Y.mHigh + 1u : mMaxULOW;     ULOW W2 = mMaxULOW - Delta \/ C1;     U32 Quotient = W1 \/ W2;     Quotient = Quotient \/ C1;     U32 result = U32{.mHigh = 0, .mLow = Q} + Quotient;     U32 N = Y * result.mLow;     if (N.mOverflow != 0) {         result.mLow -= 1;         N = Y * result.mLow;     }     U32 Error = (result.is_negative()) ? X + N : X - N;     U32 More = Error - Y;     bool do_inc = !More.is_negative();     bool do_dec = Error.is_negative();     while (do_dec || do_inc) {         result += (do_inc ? UNIT : (do_dec ? UNIT_NEG : ZERO));         if (do_dec) {             Error += Y;         }         if (do_inc) {             Error -= Y;         }         More = Error - Y;         do_inc = !More.is_negative();         do_dec = Error.is_negative();     }     result.mSign ^= make_sign_inverse;     return result; }  \/**  * \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430.  *\/ std::string value() const {     std::string result{};     if (this->is_overflow()) {         result = \"Overflow\";         return result;     }     U32 X = *this;     constexpr int multiplier_mod10 = mMaxULOW % 10 + 1;     while (!X.is_zero()) {         const int d =             ((X.mLow % 10) + multiplier_mod10 * (X.mHigh % 10)) % 10;         result.push_back(DIGITS[d]);         X \/= 10;     }     if (this->is_negative() &amp;&amp; !this->is_zero()) {         result.push_back('-');     }     std::reverse(result.begin(), result.end());     return result.length() != 0 ? result : \"0\"; } };  bool test_div(U32 z1, U32 z2) {     const U32 z3 = z1 \/ z2;     i64 x = ((u64)z1.mHigh &lt;&lt; 16) + (u64)z1.mLow;     i64 y = ((u64)z2.mHigh &lt;&lt; 16) + (u64)z2.mLow;     x = z1.is_negative() ? -x : x;     y = z2.is_negative() ? -y : y;     const i64 z_built_in = x \/ y;     i64 z = ((u64)z3.mHigh &lt;&lt; 16) + (u64)z3.mLow;     z = z3.is_negative() ? -z : z;     bool is_ok = z_built_in == z;     if (!is_ok) {         std::cout &lt;&lt; \"Assertion:\\n\";         std::cout &lt;&lt; \"Built-in: \" &lt;&lt; x &lt;&lt; \" \/ \" &lt;&lt; y &lt;&lt; \" = \" &lt;&lt; z_built_in                   &lt;&lt; '\\n';         std::cout &lt;&lt; \"This algorithm: \" &lt;&lt; x &lt;&lt; \" \/ \" &lt;&lt; y &lt;&lt; \" = \"                   &lt;&lt; z3.value() &lt;&lt; '\\n';         std::cout &lt;&lt; \"Parameters: ABCD, s1, s2: \" &lt;&lt; z1.mHigh &lt;&lt; \", \" &lt;&lt; z1.mLow                   &lt;&lt; \", \" &lt;&lt; z2.mHigh &lt;&lt; \", \" &lt;&lt; z2.mLow &lt;&lt; \", \" &lt;&lt; z1.mSign                   &lt;&lt; \", \" &lt;&lt; z2.mSign &lt;&lt; '\\n';     }     return is_ok; }  void test_division_quick() {     const std::list&lt;Quadrupole> my_cases = {         {51774, 28457, 50018, 10280}, {28792, 5507, 37, 64804},         {65258, 18362, 87, 35198},    {65526, 63280, 198, 52129},         {56139, 10364, 39, 36881},    {65498, 60804, 204, 20825},         {58092, 52199, 1, 57003},     {65498, 60804, 204, 20825},         {64666, 34598, 1, 60805},     {30903, 7652, 143, 48035},         {30161, 40182, 3351, 26310},  {40824, 35384, 13, 49151},         {60215, 18033, 165, 58003},   {42499, 42189, 4, 58879},         {16384, 16384, 0, 1},         {16384, 16384, 1, 0},         {16384, 16384, 1, 65535},     {16384, 16384, 1, 1},         {16384, 16384, 1, 65535},     {16384, 16384, 65535, 1},         {16384, 16384, 1, 65535},     {16384, 16384, 65535, 65535},         {16384, 16384, 65535, 65535}, {16384, 16384, 65535, 65535}         };     auto make_test = [](const Quadrupole q) -> bool {         return test_div({.mHigh = q.A, .mLow = q.B},                         {.mHigh = q.C, .mLow = q.D});     };     bool is_ok = true;     for (const auto&amp; element : my_cases) {         is_ok &amp;= make_test(element);     }     assert(is_ok); }  void test_division_randomly(long long N) {     if (N &lt; 1) {         std::cout &lt;&lt; \"Skipped!\\n\";         return;     }     auto make_test = [](const Quadrupole q, const Signess s) -> bool {         return test_div(U32{.mHigh = q.A, .mLow = q.B, .mSign = s.s1},                         U32{.mHigh = q.C, .mLow = q.D, .mSign = s.s2});     };     long long counter = 0;     long long ext = 0;     bool is_ok = true;     while (ext &lt; N) {         ++counter;         const Quadrupole q{roll_ulow(), roll_ulow(), roll_ulow(), roll_ulow()};         const Signess s{roll_ulow() % 2, roll_ulow() % 2};         if (q.C == 0 &amp;&amp; q.D == 0) {             continue;         }         is_ok &amp;= make_test(q, s);         assert(is_ok);         if (counter % (1ll &lt;&lt; 27) == 0) {             ext++;             std::cout &lt;&lt; \"... iterations: \" &lt;&lt; counter &lt;&lt; \". External: \" &lt;&lt;                  ext &lt;&lt; \" from \" &lt;&lt; N &lt;&lt; '\\n';         }     } }  int main(int argc, char* argv[]) {     long long N = 10;     if (argc > 1) {         N = std::atoi(argv[1]);         std::cout &lt;&lt; \"You set \" &lt;&lt; N &lt;&lt; \" external iterations\\n\";     }     std::cout &lt;&lt; \"Test division quick\\n\";     test_division_quick();     std::cout &lt;&lt; \"Ok\\n\";     std::cout &lt;&lt; \"Test division randomly...\\n\";     test_division_randomly(N);     std::cout &lt;&lt; \"Ok\\n\";     return 0; } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h3>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0410 \u0418\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u0435\u043b\u0435\u043d\u0438\u044f &#171;\u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e&#187; \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 &#171;\u0443\u0437\u043a\u043e\u0435&#187;<\/h3>\n<p>\u041f\u0443\u0441\u0442\u044c \u0438\u043c\u0435\u0435\u043c \u0434\u0440\u043e\u0431\u044c<\/p>\n<p><img class=\"formula\" source=\"Z = {{X} \\over {C}} = {{ A \\cdot {2}^{w} + B } \\over {\u0421}}, ~~C>0.&#187; alt=&#187;Z = {{X} \\over {C}} = {{ A \\cdot {2}^{w} + B } \\over {\u0421}}, ~~C>0.&#187; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8be\/f93\/f40\/8bef93f4083828517de8aa1c0ef837b1.svg&#187; width=&#187;257&#8243; height=&#187;46&#8243;\/><\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0447\u0438\u0441\u043b\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A\" alt=\"A\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bee\/adc\/90e\/beeadc90e384d15f79a4a462f8e425ce.svg\" width=\"14\" height=\"17\"\/>\u0432 \u0432\u0438\u0434\u0435 \u0447\u0430\u0441\u0442\u043d\u043e\u0433\u043e \u0438 \u043e\u0441\u0442\u0430\u0442\u043a\u0430 \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"C\" alt=\"C\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f85\/356\/f26\/f85356f265a509ea9fb7e6235dede68c.svg\" width=\"15\" height=\"17\"\/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"A = Q \\cdot C + R,\" alt=\"A = Q \\cdot C + R,\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b3b\/d24\/480\/b3bd2448020676bce651097dc758d6ca.svg\" width=\"128\" height=\"20\"\/><\/p>\n<p> \u0433\u0434\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Q\" alt=\"Q\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/824\/a64\/dbc\/824a64dbcfdf8d7912c8c61f923c3553.svg\" width=\"15\" height=\"20\"\/>&#8212; \u0447\u0430\u0441\u0442\u043d\u043e\u0435 \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A\" alt=\"A\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4da\/cfa\/2bf\/4dacfa2bfc327e000c8ac782d6488cb5.svg\" width=\"14\" height=\"17\"\/>\u043d\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"C\" alt=\"C\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b01\/7e4\/8cc\/b017e48ccc694bbda03a3257e52c221c.svg\" width=\"15\" height=\"17\"\/>, \u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"R\" alt=\"R\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fe2\/8ea\/6e1\/fe28ea6e1c7564bea100d632da901056.svg\" width=\"15\" height=\"17\"\/>&#8212; \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u0422\u043e\u0433\u0434\u0430 \u0438\u0441\u043a\u043e\u043c\u0443\u044e \u0434\u0440\u043e\u0431\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Z = Q \\cdot 2^w + {{R \\cdot 2^w + B} \\over {C}}.\" alt=\"Z = Q \\cdot 2^w + {{R \\cdot 2^w + B} \\over {C}}.\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/90b\/5b2\/131\/90b5b2131f2694900a9078462005342e.svg\" width=\"214\" height=\"43\"\/><\/p>\n<p>\u0417\u0430\u043c\u0435\u043d\u0438\u043c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"2^w\" alt=\"2^w\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a51\/b38\/7b0\/a51b387b027ad54f8348b1eb0e0ddacd.svg\" width=\"21\" height=\"18\"\/>\u043d\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"2^w-1+1\" alt=\"2^w-1+1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ac0\/a5e\/8c6\/ac0a5e8c6cb297501e5b8d7d3bf9ae54.svg\" width=\"88\" height=\"19\"\/> \u0432 \u0434\u0440\u043e\u0431\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"(R, B)\/C\" alt=\"(R, B)\/C\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9cb\/72c\/e32\/9cb72ce32416686c6cc575a32984b6f6.svg\" width=\"77\" height=\"22\"\/> \u0438 \u043f\u0440\u0435\u043d\u0435\u0431\u0440\u0435\u0436\u0435\u043c \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u043c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"R\/C\" alt=\"R\/C\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c1b\/a8d\/b34\/c1ba8db342e89ca08e32532b52308ca8.svg\" width=\"40\" height=\"22\"\/>, \u0442\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0432\u043e\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u0435 \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Z = Q \\cdot 2^w + R \\cdot { \\left \\lfloor {{2^w-1} \\over {C}} \\right \\rfloor} + \\left \\lfloor {{B} \\over {C}} \\right \\rfloor.\" alt=\"Z = Q \\cdot 2^w + R \\cdot { \\left \\lfloor {{2^w-1} \\over {C}} \\right \\rfloor} + \\left \\lfloor {{B} \\over {C}} \\right \\rfloor.\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cc8\/c9b\/b51\/cc8c9bb513a3d2f5d8cbd8332c2fa18a.svg\" width=\"308\" height=\"50\"\/><\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"E = X - Z \\cdot C,\" alt=\"E = X - Z \\cdot C,\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f23\/394\/d3a\/f23394d3ad1e484d4e9dfbc00b1252e6.svg\" width=\"128\" height=\"20\"\/><\/p>\n<p>\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0434\u0430\u0435\u043c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u0430 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"C\" alt=\"C\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/87a\/f0e\/ce3\/87af0ece339ad2da10018ee627339142.svg\" width=\"15\" height=\"17\"\/>.<\/p>\n<h3>\u0412\u044b\u0432\u043e\u0434\u044b<\/h3>\n<p>\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u0438\u0437 \u0441\u0442\u0430\u0440\u0448\u0435\u0439 \u0438 \u043c\u043b\u0430\u0434\u0448\u0435\u0439 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u043e\u043a, \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c \u043a\u0440\u0430\u0442\u043d\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"{2}^{N}\" alt=\"{2}^{N}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/094\/a29\/841\/094a29841a39e457ce919edfe6ea58e9.svg\" width=\"24\" height=\"21\"\/>. \u0414\u0430\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c &#171;\u0443\u043c\u043d\u043e\u0433\u043e&#187; \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u043e\u043b\u0431\u0438\u043a: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u0435, \u0440\u0430\u0432\u043d\u043e\u0435 \u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0441\u0442\u0430\u0440\u0448\u0438\u0445 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u043e\u043a \u0447\u0438\u0441\u043b\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c &#8212; \u0432\u0442\u043e\u0440\u043e\u0435, \u0440\u0430\u0432\u043d\u043e\u0435 \u0441\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0435\u0440\u0432\u043e\u043c\u0443. \u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043e\u0440 \u0440\u0430\u0432\u0435\u043d \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u0434\u0432\u0430 \u0443\u0437\u043a\u0438\u0445.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043b\u0435\u0433\u043a\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 128-\u0431\u0438\u0442\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 64-\u0431\u0438\u0442\u043d\u043e\u0439 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 256-\u0431\u0438\u0442, \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 U128 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#171;\u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0447\u0430\u0442\u043e\u0433\u043e&#187; \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f: U32 \u043d\u0430 u16. \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430. \u0412 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435, \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c\u044e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"2^N\" alt=\"2^N\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/828\/29b\/b1f\/82829bb1ffc354658df5bbf428a58936.svg\" width=\"24\" height=\"21\"\/>, \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e (\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u043f\u043e\u043b\u0430\u043c) \u0441\u043f\u0430\u0434\u0430\u044e\u0449\u0443\u044e \u0432 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0443 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/811323\/\"> https:\/\/habr.com\/ru\/articles\/811323\/<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 32-\u0431\u0438\u0442\u043d\u044b\u0445 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0447\u0438\u0441\u043b\u0430 \u0441 \u0434\u0432\u0443\u043a\u0440\u0430\u0442\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435\u0439 (16 \u0431\u0438\u0442) \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c\u044e. \u0414\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421++.<\/p>\n<h3>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430<\/h3>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 -\u0431\u0438\u0442\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e  \u0432 \u0432\u0438\u0434\u0435:<\/p>\n<p>\u0433\u0434\u0435 ,  &#8212; \u0441\u0442\u0430\u0440\u0448\u0430\u044f \u0438 \u043c\u043b\u0430\u0434\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u0438 -\u0431\u0438\u0442\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0447\u0438\u0441\u043b\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b,  \u0438 , \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0434\u0440\u043e\u0431\u0438:<\/p>\n<p>\u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 0&#8243; alt=&#187;C>0&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4fb\/660\/495\/4fb6604952678952f3d37508f77ceaf3.svg&#187; width=&#187;50&#8243; height=&#187;17&#8243;\/>, \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f &#8212; \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 -\u0431\u0438\u0442\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c\u0441\u044f \u044d\u0442\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c. \u0414\u043b\u044f \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435 \u043d\u0430 \u0421++ \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u0435\u043b\u0435\u043d\u0438\u044f &#171;\u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e&#187; \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 &#171;\u0443\u0437\u043a\u043e\u0435&#187;, \u0441\u043c. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0410.<\/p>\n<p>\u0421\u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u043b\u0435\u0435, \u0447\u0442\u043e , \u0438\u043d\u0430\u0447\u0435 &#8212; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0432\u0435\u043d \u043d\u0443\u043b\u044e. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0447\u0438\u0441\u043b\u043e  \u0432 \u0432\u0438\u0434\u0435: <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c  &#8212; \u0446\u0435\u043b\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0430  &#8212; \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f  \u043d\u0430 .<\/p>\n<p>\u041f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u0434\u0440\u043e\u0431\u044c: <\/p>\n<p>\u041f\u0440\u0435\u043d\u0435\u0431\u0440\u0435\u0436\u0435\u043c \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u043c  , \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u0443:<\/p>\n<p>\u0412\u044b\u0434\u0435\u043b\u0438\u043c \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435  \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b: <\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445  \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e &#171;\u0442\u044f\u0436\u0435\u043b\u044b\u0435&#187; \u0441\u043b\u0443\u0447\u0430\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443  \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 &#171;\u0434\u0435\u043b\u044c\u0442\u0430&#187; \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043b \u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443:<\/p>\n<p>\u0412 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0435 \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0435 \u0434\u0440\u043e\u0431\u0438 \u0441\u0442\u043e\u044f\u0442 &#171;\u0448\u0438\u0440\u043e\u043a\u0438\u0435&#187; \u0447\u0438\u0441\u043b\u0430 (\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c\u044e ). \u0422\u0430\u043a \u043a\u0430\u043a \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u0443\u0437\u043a\u043e\u0435, \u0442\u043e \u0434\u043e\u0431\u044c\u0435\u043c\u0441\u044f &#171;\u0443\u0437\u043e\u0441\u0442\u0438&#187; \u0447\u0438\u0441\u043b\u0430 \u0432 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0435, \u0432\u044b\u043d\u0435\u0441\u044f \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c  \u0437\u0430 \u0441\u043a\u043e\u0431\u043a\u0438 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e:<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, &#171;\u0448\u0438\u0440\u043e\u043a\u0438\u0439&#187; \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c <strong>\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e<\/strong> \u0434\u0435\u043b\u0438\u043c \u043d\u0430 &#171;\u0443\u0437\u043a\u0438\u0435&#187; \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0438. \u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0432\u043d\u044f\u0442\u044c\u0441\u044f \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044e , \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435: \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0445 \u0426\u041f\u0423 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0431\u043d\u0443\u043b\u0438\u0442\u0441\u044f \u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0432\u044b\u0447\u0435\u0441\u0442\u044c \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0438 \u043d\u0435 \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u043e \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 0&#8243; alt=&#187;C>0&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/99b\/2d7\/ac9\/99b2d7ac9de96008d7b7389903514908.svg&#187; width=&#187;50&#8243; height=&#187;17&#8243;\/>. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e , \u0447\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0434\u0430\u0441\u0442 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<p>\u0427\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0434\u043d\u043e\u0439 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438. \u0424\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f 0&#8243; alt=&#187;C>0&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b52\/48d\/bdb\/b5248dbdbdd7efd5880883f7be179a15.svg&#187; width=&#187;50&#8243; height=&#187;17&#8243;\/>, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 \u0432 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0435 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0447\u0430\u0441\u0442\u043d\u043e\u043c\u0443. \u041e\u0434\u043d\u0430\u043a\u043e, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f &#171;fine tuning&#187; &#8212; \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0446\u0438\u043a\u043b\u0435 \u0438 \u0437\u0430 \u043e\u0434\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f &#171;\u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e&#187; \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 &#171;\u0443\u0437\u043a\u043e\u0435&#187;, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u043d\u043e\u0435 \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443.<\/p>\n<p>\u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a \u0442\u0438\u043f\u0443 \u0447\u0438\u0441\u0435\u043b: \u0446\u0435\u043b\u043e\u0435, \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439, \u0432 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438 \u0442. \u043f. \u041e\u0441\u043d\u043e\u0432\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0434\u0432\u0443\u0445 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u043e\u043a: \u0441\u0442\u0430\u0440\u0448\u0435\u0439 \u0438 \u043c\u043b\u0430\u0434\u0448\u0435\u0439. \u0417\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0431\u0438\u0442\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439, \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0447\u0438\u0441\u043b\u0430 \u0431\u0435\u0437 \u0437\u043d\u0430\u043a\u0430.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0421++<\/h3>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;limits.h> #include &lt;algorithm> #include &lt;cassert> #include &lt;cmath> #include &lt;cstdint> #include &lt;iostream> #include &lt;list> #include &lt;random> #include &lt;string>  using u64 = uint64_t; using i64 = int64_t; using u32 = uint32_t; using u16 = uint16_t;  using ULOW = u16; \/\/ \u0422\u0438\u043f \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u043e\u043a: \u0441\u0442\u0430\u0440\u0448\u0435\u0439 \u0438 \u043c\u043b\u0430\u0434\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0435\u0439 \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.  static_assert(CHAR_BIT == 8);  struct Quadrupole { \/\/ \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0434\u0440\u043e\u0431\u0438 (A*M + B) \/ (C*M + D).                     \/\/ M - \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, 2^W, W - \u0431\u0438\u0442\u043e\u0432\u0430\u044f \u0448\u0438\u0440\u0438\u043d\u0430 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u043e\u043a.     ULOW A;     ULOW B;     ULOW C;     ULOW D; };  struct Signess { \/\/ \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u043a\u043e\u0432 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b.     int s1;     int s2; };  static auto const seed = std::random_device{}();  \/***  * \u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.  *\/ auto roll_ulow = [urbg = std::mt19937{seed},                 distr = std::uniform_int_distribution&lt;ULOW>{}]() mutable -> ULOW {     return distr(urbg); };  static constexpr char DIGITS[10]{'0', '1', '2', '3', '4',                                  '5', '6', '7', '8', '9'};  \/\/ High\/Low \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 32-\u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0438 \u0444\u043b\u0430\u0433\u043e\u043c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \/\/ \u0414\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 U32 \u0447\u0438\u0441\u0435\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \/\/ \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u043a\u0440\u043e\u043c\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 U32 \u0447\u0438\u0441\u0435\u043b. \/\/ \u0415\u0441\u043b\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430,  \/\/ \u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0435\u0431\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c: \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c 128-\u0431\u0438\u0442\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430,  \/\/ 256-\u0431\u0438\u0442\u043d\u044b\u0435 \u0438 \u0442.\u0434. struct U32 {     \/\/ \u0411\u0438\u0442\u043e\u0432\u0430\u044f \u043f\u043e\u043b\u0443\u0448\u0438\u0440\u0438\u043d\u0430 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u043e\u043a.     static constexpr int mHalfWidth = (sizeof(ULOW) * CHAR_BIT) \/ 2;     \/\/ \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u043e\u043a, M-1.     static constexpr ULOW mMaxULOW = ULOW(-1);     ULOW mHigh = 0;     ULOW mLow = 0;     int mSign = 0;     int mOverflow = 0;  bool is_negative() const {     return mSign != 0; }  bool is_overflow() const {     return mOverflow != 0; }  bool is_zero() const {     return (mLow | mHigh | mOverflow) == 0; }  constexpr static U32 get_zero() {     return U32 {.mHigh = 0, .mLow = 0, .mSign = 0, .mOverflow = 0}; }  constexpr static U32 get_unit() {     return U32 {.mHigh = 0, .mLow = 1, .mSign = 0, .mOverflow = 0}; }  constexpr static U32 get_unit_neg() {     return U32 {.mHigh = 0, .mLow = 1, .mSign = 1, .mOverflow = 0}; }  U32 operator+(U32 rhs) const {     U32 result{};     U32 X = *this;     if (X.is_negative() &amp;&amp; !rhs.is_negative()) {         X.mSign = 0;         result = rhs - X;         return result;     }     if (!X.is_negative() &amp;&amp; rhs.is_negative()) {         rhs.mSign = 0;         result = X - rhs;         return result;     }     result.mLow = X.mLow + rhs.mLow;     const ULOW c1 = result.mLow &lt; std::min(X.mLow, rhs.mLow);     result.mHigh = X.mHigh + rhs.mHigh;     const int c2 = result.mHigh &lt; std::min(X.mHigh, rhs.mHigh);     ULOW tmp = result.mHigh;     result.mHigh = tmp + c1;     const int c3 = result.mHigh &lt; std::min(tmp, c1);     result.mOverflow = c2 || c3;     if (X.mSign &amp;&amp; rhs.mSign) {         result.mSign = 1;     }     return result; }  U32&amp; operator+=(U32 other) {     *this = *this + other;     return *this; }  U32 operator-(U32 rhs) const {     U32 result{};     U32 X = *this;     if (X.is_negative() &amp;&amp; !rhs.is_negative()) {         rhs.mSign = 1;         result = rhs + X;         return result;     }     if (!X.is_negative() &amp;&amp; rhs.is_negative()) {         rhs.mSign = 0;         result = X + rhs;         return result;     }     if (X.is_negative() &amp;&amp; rhs.is_negative()) {         rhs.mSign = 0;         X.mSign = 0;         result = rhs - X;         return result;     }     if (X.is_zero()) {         result = rhs;         result.mSign = rhs.mSign ^ 1;         return result;     }     result.mLow = X.mLow - rhs.mLow;     result.mHigh = X.mHigh - rhs.mHigh;     const bool borrow = X.mLow &lt; rhs.mLow;     const bool hasUnit = X.mHigh > rhs.mHigh;     if (borrow &amp;&amp; hasUnit) {         result.mHigh -= ULOW(1);     }     if (borrow &amp;&amp; !hasUnit) {         result = rhs - X;         result.mSign ^= 1;         return result;     }     if (!borrow &amp;&amp; X.mHigh &lt; rhs.mHigh) {         result.mHigh = -result.mHigh - ULOW(result.mLow != 0);         result.mLow = -result.mLow;         result.mSign = 1;     }     return result; }  U32&amp; operator-=(U32 other) {     *this = *this - other;     return *this; }  U32 mult16(ULOW x, ULOW y) const {     constexpr ULOW MASK = (ULOW(1) &lt;&lt; mHalfWidth) - 1;     const ULOW x_low = x &amp; MASK;     const ULOW y_low = y &amp; MASK;     const ULOW x_high = x >> mHalfWidth;     const ULOW y_high = y >> mHalfWidth;     const ULOW t1 = x_low * y_low;     const ULOW t = t1 >> mHalfWidth;     const ULOW t21 = x_low * y_high;     const ULOW q = t21 >> mHalfWidth;     const ULOW p = t21 &amp; MASK;     const ULOW t22 = x_high * y_low;     const ULOW s = t22 >> mHalfWidth;     const ULOW r = t22 &amp; MASK;     const ULOW t3 = x_high * y_high;     U32 result{};     result.mLow = t1;     const ULOW div = (q + s) + ((p + r + t) >> mHalfWidth);     const ULOW mod = (t21 &lt;&lt; mHalfWidth) + (t22 &lt;&lt; mHalfWidth);     result.mLow += mod;     result.mHigh += div;     result.mHigh += t3;     result.mOverflow = result.mHigh &lt; t3 ? 1 : 0;     return result; }  U32 operator*(ULOW rhs) const {     U32 result = mult16(mLow, rhs);     U32 tmp = mult16(mHigh, rhs);     tmp.mHigh = tmp.mLow;     tmp.mLow = 0;     result += tmp;     result.mSign = this->mSign;     return result; }  U32 operator\/(ULOW y) const {     U32 X = *this;     const int sign = X.mSign;     X.mSign = 0;     ULOW Q = X.mHigh \/ y;     ULOW R = X.mHigh % y;     ULOW N = R * (mMaxULOW \/ y) + (X.mLow \/ y);     U32 result{.mHigh = Q, .mLow = N};     U32 E = X - result * y;     while (E.mHigh != 0 || E.mLow >= y) {         Q = E.mHigh \/ y;         R = E.mHigh % y;         N = R * (mMaxULOW \/ y) + (E.mLow \/ y);         const U32 tmp {.mHigh = Q, .mLow = N};         result += tmp;         E -= tmp * y;     }     result.mSign = sign;     return result; }  U32&amp; operator\/=(ULOW y) {     *this = *this \/ y;     return *this; }  U32 operator\/(const U32 other) const {     U32 X = *this;     U32 Y = other;     constexpr U32 ZERO = get_zero();     constexpr U32 UNIT = get_unit();     constexpr U32 UNIT_NEG = get_unit_neg();     if (X.mHigh &lt; Y.mHigh) {         return ZERO;     }     if (Y.mHigh == 0) {         U32 result = X \/ Y.mLow;         result.mSign ^= (Y.is_negative());         return result;     }     const int make_sign_inverse = (X.mSign != Y.mSign);     X.mSign = 0;     Y.mSign = 0;     const ULOW Q = X.mHigh \/ Y.mHigh;     const ULOW R = X.mHigh % Y.mHigh;     const ULOW Delta = mMaxULOW - Y.mLow;     const U32 DeltaQ = mult16(Delta, Q);     U32 W1 = U32{.mHigh = R, .mLow = 0} - U32{.mHigh = Q, .mLow = 0};     W1 = W1 + DeltaQ;     ULOW C1 = (Y.mHigh &lt;<\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-375060","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/375060","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=375060"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/375060\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=375060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=375060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=375060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}