{"id":271783,"date":"2016-01-08T19:11:02","date_gmt":"2016-01-08T16:11:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=271783"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=271783","title":{"rendered":"\u0420\u0430\u0441\u0447\u0435\u0442 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0421\u0438 (\u0421++)"},"content":{"rendered":"<p>       \u041f\u0440\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0442\u043e\u0440\u0438\u043a\u0438 \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0440\u0430\u0441\u0447\u0435\u0442\u0435 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432. \u0411\u0438\u043d\u043e\u043c \u041d\u044c\u044e\u0442\u043e\u043d\u0430, \u0442.\u0435. \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fad\/203\/7ac\/fad2037acc6dff013bb9e1b5307eb82c.png\" alt=\"image\"\/> \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b. \u0414\u043b\u044f \u0438\u0445 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u0443, \u0432\u044b\u0440\u0430\u0436\u0430\u044e\u0449\u0443\u044e \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b\u044b: <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/01d\/df4\/164\/01ddf4164554f2f65f67842dd8ea7dbf.png\" alt=\"image\"\/> \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0443:<img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/3f1\/8bd\/ee1\/3f18bdee1558db7cb7b6b6c3458cda5f.png\" alt=\"image\"\/> \u0418\u0437 \u0431\u0438\u043d\u043e\u043c\u0430 \u041d\u044c\u044e\u0442\u043e\u043d\u0430 \u0438 \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u044f\u0441\u043d\u043e, \u0447\u0442\u043e \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u2014 \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430. <br \/>  <a name=\"habracut\"><\/a>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0440\u0430\u0441\u0447\u0435\u0442\u0430, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u041f\u0430\u0441\u043a\u0430\u043b\u044f.  <\/p>\n<pre><code class=\"cpp\">          1        1     1     1     2     1   1    3     3     1 1   4     6     4     1 <\/code><\/pre>\n<p>  \u0438\u043b\u0438 \u043e\u043d \u0436\u0435, \u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0432\u0438\u0434\u0435. \u0412 \u043b\u0435\u0432\u043e\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 n, \u0434\u0430\u043b\u044c\u0448\u0435 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fb5\/4b1\/c46\/fb54b1c461f0baa8fac06559581c2350.png\" alt=\"image\"\/> \u0434\u043b\u044f k=0..n  <\/p>\n<pre><code class=\"cpp\"> n          \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b  0      1  1      1      1  2      1      2      1  3      1      3      3      1  4      1      4      6      4      1  5      1      5     10     10      5      1  6      1      6     15     20     15      6      1  7      1      7     21     35     35     21      7      1  8      1      8     28     56     70     56     28      8      1  9      1      9     36     84    126    126     84     36      9      1 10      1     10     45    120    210    252    210    120     45     10      1 11      1     11     55    165    330    462    462    330    165     55     11      1 12      1     12     66    220    495    792    924    792    495    220     66     12      1 13      1     13     78    286    715   1287   1716   1716   1287    715    286     78     13      1 14      1     14     91    364   1001   2002   3003   3432   3003   2002   1001    364     91     14      1 15      1     15    105    455   1365   3003   5005   6435   6435   5005   3003   1365    455    105     15      1 16      1     16    120    560   1820   4368   8008  11440  12870  11440   8008   4368   1820    560    120     16      1 <\/code><\/pre>\n<p>  \u0412 \u043f\u043e\u043b\u043d\u043e\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/a7e\/83b\/515\/a7e83b5159606d91c7818769f95ffbc5.png\" alt=\"image\"\/> \u0440\u0430\u0432\u043d\u044b 1 \u0438 \u043b\u044e\u0431\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0440\u0430\u0432\u043d\u043e \u0441\u0443\u043c\u043c\u0435 \u0447\u0438\u0441\u043b\u0430, \u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u043d\u0430\u0434 \u043d\u0438\u043c \u0438 \u0447\u0438\u0441\u043b\u0430 \u00ab\u043d\u0430\u0434 \u043d\u0438\u043c+\u0448\u0430\u0433 \u0432\u043b\u0435\u0432\u043e\u00bb. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 7\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0447\u0438\u0441\u043b\u043e 21, \u0430 \u0432 6\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0447\u0438\u0441\u043b\u0430 15 \u0438 6: 21=15+6. \u0412\u0438\u0434\u043d\u043e \u0442\u0430\u043a\u0436\u0435, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u044b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438, \u0442.\u0435. <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/ab7\/4be\/30e\/ab74be30e9a36caa1e9e54d40462b59c.png\" alt=\"image\"\/>. \u042d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e\u0441\u0442\u0438 \u0431\u0438\u043d\u043e\u043c\u0430 \u041d\u044c\u044e\u0442\u043e\u043d\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e a \u0438 b \u0438 \u043e\u043d\u043e \u0432\u0438\u0434\u043d\u043e \u0432 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435.<br \/>  \u041d\u0438\u0436\u0435 \u0434\u043b\u044f \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fb5\/4b1\/c46\/fb54b1c461f0baa8fac06559581c2350.png\" alt=\"image\"\/> \u044f \u0431\u0443\u0434\u0443 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 C(n,k) (\u0435\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u043d\u0430\u0431\u0438\u0440\u0430\u0442\u044c, \u0434\u0430 \u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0443-\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0435 \u0432\u0435\u0437\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c.<\/p>\n<h4>\u0420\u0430\u0441\u0447\u0435\u0442 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0443<\/h4>\n<p>  \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043d\u0435\u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435, \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0441\u0447\u0435\u0442\u0430\u0445 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0442\u0438\u043f.  <\/p>\n<pre><code class=\"cpp\">\/\/ \u0440\u0430\u0441\u0447\u0435\u0442 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b\u0430 n unsigned fakt(int n) {    for (unsigned r=1;n&gt;0;--n)            r*=n;    return r; } \/\/ \u0440\u0430\u0441\u0447\u0435\u0442 C(n,k) unsinged bci(int n,int k) {    return fakt(n)\/(fakt(k)*fakt(n-k)); } <\/code><\/pre>\n<p>  \u0412\u044b\u0437\u043e\u0432\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e bci(10,4) \u2014 \u043e\u043d\u0430 \u0432\u0435\u0440\u043d\u0435\u0442 210 \u0438 \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 C(10,4). \u0417\u043d\u0430\u0447\u0438\u0442, \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0440\u0435\u0448\u0435\u043d\u0430? \u0414\u0430, \u0440\u0435\u0448\u0435\u043d\u0430. \u041d\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c. \u041c\u044b \u043d\u0435 \u043e\u0442\u0432\u0435\u0442\u0438\u043b\u0438 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441: <b>\u043f\u0440\u0438 \u043a\u0430\u043a\u0438\u0445 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 n,k \u0444\u0443\u043d\u043a\u0446\u0438\u044f bci \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e?<\/b> \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442, \u0443\u0441\u043b\u043e\u0432\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043d\u0430\u043c\u0438 \u0442\u0438\u043f unsigned int 4-\u0445 \u0431\u0430\u0439\u0442\u043d\u044b\u0439 \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0432\u043d\u043e 2<sup>32<\/sup>-1=4&#8217;294&#8217;967&#8217;295. \u041f\u0440\u0438 \u043a\u0430\u043a\u0438\u0445 n,k C(n,k) \u043f\u0440\u0435\u0432\u044b\u0441\u0438\u0442 \u0435\u0433\u043e? \u041e\u0431\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u043a \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0443 \u041f\u0430\u0441\u043a\u0430\u043b\u044f. \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u0442.\u0435. \u043f\u0440\u0438 k=n\/2. \u0415\u0441\u043b\u0438 n \u0447\u0435\u0442\u043d\u043e, \u0442\u043e \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0430 \u0435\u0441\u043b\u0438 n \u043d\u0435\u0447\u0435\u0442\u043d\u043e, \u0442\u043e \u0438\u0445 \u0434\u0432\u0430. \u0422\u043e\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 C(34,17) \u0440\u0430\u0432\u043d\u043e 2333606220, \u0430 \u0442\u043e\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 C(35,17) \u0440\u0430\u0432\u043d\u043e 4537567650, \u0442.\u0435. \u0443\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e unsigned int.<br \/>  \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443  <\/p>\n<pre><code class=\"cpp\">void test() {     for (n=10;n&lt;=36;++n)      printf(&quot;%u %u&quot;,n,bci(n,n\/2);  \/\/ \u0434\u043b\u044f C++ \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c cout&lt;&lt;n&lt;&lt;&quot; &quot;&lt;&lt;bci(n,n\/2)&lt;&lt;endl; } <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0435 \u0438 \u0443\u0432\u0438\u0434\u0438\u043c<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">10 252 11 462 12 924 13 532 14 50 15 9 16 1 17 2 18 1 19 0 20 0 21 1 22 0 23 4 24 1 25 0 26 1 27 0 28 1 29 0 30 0 31 0 32 2 33 2 34 0 35 0 <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 2 \u0431\u0430\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 (\u0441\u043c \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u0432\u044b\u0448\u0435) \u2014 \u044d\u0442\u043e C(12,6) \u0425\u043e\u0442\u044f unsigned int \u0432\u043c\u0435\u0449\u0430\u0435\u0442 4\u043c\u043b\u0440\u0434, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u043d\u044c\u0448\u0435 1000. \u0412\u043e\u0442 \u0442\u0435 \u0440\u0430\u0437, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a? \u0412\u0441\u0435 \u0434\u0435\u043b\u043e \u0432 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0435 bci, \u0442\u043e\u0447\u043d\u0435\u0435 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0435, \u0430 \u043f\u043e\u0442\u043e\u043c \u0434\u0435\u043b\u0438\u0442 \u0435\u0433\u043e \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0435. \u0414\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f C(13,6) \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f 13!, \u0430 \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e &gt; 6\u043c\u043b\u0440\u0434 \u0438 \u043e\u043d\u043e \u043d\u0435 \u0432\u043b\u0435\u0437\u0430\u0435\u0442 \u0432 unsigned int. <br \/>  \u041a\u0430\u043a \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u0447\u0435\u0442 <img decoding=\"async\" src=\"http:\/\/mathurl.com\/j74tvlm.png\" alt=\"image\"\/>? \u041e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e: \u0440\u0430\u0441\u043a\u0440\u043e\u0435\u043c 13! \u0438 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043c \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u043d\u0430 7!.. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f <img decoding=\"async\" src=\"http:\/\/mathurl.com\/jhpmg2w.png\" alt=\"image\"\/>. \u0417\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0441\u0447\u0435\u0442 \u043f\u043e \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435  <\/p>\n<pre><code class=\"cpp\">unsigned bci(int n,int k)  { \tif (k&gt;n\/2) k=n-k; \/\/ \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0437 k, n-k.. \u0412 \u0441\u0438\u043b\u0443 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e\u0441\u0442\u044c C(n,k)=C(n,n-k) \tif (k==1)  return n; \tif (k==0)  return 1; \tunsigned r=1; \tfor (int i=1; i&lt;=k;++i) { \t\tr*=n-k+i; \t\tr\/=i; \t} \treturn r; } <\/code><\/pre>\n<p>  :  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0438 \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">10 252 11 462 12 924 13 1716 14 3432 15 6435 16 12870 17 24310 18 48620 19 92378 20 184756 21 352716 22 705432 23 1352078 24 2704156 25 5200300 26 10400600 27 20058300 28 40116600 29 77558760 30 155117520 31 14209041 32 28418082 33 39374192 34 78748384 35 79433695 <\/code><\/pre>\n<\/p><\/div>\n<\/div>\n<p>  \u042f\u0432\u043d\u043e \u043b\u0443\u0447\u0448\u0435, \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043f\u0440\u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0435 C(31,15). \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u0430 \u2014 \u0432\u0441\u0435 \u0442\u043e \u0436\u0435 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u043d\u0430 31 (\u043e\u043f-\u043f\u0430 \u2014 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u043f\u043e\u0442\u043e\u043c \u0434\u0435\u043b\u0438\u043c \u043d\u0430 15). \u0410 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0443? \u0422\u0430\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u044b\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e.<br \/>  \u0427\u0442\u043e \u0436, \u043f\u0440\u043e\u0431\u0443\u0435\u043c:  <\/p>\n<pre><code class=\"cpp\">unsigned bcr(int n,int k)  { \tif (k&gt;n\/2) k=n-k; \tif (k==1)  return n; \tif (k==0)  return 1; \treturn bcr(n-1,k)+bcr(n-1,k-1); } void test() {     for (n=10;n&lt;=36;++n)      printf(&quot;%u %u&quot;,n,bcr(n,n\/2);  \/\/ \u0434\u043b\u044f C++ \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c cout&lt;&lt;n&lt;&lt;&quot; &quot;&lt;&lt;bcr(n,n\/2)&lt;&lt;endl; } <\/code><\/pre>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u0435\u0441\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">10 252 11 462 12 924 13 1716 14 3432 15 6435 16 12870 17 24310 18 48620 19 92378 20 184756 21 352716 22 705432 23 1352078 24 2704156 25 5200300 26 10400600 27 20058300 28 40116600 29 77558760 30 155117520 31 300540195 32 601080390 33 1166803110 34 2333606220 35 242600354 <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u0441\u0435, \u0447\u0442\u043e \u0432\u043b\u0435\u0437\u043b\u043e \u0432 unsigned int, \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0441 n=34 \u0441\u0447\u0438\u0442\u0430\u043b\u0430\u0441\u044c \u043e\u043a\u043e\u043b\u043e \u043c\u0438\u043d\u0443\u0442\u044b. \u041f\u0440\u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0435 C(n,n\/2) \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 n. \u0427\u0442\u043e \u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u2014 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u043d\u0435\u0442\u043e\u0447\u043d\u043e, \u043b\u0438\u0431\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e. \u0412\u044b\u0445\u043e\u0434 \u2014 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 64 \u0431\u0438\u0442\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.  <\/p>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 64 \u0431\u0438\u0442\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 C(n,k)<\/h4>\n<p>  \u0417\u0430\u043c\u0435\u043d\u0438\u043c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 bci unsigned int \u043d\u0430 unsigned long long \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 n=34..68. n=34 \u2014 \u044d\u0442\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f bci, \u0430 C(68,34) ~2.8*10<sup>19<\/sup> \u0443\u0436\u0435 \u043d\u0435 \u0432\u043b\u0435\u0437\u0430\u0435\u0442 \u0432 unsigned long long ~1.84*10<sup>19<\/sup>   <\/p>\n<pre><code class=\"cpp\">unsigned long long bcl(int n,int k)  { \tif (k&gt;n\/2) k=n-k; \tif (k==1)  return n; \tif (k==0)  return 1; \tunsigned long long r=1; \tfor (int i=1; i&lt;=k;++i) { \t\tr*=n-k+i; \t\tr\/=i; \t} \treturn r; }  void test() {     for (n=34;n&lt;=36;++n)      printf(&quot;%llu %llu&quot;,n,bcl(n,n\/2));  \/\/ \u0434\u043b\u044f C++ \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c cout&lt;&lt;n&lt;&lt;&quot; &quot;&lt;&lt;bcl(n,n\/2)&lt;&lt;endl; }  <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u0435\u0441\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">34 2333606220 35 4537567650 36 9075135300 37 17672631900 38 35345263800 39 68923264410 40 137846528820 41 269128937220 42 538257874440 43 1052049481860 44 2104098963720 45 4116715363800 46 8233430727600 47 16123801841550 48 32247603683100 49 63205303218876 50 126410606437752 51 247959266474052 52 495918532948104 53 973469712824056 54 1946939425648112 55 3824345300380220 56 7648690600760440 57 15033633249770520 58 30067266499541040 59 59132290782430712 60 118264581564861424 61 232714176627630544 62 465428353255261088 63 321255810029051666 64 66050867754679844 65 454676336121653775 66 350360427585442349 67 23341572944240599 68 46683145888481198 <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u0438 n=63 \u043f\u043e \u0442\u043e\u0439 \u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e \u0438 \u0432 bci. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 63 (\u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435), \u0437\u0430\u0442\u0435\u043c \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 31.  <\/p>\n<h4>\u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0438 \u0440\u0430\u0441\u0447\u0435\u0442 \u043f\u0440\u0438 n&gt;67<\/h4>\n<p>  \u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043f\u0440\u0438 n=63, \u0430 \u043f\u0440\u0438 n=68 \u0443\u0436\u0435 \u043d\u0435 \u0432\u043b\u0435\u0437\u0430\u0435\u0442 \u0432 unsigned64. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u00ab\u0434\u043e n&lt;=62 \u0444\u0443\u043d\u043a\u0446\u0438\u044f bcl \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043b\u0438\u0431\u043e in\u0435128 \u043b\u0438\u0431\u043e \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0438\u00bb. \u0410 \u0435\u0441\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u0430, \u043d\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043f\u0440\u0438 n=100&#8230;1000? \u0421\u043d\u043e\u0432\u0430 \u0431\u0435\u0440\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 bci \u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u0432 \u043d\u0435\u0439 \u0442\u0438\u043f\u044b unsigned int \u043d\u0430 double:  <\/p>\n<pre><code class=\"cpp\">double bcd(int n,int k)  { \tif (k&gt;n\/2) k=n-k; \/\/ \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0437 k, n-k.. \u0412 \u0441\u0438\u043b\u0443 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e\u0441\u0442\u0438 C(n,k)=C(n,n-k) \tif (k==1)  return n; \tif (k==0)  return 1; \tdouble r=1; \tfor (int i=1; i&lt;=k;++i) { \t\tr*=n-k+i; \t\tr\/=i; \t} \treturn ceil(r-0.2); \/\/ \u043e\u043a\u0440\u0443\u0433\u043b\u0438\u043c \u0434\u043e \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0446\u0435\u043b\u043e\u0433\u043e, \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0432 \u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c } void testd() {     for (n=50;n&lt;=1000;n+=50)      printf(&quot;%llf %llf&quot;,n,bcd(n,n\/2));  \/\/ \u0434\u043b\u044f C++ \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c cout&lt;&lt;n&lt;&lt;&quot; &quot;&lt;&lt;bcd(n,n\/2)&lt;&lt;endl; } <\/code><\/pre>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u0435\u0441\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">50 1.2641060643775200e+014<br \/>  100 1.0089134454556417e+029<br \/>  150 9.2826069736708704e+043<br \/>  200 9.0548514656103225e+058<br \/>  250 9.1208366928185793e+073<br \/>  300 9.3759702772827310e+088<br \/>  350 9.7744946171567713e+103<br \/>  400 1.0295250013541435e+119<br \/>  450 1.0929255500575370e+134<br \/>  500 1.1674431578827770e+149<br \/>  550 1.2533112137626624e+164<br \/>  600 1.3510794199619429e+179<br \/>  650 1.4615494992533863e+194<br \/>  700 1.5857433585316801e+209<br \/>  750 1.7248900341772600e+224<br \/>  800 1.8804244186835327e+239<br \/>  850 2.0539940413411323e+254<br \/>  900 2.2474718820660189e+269<br \/>  950 2.4629741379276902e+284<br \/>  1000 2.7028824094543663e+299  <\/div>\n<\/div>\n<p>  \u0414\u0430\u0436\u0435 \u0434\u043b\u044f n=1000 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c! \u041f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 double \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043f\u0440\u0438 n=1030.<br \/>  \u0420\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 bcd \u0441 \u0442\u043e\u0447\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 n=57. \u041e\u043d \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u2014 \u0432\u0441\u0435\u0433\u043e 8. \u041f\u0440\u0438 n=67 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 896.  <\/p>\n<h4>\u0414\u043b\u044f \u044d\u043a\u0441\u0442\u0440\u0435\u043c\u0430\u043b\u043e\u0432 \u0438 \u00ab\u043e\u043b\u0438\u043c\u043f\u0438\u0439\u0446\u0435\u0432\u00bb<\/h4>\n<p>  \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0434\u043b\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 bcd \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u043d\u043e \u0432 \u043e\u043b\u0438\u043c\u043f\u0438\u0430\u0434\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u0447\u0430\u0441\u0442\u043e \u0434\u0430\u044e\u0442\u0441\u044f \u0442\u0435\u0441\u0442\u044b \u00ab\u043d\u0430 \u0433\u0440\u0430\u043d\u0438\u00bb. \u0422.\u0435. \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u0433\u0434\u0435 C(n,k) \u0432\u043b\u0435\u0437\u0430\u0435\u0442 \u0432 unsignerd long long \u0435\u043b\u0435-\u0435\u043b\u0435. \u041a\u0430\u043a \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u043a\u0440\u0430\u0439\u043d\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432? \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. \u041d\u043e \u0435\u0441\u043b\u0438 \u043e\u043d \u0434\u043b\u044f n=35 \u0441\u0447\u0438\u0442\u0430\u043b \u043c\u0438\u043d\u0443\u0442\u0443, \u0442\u043e \u0434\u043b\u044f n=67 \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043b\u0435\u0442 100. \u041e\u0434\u043d\u0430\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044e \u043d\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 n \u0438 k, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u00ab\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0445\u00bb. \u0412\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0440\u0430\u0441\u0447\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0434\u043b\u044f n&lt;=67. \u0418\u043d\u043e\u0433\u0434\u0430 \u0438 \u0434\u043b\u044f n&gt;67 \u043f\u0440\u0438 \u043c\u0430\u043b\u044b\u0445 k (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0441\u0447\u0438\u0442\u0430\u0435\u0442 C(82,21)=1.83*10<sup>19<\/sup>).  <\/p>\n<pre><code class=\"cpp\">unsigned long long bcl(int n,int k)  { \tif (k&gt;n\/2) k=n-k; \tif (k==1)  return n; \tif (k==0)  return 1; \tunsigned long long r; \tif (n+k&gt;=90) { \t\t\/\/ \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044e \t\tr=bcl(n-1,k); \t\tr+=+bcl(n-1,k-1); \t} \telse { \t\tr=1; \t\tfor (int i=1; i&lt;=k;++i) { \t\t\tr*=n-k+i; \t\t\tr\/=i; \t\t} \t} \treturn r; } <\/code><\/pre>\n<p>  \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0438\u0437 \u043e\u043b\u0438\u043c\u043f\u0438\u0430\u0434\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u043c\u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u043c\u043d\u043e\u0433\u043e C(n,k) \u0434\u043b\u044f n &gt;70, \u0442.\u0435. \u043e\u043d\u0438 \u0437\u0430\u0432\u0435\u0434\u043e\u043c\u043e \u043d\u0435 \u0432\u043b\u0435\u0437\u0430\u043b\u0438 \u0432 unsigned long long. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u00ab\u0434\u043b\u0438\u043d\u043d\u0443\u044e \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0443\u00bb (\u0441\u0432\u043e\u044e). \u0414\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u00ab\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044e \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e\u00bb: \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u0438\u0441\u044c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0438 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u043e\u0441\u0442\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e.               <\/p>\n<div class=\"clear\"><\/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=\"http:\/\/habrahabr.ru\/post\/274689\/\"> http:\/\/habrahabr.ru\/post\/274689\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041f\u0440\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0442\u043e\u0440\u0438\u043a\u0438 \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0440\u0430\u0441\u0447\u0435\u0442\u0435 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432. \u0411\u0438\u043d\u043e\u043c \u041d\u044c\u044e\u0442\u043e\u043d\u0430, \u0442.\u0435. \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fad\/203\/7ac\/fad2037acc6dff013bb9e1b5307eb82c.png\" alt=\"image\"\/> \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b. \u0414\u043b\u044f \u0438\u0445 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u0443, \u0432\u044b\u0440\u0430\u0436\u0430\u044e\u0449\u0443\u044e \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b\u044b: <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/01d\/df4\/164\/01ddf4164554f2f65f67842dd8ea7dbf.png\" alt=\"image\"\/> \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0443:<img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/3f1\/8bd\/ee1\/3f18bdee1558db7cb7b6b6c3458cda5f.png\" alt=\"image\"\/> \u0418\u0437 \u0431\u0438\u043d\u043e\u043c\u0430 \u041d\u044c\u044e\u0442\u043e\u043d\u0430 \u0438 \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u044f\u0441\u043d\u043e, \u0447\u0442\u043e \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u2014 \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430.   <\/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-271783","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271783","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=271783"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271783\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}