{"id":48,"date":"2011-09-18T04:57:19","date_gmt":"2011-09-17T20:57:19","guid":{"rendered":"http:\/\/www.shuizilong.com\/house\/?p=48"},"modified":"2012-03-03T04:59:28","modified_gmt":"2012-03-02T20:59:28","slug":"world-last-hope","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/house\/archives\/world-last-hope\/","title":{"rendered":"World Last Hope .. ."},"content":{"rendered":"<p>.. .<\/p>\n<h3>Brief description :<\/h3>\n<p>\u7ed9\u5b9a\u4e00\u526f \u70b9\u6743 Ei\u3001\u8fb9\u6743 Ci \u7684\u65e0\u5411\u56fe\uff0c\u73b0\u5728\u8981\u6c42\u5bf9\u6bcf\u6761\u8fb9\uff0c\u5bf9\u5e94\u4e00\u4e2a\u6536\u76ca\u51fd\u6570 Fi\uff0c<br \/>\n\u8981\u6c42\u6ee1\u8db3\u9650\u5236\u6761\u4ef6 Fi <= Ci &#038;&#038; Gi <= Ei.. \u5176\u4e2d Gi \u4e3a\u8986\u76d6\u3001\u67d0\u70b9\u7684\u6240\u6709 Fi \u7684\u6743\u503c\u548c\u3002\n\u6700\u5927\u5316 |F| \u3002\u3002\u3002\n\n<a href=\"https:\/\/www.shuizilong.com\/house\/wp-content\/uploads\/2011\/09\/1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.shuizilong.com\/house\/wp-content\/uploads\/2011\/09\/1.png\" alt=\"\" title=\"1\" width=\"400\" height=\"300\" class=\"aligncenter size-full wp-image-3236\" \/><\/a><\/p>\n<p><!--more--><\/p>\n<h3>Analysis :<\/h3>\n<p>&#8230; \u8fd9\u9898\u9898\u76ee\u6bd4\u8f83\u957f\uff0c\u800c\u4e14\u6709\u5f88\u591a\u5360\u661f\u5b66\u672f\u8bed\u3002\u3002\u5f88\u591a\u62c9\u4e01\u8bed\u7684\u540d\u8bcd\u4e4b\u7c7b\u3002\u3002.. \uff08\u770b\u6765\u51fa\u9898\u4eba\u548c\u6211\u6709\u540c\u6837\u7684\u8da3\u5473\u3002\u3002\u3002\u4e48\uff1f\uff09<br \/>\n\u53e6\u4e00\u65b9\u9762\uff0c\u4e00\u4e9b\u5e38\u89c1\u5355\u8bcd\u53ef\u80fd\u9700\u8981\u989d\u5916\u8fa8\u89c6\u3002\u3002\u4f8b\u5982\uff0c&#8221;<a href=\"http:\/\/www.iciba.com\/aspect\/757bc574388ba104e2d1d29b60bfb82f\/\">aspect<\/a>&#8221; \u5728\u8fd9\u9898\u4e2d\u5f97\u542b\u4e49\u662f\uff1a<br \/>\n&#8230;<br \/>\n\u3010\u5929\u6587\u5b66\u3001\u5360\u661f\u672f\u3011<\/p>\n<ul>\n<li>(\u592a\u9633\u7cfb\u7684\u661f\u4f53\u76f8\u5bf9\u4e8e\u592a\u9633\u7684)\u89c6\u4f4d\u7f6e\uff1b<\/li>\n<li>\u6052\u661f(\u6216\u884c\u661f)\u7684\u76f8\u4e92\u4f4d\u7f6e<\/li>\n<li>\u5360\u661f\u672f\u8ba4\u4e3a\u4f1a\u5f71\u54cd\u4eba\u4e8b\u7978\u798f\u7684\u8fd0\u6c14<\/li>\n<\/ul>\n<p>..<br \/>\n\u6240\u4ee5\u9996\u5148\u8981\u628a\u9898\u610f\u68b3\u7406\u6e05\u695a\u3002\u3002\u3002\u503c\u5f97\u4e00\u9898\u7684\u662f\u8fd9\u9898\u4e2d\u5f97\u56fe\u3002\u3002\u753b\u7684\u975e\u5e38\u6f02\u4eae\uff01\u3002\u3002<\/p>\n<p><a href=\"https:\/\/www.shuizilong.com\/house\/wp-content\/uploads\/2011\/09\/2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.shuizilong.com\/house\/wp-content\/uploads\/2011\/09\/2.png\" alt=\"\" title=\"2\" width=\"662\" height=\"494\" class=\"aligncenter size-full wp-image-3239\" \/><\/a><\/p>\n<p>\u4e4b\u540e\u5c31\u62bd\u8c61\u6210\u4e86 Brief description \u4e2d\u6240\u8ff0\u7684\u56fe\u8bba\u95ee\u9898\uff0cyy \u4e86 30 \u5206\u949f\u5404\u79cd\u7f51\u7edc\u6d41\u5efa\u6a21\u4f46\u662f\u65e0\u679c\u3002\u3002\u4e8e\u662f\u3002\u3002\u3002<br \/>\n\u3002\u3002\u641c\u7d22\u526a\u679d\u5427\u3002\u3002\u3002<\/p>\n<p><a href=\"http:\/\/hi.baidu.com\/edwardmj\/blog\/item\/2b017919557bab028618bf38.html\">\u3002\u3002\uff08\u5f3a\u70c8\u819c\u62dc First Blood \u662f\u6570\u636e\u7ed3\u6784\u7684\u6570\u636e\u7ed3\u6784\u5e1d cwj \u3002\u3002\uff09\u3002\u3002<\/a><\/p>\n<pre class=\"brush: cpp; collapse: true; light: false; title: A; toolbar: true; notranslate\" title=\"A\">\r\n\/** ` Micro Mezzo Macro Flation -- Overheated Economy ., **\/\r\n\r\n#include &lt;algorithm&gt;\r\n#include &lt;iostream&gt;\r\n#include &lt;iomanip&gt;\r\n#include &lt;sstream&gt;\r\n#include &lt;cstring&gt;\r\n#include &lt;cstdio&gt;\r\n#include &lt;string&gt;\r\n#include &lt;vector&gt;\r\n#include &lt;bitset&gt;\r\n#include &lt;queue&gt;\r\n#include &lt;cmath&gt;\r\n#include &lt;ctime&gt;\r\n#include &lt;list&gt;\r\n#include &lt;set&gt;\r\n#include &lt;map&gt;\r\n\r\nusing namespace std;\r\n\r\n#define REP(i, n) for (int i=0;i&lt;int(n);++i)\r\n#define FOR(i, a, b) for (int i=int(a);i&lt;int(b);++i)\r\n#define DWN(i, b, a) for (int i=int(b-1);i&gt;=int(a);--i)\r\n#define REP_1(i, n) for (int i=1;i&lt;=int(n);++i)\r\n#define FOR_1(i, a, b) for (int i=int(a);i&lt;=int(b);++i)\r\n#define DWN_1(i, b, a) for (int i=int(b);i&gt;=int(a);--i)\r\n#define REP_C(i, n) for (int n____=int(n),i=0;i&lt;n____;++i)\r\n#define FOR_C(i, a, b) for (int b____=int(b),i=a;i&lt;b____;++i)\r\n#define DWN_C(i, b, a) for (int a____=int(a),i=b-1;i&gt;=a____;--i)\r\n#define REP_N(i, n) for (i=0;i&lt;int(n);++i)\r\n#define FOR_N(i, a, b) for (i=int(a);i&lt;int(b);++i)\r\n#define DWN_N(i, b, a) for (i=int(b-1);i&gt;=int(a);--i)\r\n#define REP_1_C(i, n) for (int n____=int(n),i=1;i&lt;=n____;++i)\r\n#define FOR_1_C(i, a, b) for (int b____=int(b),i=a;i&lt;=b____;++i)\r\n#define DWN_1_C(i, b, a) for (int a____=int(a),i=b;i&gt;=a____;--i)\r\n#define REP_1_N(i, n) for (i=1;i&lt;=int(n);++i)\r\n#define FOR_1_N(i, a, b) for (i=int(a);i&lt;=int(b);++i)\r\n#define DWN_1_N(i, b, a) for (i=int(b);i&gt;=int(a);--i)\r\n#define REP_C_N(i, n) for (n____=int(n),i=0;i&lt;n____;++i)\r\n#define FOR_C_N(i, a, b) for (b____=int(b),i=a;i&lt;b____;++i)\r\n#define DWN_C_N(i, b, a) for (a____=int(a),i=b-1;i&gt;=a____;--i)\r\n#define REP_1_C_N(i, n) for (n____=int(n),i=1;i&lt;=n____;++i)\r\n#define FOR_1_C_N(i, a, b) for (b____=int(b),i=a;i&lt;=b____;++i)\r\n#define DWN_1_C_N(i, b, a) for (a____=int(a),i=b;i&gt;=a____;--i)\r\n\r\n#define DO(n) while(n--)\r\n#define DO_C(n) int n____ = n; while(n____--)\r\n#define TO(i, a, b) int s_=a&lt;b?1:-1,b_=b+s_;for(int i=a;i!=b_;i+=s_)\r\n#define TO_1(i, a, b) int s_=a&lt;b?1:-1,b_=b;for(int i=a;i!=b_;i+=s_)\r\n#define SQZ(i, j, a, b) for (int i=int(a),j=int(b)-1;i&lt;j;++i,--j)\r\n#define SQZ_1(i, j, a, b) for (int i=int(a),j=int(b);i&lt;=j;++i,--j)\r\n#define REP_2(i, j, n, m) REP(i, n) REP(j, m)\r\n#define REP_2_1(i, j, n, m) REP_1(i, n) REP_1(j, m)\r\n\r\n#define ALL(A) A.begin(), A.end()\r\n#define LLA(A) A.rbegin(), A.rend()\r\n#define CPY(A, B) memcpy(A, B, sizeof(A))\r\n#define INS(A, P, B) A.insert(A.begin() + P, B)\r\n#define ERS(A, P) A.erase(A.begin() + P)\r\n#define BSC(A, X) find(ALL(A), X) \/\/ != A.end()\r\n#define CTN(T, x) (T.find(x) != T.end())\r\n#define SZ(A) int(A.size())\r\n#define PB push_back\r\n#define MP(A, B) make_pair(A, B)\r\n\r\n#define Rush int T____; RD(T____); DO(T____)\r\n#pragma comment(linker, &quot;\/STACK:36777216&quot;)\r\n#pragma GCC optimize (&quot;O2&quot;)\r\n#define Ruby system(&quot;ruby main.rb&quot;)\r\n#define Haskell system(&quot;runghc main.hs&quot;)\r\n#define Pascal system(&quot;fpc main.pas&quot;)\r\n\r\ntypedef long long LL;\r\ntypedef double DB;\r\ntypedef unsigned UINT;\r\ntypedef unsigned long long ULL;\r\n\r\ntypedef vector&lt;int&gt; VI;\r\ntypedef vector&lt;char&gt; VC;\r\ntypedef vector&lt;string&gt; VS;\r\ntypedef vector&lt;LL&gt; VL;\r\ntypedef vector&lt;DB&gt; VD;\r\ntypedef set&lt;int&gt; SI;\r\ntypedef set&lt;string&gt; SS;\r\ntypedef set&lt;LL&gt; SL;\r\ntypedef set&lt;DB&gt; SD;\r\ntypedef map&lt;int, int&gt; MII;\r\ntypedef map&lt;string, int&gt; MSI;\r\ntypedef map&lt;LL, int&gt; MLI;\r\ntypedef map&lt;DB, int&gt; MDI;\r\ntypedef map&lt;int, bool&gt; MIB;\r\ntypedef map&lt;string, bool&gt; MSB;\r\ntypedef map&lt;LL, bool&gt; MLB;\r\ntypedef map&lt;DB, bool&gt; MDB;\r\ntypedef pair&lt;int, int&gt; PII;\r\ntypedef pair&lt;int, bool&gt; PIB;\r\ntypedef vector&lt;PII&gt; VII;\r\ntypedef vector&lt;VI&gt; VVI;\r\ntypedef vector&lt;VII&gt; VVII;\r\ntypedef set&lt;PII&gt; SII;\r\ntypedef map&lt;PII, int&gt; MPIII;\r\ntypedef map&lt;PII, bool&gt; MPIIB;\r\n\r\n\r\n\/** I\/O Accelerator **\/\r\n\r\n\/* ... :&quot; We are I\/O Accelerator ... Use us at your own risk ;) ... &quot; .. *\/\r\n\r\ntemplate&lt;class T&gt; inline void RD(T &amp;);\r\ntemplate&lt;class T&gt; inline void OT(const T &amp;);\r\n\r\ninline int RD(){ int x; RD(x); return x;}\r\ntemplate&lt;class T&gt; inline T&amp; _RD(T &amp;x){ RD(x); return x;}\r\ninline void RC(char &amp;c){scanf(&quot; %c&quot;, &amp;c);}\r\ninline void RS(char *s){scanf(&quot;%s&quot;, s);}\r\n\r\ntemplate&lt;class T0, class T1&gt; inline void RD(T0 &amp;x0, T1 &amp;x1){RD(x0), RD(x1);}\r\ntemplate&lt;class T0, class T1, class T2&gt; inline void RD(T0 &amp;x0, T1 &amp;x1, T2 &amp;x2){RD(x0), RD(x1), RD(x2);}\r\ntemplate&lt;class T0, class T1, class T2, class T3&gt; inline void RD(T0 &amp;x0, T1 &amp;x1, T2 &amp;x2, T3 &amp;x3){RD(x0), RD(x1), RD(x2), RD(x3);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4&gt; inline void RD(T0 &amp;x0, T1 &amp;x1, T2 &amp;x2, T3 &amp;x3, T4 &amp;x4){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4, class T5&gt; inline void RD(T0 &amp;x0, T1 &amp;x1, T2 &amp;x2, T3 &amp;x3, T4 &amp;x4, T5 &amp;x5){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4), RD(x5);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4, class T5, class T6&gt; inline void RD(T0 &amp;x0, T1 &amp;x1, T2 &amp;x2, T3 &amp;x3, T4 &amp;x4, T5 &amp;x5, T6 &amp;x6){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4), RD(x5), RD(x6);}\r\ntemplate&lt;class T0, class T1&gt; inline void OT(T0 &amp;x0, T1 &amp;x1){OT(x0), OT(x1);}\r\ntemplate&lt;class T0, class T1, class T2&gt; inline void OT(T0 &amp;x0, T1 &amp;x1, T2 &amp;x2){OT(x0), OT(x1), OT(x2);}\r\ntemplate&lt;class T0, class T1, class T2, class T3&gt; inline void OT(T0 &amp;x0, T1 &amp;x1, T2 &amp;x2, T3 &amp;x3){OT(x0), OT(x1), OT(x2), OT(x3);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4&gt; inline void OT(T0 &amp;x0, T1 &amp;x1, T2 &amp;x2, T3 &amp;x3, T4 &amp;x4){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4, class T5&gt; inline void OT(T0 &amp;x0, T1 &amp;x1, T2 &amp;x2, T3 &amp;x3, T4 &amp;x4, T5 &amp;x5){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4), OT(x5);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4, class T5, class T6&gt; inline void OT(T0 &amp;x0, T1 &amp;x1, T2 &amp;x2, T3 &amp;x3, T4 &amp;x4, T5 &amp;x5, T6 &amp;x6){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4), OT(x5), OT(x6);}\r\n\r\ntemplate&lt;class T&gt; inline void RST(T &amp;A){memset(A, 0, sizeof(A));}\r\ntemplate&lt;class T0, class T1&gt; inline void RST(T0 &amp;A0, T1 &amp;A1){RST(A0), RST(A1);}\r\ntemplate&lt;class T0, class T1, class T2&gt; inline void RST(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2){RST(A0), RST(A1), RST(A2);}\r\ntemplate&lt;class T0, class T1, class T2, class T3&gt; inline void RST(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2, T3 &amp;A3){RST(A0), RST(A1), RST(A2), RST(A3);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4&gt; inline void RST(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2, T3 &amp;A3, T4 &amp;A4){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4, class T5&gt; inline void RST(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2, T3 &amp;A3, T4 &amp;A4, T5 &amp;A5){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4), RST(A5);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4, class T5, class T6&gt; inline void RST(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2, T3 &amp;A3, T4 &amp;A4, T5 &amp;A5, T6 &amp;A6){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4), RST(A5), RST(A6);}\r\ntemplate&lt;class T&gt; inline void CLR(T &amp;A){A.clear();}\r\ntemplate&lt;class T0, class T1&gt; inline void CLR(T0 &amp;A0, T1 &amp;A1){CLR(A0), CLR(A1);}\r\ntemplate&lt;class T0, class T1, class T2&gt; inline void CLR(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2){CLR(A0), CLR(A1), CLR(A2);}\r\ntemplate&lt;class T0, class T1, class T2, class T3&gt; inline void CLR(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2, T3 &amp;A3){CLR(A0), CLR(A1), CLR(A2), CLR(A3);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4&gt; inline void CLR(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2, T3 &amp;A3, T4 &amp;A4){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4, class T5&gt; inline void CLR(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2, T3 &amp;A3, T4 &amp;A4, T5 &amp;A5){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4), CLR(A5);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4, class T5, class T6&gt; inline void CLR(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2, T3 &amp;A3, T4 &amp;A4, T5 &amp;A5, T6 &amp;A6){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4), CLR(A5), CLR(A6);}\r\ntemplate&lt;class T&gt; inline void CLR(T &amp;A, int n){REP(i, n) CLR(A&#x5B;i]);}\r\ntemplate&lt;class T&gt; inline void FLC(T &amp;A, int x){memset(A, x, sizeof(A));}\r\ntemplate&lt;class T0, class T1&gt; inline void FLC(T0 &amp;A0, T1 &amp;A1, int x){FLC(A0, x), FLC(A1, x);}\r\ntemplate&lt;class T0, class T1, class T2&gt; inline void FLC(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2){FLC(A0), FLC(A1), FLC(A2);}\r\ntemplate&lt;class T0, class T1, class T2, class T3&gt; inline void FLC(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2, T3 &amp;A3){FLC(A0), FLC(A1), FLC(A2), FLC(A3);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4&gt; inline void FLC(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2, T3 &amp;A3, T4 &amp;A4){FLC(A0), FLC(A1), FLC(A2), FLC(A3), FLC(A4);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4, class T5&gt; inline void FLC(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2, T3 &amp;A3, T4 &amp;A4, T5 &amp;A5){FLC(A0), FLC(A1), FLC(A2), FLC(A3), FLC(A4), FLC(A5);}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4, class T5, class T6&gt; inline void FLC(T0 &amp;A0, T1 &amp;A1, T2 &amp;A2, T3 &amp;A3, T4 &amp;A4, T5 &amp;A5, T6 &amp;A6){FLC(A0), FLC(A1), FLC(A2), FLC(A3), FLC(A4), FLC(A5), FLC(A6);}\r\n\r\ntemplate&lt;class T&gt; inline void SRT(T &amp;A){sort(ALL(A));}\r\ntemplate&lt;class T, class C&gt; inline void SRT(T &amp;A, C B){sort(ALL(A), B);}\r\n\r\n\r\n\/** Add - On **\/\r\n\r\nconst int MOD = 360;\r\nconst int INF = 0x7fffffff;\r\nconst DB PI = acos(-1.0);\r\nconst DB EPS = 1e-6;\r\nconst DB OO = 1e15;\r\n\r\n\/\/ &lt;&lt;= ` 0. Daily Use .,\r\n\r\ntemplate&lt;class T&gt; inline void checkMin(T &amp;a,const T b){if (b&lt;a) a=b;}\r\ntemplate&lt;class T&gt; inline void checkMax(T &amp;a,const T b){if (b&gt;a) a=b;}\r\ntemplate &lt;class T, class C&gt; inline void checkMin(T&amp; a, const T b, C c){if (c(b,a)) a = b;}\r\ntemplate &lt;class T, class C&gt; inline void checkMax(T&amp; a, const T b, C c){if (c(a,b)) a = b;}\r\ntemplate&lt;class T&gt; inline T min(T a, T b, T c){return min(min(a, b), c);}\r\ntemplate&lt;class T&gt; inline T max(T a, T b, T c){return max(max(a, b), c);}\r\ntemplate&lt;class T&gt; inline T sqr(T a){return a*a;}\r\ntemplate&lt;class T&gt; inline T cub(T a){return a*a*a;}\r\nint Ceil(int x, int y){return (x - 1) \/ y + 1;}\r\n\r\n\/\/ &lt;&lt;= ` 1. Bitwise Operation .,\r\n\r\ninline bool _1(int x, int i){return x &amp; 1&lt;&lt;i;}\r\ninline int _1(int i){return 1&lt;&lt;i;}\r\ninline int _U(int i){return _1(i) - 1;};\r\n\r\ninline int count_bits(int x){\r\n    x = (x &amp; 0x55555555) + ((x &amp; 0xaaaaaaaa) &gt;&gt; 1);\r\n    x = (x &amp; 0x33333333) + ((x &amp; 0xcccccccc) &gt;&gt; 2);\r\n    x = (x &amp; 0x0f0f0f0f) + ((x &amp; 0xf0f0f0f0) &gt;&gt; 4);\r\n    x = (x &amp; 0x00ff00ff) + ((x &amp; 0xff00ff00) &gt;&gt; 8);\r\n    x = (x &amp; 0x0000ffff) + ((x &amp; 0xffff0000) &gt;&gt; 16);\r\n    return x;\r\n}\r\n\r\ntemplate&lt;class T&gt; inline T low_bit(T x) {\r\n    return x &amp; -x;\r\n}\r\n\r\ntemplate&lt;class T&gt; inline T high_bit(T x) {\r\n    T p = low_bit(x);\r\n    while (p != x) x -= p, p = low_bit(x);\r\n    return p;\r\n}\r\n\r\n\/\/ &lt;&lt;= ` 2. Modular Arithmetic Basic .,\r\n\r\ninline void INC(int &amp;a, int b){a += b; if (a &gt;= MOD) a -= MOD;}\r\ninline int sum(int a, int b){a += b; if (a &gt;= MOD) a -= MOD; return a;}\r\ninline void DEC(int &amp;a, int b){a -= b; if (a &lt; 0) a += MOD;}\r\ninline int dff(int a, int b){a -= b; if (a &lt; 0) a  += MOD; return a;}\r\ninline void MUL(int &amp;a, int b){a = (LL)a * b % MOD;}\r\ninline int pdt(int a, int b){return (LL)a * b % MOD;}\r\n\r\n\r\n\/\/ &lt;&lt;= ' 0. I\/O Accelerator interface .,\r\n\r\ntemplate&lt;class T&gt; inline void RD(T &amp;x){\r\n    \/\/cin &gt;&gt; x;\r\n    \/\/scanf(&quot;%d&quot;, &amp;x);\r\n    char c; for (c = getchar(); c &lt; '0'; c = getchar()); x = c - '0'; for (c = getchar(); c &gt;= '0'; c = getchar()) x = x * 10 + c - '0';\r\n    \/\/char c; c = getchar(); x = c - '0'; for (c = getchar(); c &gt;= '0'; c = getchar()) x = x * 10 + c - '0';\r\n\r\n}\r\n\r\nint ____Case;\r\ntemplate&lt;class T&gt; inline void OT(const T &amp;x){\r\n    \/\/cout &lt;&lt; x &lt;&lt; endl;\r\n    printf(&quot;%d\\n&quot;, x);\r\n    \/\/printf(&quot;%.2lf\\n&quot;, x);\r\n    \/\/printf(&quot;Case %d: %d\\n&quot;, ++____Case, x);\r\n}\r\n\r\n\r\n#define For_each(it, A) for (SII::iterator it = A.begin(); it != A.end(); ++it)\r\n\r\n\/* .................................................................................................................................. *\/\r\n\r\nconst int N = 10, M = N * N;\r\n\r\nmap&lt;string, int&gt; Star, Sign;\r\n\r\nstruct Vertex{\r\n    int e, c, p;\r\n} V&#x5B;N];\r\n\r\nstruct Edge{\r\n    int x, y, c;\r\n    int cc(){\r\n        return min(c, V&#x5B;x].e, V&#x5B;y].e);\r\n    }\r\n} E&#x5B;M];\r\n\r\nint ans, cur;\r\nint m;\r\n\r\n\r\nvoid Init(){\r\n    Star&#x5B;&quot;Sun&quot;] = 0, Star&#x5B;&quot;Moon&quot;] = 1, Star&#x5B;&quot;Mercury&quot;] = 2, Star&#x5B;&quot;Venus&quot;] = 3;\r\n    Star&#x5B;&quot;Mars&quot;] = 4, Star&#x5B;&quot;Jupiter&quot;] = 5, Star&#x5B;&quot;Saturn&quot;] = 6, Star&#x5B;&quot;Uranus&quot;] = 7;\r\n    Star&#x5B;&quot;Neptune&quot;] = 8, Star&#x5B;&quot;Pluto&quot;] = 9;\r\n\r\n    Sign&#x5B;&quot;Aries&quot;] = 0, Sign&#x5B;&quot;Taurus&quot;] = 1, Sign&#x5B;&quot;Gemini&quot;] = 2, Sign&#x5B;&quot;Cancer&quot;] = 3,\r\n    Sign&#x5B;&quot;Leo&quot;] = 4, Sign&#x5B;&quot;Virgo&quot;] = 5, Sign&#x5B;&quot;Libra&quot;] = 6, Sign&#x5B;&quot;Scorpio&quot;] = 7,\r\n    Sign&#x5B;&quot;Sagittarius&quot;] = 8, Sign&#x5B;&quot;Capricorn&quot;] = 9, Sign&#x5B;&quot;Aquarius&quot;] = 10, Sign&#x5B;&quot;Pisces&quot;] = 11;\r\n}\r\n\r\nvoid Build_Graph(){\r\n\r\n    string star, sign;\r\n    int a, b, d;\r\n\r\n    DO_C(N){\r\n        cin &gt;&gt; star &gt;&gt; sign &gt;&gt; d; a = Star&#x5B;star], b = Sign&#x5B;sign];\r\n\r\n        V&#x5B;a].e = 5, V&#x5B;a].c = 3, V&#x5B;a].p = b * 30 + d;\r\n\r\n        \/\/ Star State: Rise, Fall, Exalt &amp;&amp; Debilitate\r\n\r\n#define Rise V&#x5B;a].e += 3\r\n#define Fall V&#x5B;a].e -= 3\r\n#define Exalt V&#x5B;a].c += 2\r\n#define Debilitate V&#x5B;a].c -= 2\r\n\r\n        if (star == &quot;Sun&quot;){\r\n            if (sign == &quot;Leo&quot;) Rise;\r\n            else if (sign == &quot;Aquarius&quot;) Fall;\r\n            else if (sign == &quot;Aries&quot;) Exalt;\r\n            else if (sign == &quot;Libra&quot;) Debilitate;\r\n        }\r\n        else if (star == &quot;Moon&quot;){\r\n            if (sign == &quot;Cancer&quot;) Rise;\r\n            else if (sign == &quot;Capricorn&quot;) Fall;\r\n            else if (sign == &quot;Taurus&quot;) Exalt;\r\n            else if (sign == &quot;Scorpio&quot;) Debilitate;\r\n        }\r\n        else if (star == &quot;Mercury&quot;){\r\n            if (sign == &quot;Gemini&quot; || sign == &quot;Virgo&quot;) Rise;\r\n            else if (sign == &quot;Sagittarius&quot; || sign == &quot;Pisces&quot;) Fall;\r\n            else if (sign == &quot;Aquarius&quot;) Exalt;\r\n            else if (sign == &quot;Leo&quot;) Debilitate;\r\n        }\r\n        else if (star == &quot;Venus&quot;){\r\n            if (sign == &quot;Taurus&quot; || sign == &quot;Libra&quot;) Rise;\r\n            else if (sign == &quot;Scorpio&quot; || sign == &quot;Aries&quot;) Fall;\r\n            else if (sign == &quot;Pisces&quot;) Exalt;\r\n            else if (sign == &quot;Virgo&quot;) Debilitate;\r\n        }\r\n        else if (star == &quot;Mars&quot;){\r\n            if (sign == &quot;Aries&quot; || sign == &quot;Scorpio&quot;) Rise;\r\n            else if (sign == &quot;Libra&quot; || sign == &quot;Taurus&quot;) Fall;\r\n            else if (sign == &quot;Capricorn&quot;) Exalt;\r\n            else if (sign == &quot;Cancer&quot;) Debilitate;\r\n        }\r\n        else if (star == &quot;Jupiter&quot;){\r\n            if (sign == &quot;Sagittarius&quot; || sign == &quot;Pisces&quot;) Rise;\r\n            else if (sign == &quot;Gemini&quot; || sign == &quot;Virgo&quot;) Fall;\r\n            else if (sign == &quot;Cancer&quot;) Exalt;\r\n            else if (sign == &quot;Capricorn&quot;) Debilitate;\r\n        }\r\n        else if (star == &quot;Saturn&quot;){\r\n            if (sign == &quot;Capricorn&quot; || sign == &quot;Aquarius&quot;) Rise;\r\n            else if (sign == &quot;Cancer&quot; || sign == &quot;Leo&quot;) Fall;\r\n            else if (sign == &quot;Libra&quot;) Exalt;\r\n            else if (sign == &quot;Aries&quot;) Debilitate;\r\n        }\r\n        else if (star == &quot;Uranus&quot;){\r\n            if (sign == &quot;Aquarius&quot;) Rise;\r\n            else if (sign == &quot;Leo&quot;) Fall;\r\n            else if (sign == &quot;Scorpio&quot;) Exalt;\r\n            else if (sign == &quot;Taurus&quot;) Debilitate;\r\n        }\r\n        else if (star == &quot;Neptune&quot;){\r\n            if (sign == &quot;Pisces&quot;) Rise;\r\n            else if (sign == &quot;Virgo&quot;) Fall;\r\n            else if (sign == &quot;Sagittarius&quot;) Exalt;\r\n            else if (sign == &quot;Gemini&quot;) Debilitate;\r\n        }\r\n        else if (star == &quot;Pluto&quot;){\r\n            if (sign == &quot;Scorpio&quot;) Rise;\r\n            else if (sign == &quot;Taurus&quot;) Fall;\r\n            else if (sign == &quot;Virgo&quot;) Exalt;\r\n            else if (sign == &quot;Pisces&quot;) Debilitate;\r\n        }\r\n    }\r\n\r\n    \/\/ Aspects: Sextile, Square, Trine &amp;&amp; Opposite\r\n\r\n#define Conjunct (Diff &lt;= 0 + 5)\r\n#define Sextile (60 - 3 &lt;= Diff &amp;&amp; Diff &lt;= 60 + 3)\r\n#define Square (90 - 4 &lt;= Diff &amp;&amp; Diff &lt;= 90 + 4)\r\n#define Trine (120 - 4 &lt;= Diff &amp;&amp; Diff &lt;= 120 + 4)\r\n#define Opposite (180 - 3 &lt;= Diff &amp;&amp; Diff &lt;= 180)\r\n\r\n    REP(i, N) FOR(j, i+1, N){\r\n\r\n        int Diff = V&#x5B;i].p - V&#x5B;j].p; if (Diff &lt; 0) Diff = -Diff; if (Diff &gt; 180) Diff = 360 - Diff;\r\n\r\n        if (Sextile) V&#x5B;i].c += 1, V&#x5B;j].c += 1;\r\n        else if (Square) V&#x5B;i].c += 2, V&#x5B;j].c += 2, V&#x5B;i].e -= 3, V&#x5B;j].e -= 3;\r\n        else if (Trine) V&#x5B;i].e += 3, V&#x5B;j].e += 3, V&#x5B;i].c -= 2, V&#x5B;j].c -= 2;\r\n        else if (Opposite) V&#x5B;i].e -= 1, V&#x5B;j].e -= 1;\r\n    }\r\n\r\n    REP(i, N) checkMax(V&#x5B;i].e, 0);\r\n\r\n    m = 0;\r\n\r\n    REP(i, N) FOR(j, i+1, N){\r\n\r\n        int Diff = V&#x5B;i].p - V&#x5B;j].p; if (Diff &lt; 0) Diff = -Diff; if (Diff &gt; 180) Diff = 360 - Diff;\r\n\r\n        if (Conjunct) E&#x5B;m].c = INF, E&#x5B;m].x = i, E&#x5B;m++].y = j;\r\n        else if (Sextile || Square || Trine || Opposite){\r\n            E&#x5B;m].c = max(0, V&#x5B;i].c + V&#x5B;j].c + 2);\r\n            if (E&#x5B;m].c) E&#x5B;m].x = i, E&#x5B;m++].y = j;\r\n        }\r\n    }\r\n}\r\n\r\nvoid dfs(int s = 0){\r\n\r\n    int t = 0; FOR(i, s, m) t += E&#x5B;i].cc();\r\n    if (cur + t &lt;= ans) return;\r\n\r\n    if (s == m){\r\n        ans = cur;\r\n    }\r\n    else {\r\n\r\n        DWN_1_C(f, E&#x5B;s].cc(), 0){\r\n\r\n            cur += f;\r\n\r\n            V&#x5B;E&#x5B;s].x].e -= f, V&#x5B;E&#x5B;s].y].e -= f;\r\n\r\n            dfs(s + 1);\r\n\r\n            V&#x5B;E&#x5B;s].x].e += f, V&#x5B;E&#x5B;s].y].e += f;\r\n\r\n            cur -= f;\r\n        }\r\n    }\r\n\r\n}\r\n\r\nint main(){\r\n\r\n    \/\/freopen(&quot;in.txt&quot;, &quot;r&quot;, stdin);\r\n    \/\/freopen(&quot;out.txt&quot;, &quot;w&quot;, stdout);\r\n    \/\/ios::sync_with_stdio(false);\r\n\r\n    Init(); Rush{\r\n        Build_Graph(); cur = ans = 0; dfs();\r\n        OT(ans * 2);\r\n    }\r\n}\r\n\r\n<\/pre>\n<h3>External link: <\/h3>\n<p><a href=\"http:\/\/acmicpc.info\/archives\/383\">http:\/\/acmicpc.info\/archives\/383<\/a><br \/>\n<a href=\"http:\/\/acm.hdu.edu.cn\/showproblem.php?pid=4040\">http:\/\/acm.hdu.edu.cn\/showproblem.php?pid=4040<\/a><br \/>\n<a href=\"http:\/\/boj.me\/onlinejudge\/newoj\/showProblem\/show_problem.php?problem_id=211\">http:\/\/boj.me\/onlinejudge\/newoj\/showProblem\/show_problem.php?problem_id=211<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>.. . Brief description : \u7ed9\u5b9a\u4e00\u526f \u70b9\u6743 Ei\u3001\u8fb9\u6743 Ci \u7684\u65e0\u5411\u56fe\uff0c\u73b0\u5728\u8981\u6c42\u5bf9\u6bcf\u6761\u8fb9\uff0c\u5bf9\u5e94\u4e00\u4e2a\u6536\u76ca\u51fd\u6570 Fi\uff0c \u8981\u6c42\u6ee1\u8db3\u9650\u5236\u6761\u4ef6 Fi<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[34],"tags":[37,36],"class_list":["post-48","post","type-post","status-publish","format-standard","hentry","category-34","tag-37","tag-36"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2tdP7-M","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/48","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/comments?post=48"}],"version-history":[{"count":0,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/48\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/media?parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/categories?post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/tags?post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}