{"id":574,"date":"2012-11-18T21:48:38","date_gmt":"2012-11-18T13:48:38","guid":{"rendered":"http:\/\/www.shuizilong.com\/house\/?p=574"},"modified":"2012-11-18T23:38:14","modified_gmt":"2012-11-18T15:38:14","slug":"%e6%97%a5%e5%b8%b8%e6%a8%a1%e6%9d%bf-manual-ver-0-1","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/house\/archives\/%e6%97%a5%e5%b8%b8%e6%a8%a1%e6%9d%bf-manual-ver-0-1\/","title":{"rendered":"\u65e5\u5e38\u6a21\u677f Manual Ver-0.1"},"content":{"rendered":"<p>\u3002\u3002<br \/>\n\u3002\u3002\u201c Micro Mezzo Macro Flation &#8212; Overheated Economy \u201d\u3002\u3002\uff08\u4ee5\u4e0b\u7b80\u79f0 <a href=\"https:\/\/yande.re\/post\/show\/197011\/c_-control-cleavage-devil-mebae-msyu-q_-control-th\">\u201c \u8fc7\u70ed\u7ecf\u6d4e \u201d<\/a> \u3002\u3002\u3002\u3002<br \/>\n\u3002\u662f\u6211\u73b0\u5728\u5404\u5927 OJ \u4ea4\u9898\u662f\u7c98\u7684\u5934\u6587\u4ef6\u3002\u3002\u3002\u3002\u6700\u65e9\u5927\u6982\u662f\u6211\u53bb\u5e74\u770b\u5230\u4e86 ACRush \u7684\u5934\u6587\u4ef6\u4ee5\u540e\u5927\u4e3a\u60ca\u8bb6\u3002\u3002\u53c2\u8003\u4ee5\u540e\u9010\u6e10\u4fee\u8ba2\u5f62\u6210\u7684\u3002\u3002<\/p>\n<p>\u3002\u6700\u8fd1\u53d1\u73b0\u5c45\u7136\u6709<a href=\"http:\/\/blog.csdn.net\/dslovemz\/article\/details\/8178515\">\u9664\u6211\u4e4b\u5916<\/a>\u7684\u540c\u5b66\u4e5f\u5728\u4f7f\u7528\u8fd9\u4efd\u6a21\u677f\u3002\u3002\uff08\u3002\u4f46\u662f\u4f7f\u7528\u7684\u662f\u51e0\u4e2a\u6708\u524d\u7684\u8fc7\u65f6\u7248\u672c\u3002\u3002\u3002\u3002\u3002<br \/>\n\u3002\u3002\u3002\u3002\u53e6\u5916\u8003\u8651\u8fd9\u4efd\u6a21\u677f\u4e2a\u4eba\u5411\u4e25\u91cd\u3002\u3002\u8fd9\u91cc\u505a\u4e00\u70b9\u8bb0\u5f55\u3002\u3002<\/p>\n<p>Name: Micro Mezzo Macro Flation &#8212; Overheated Economy<br \/>\nUsage: Put it before main function .. .<br \/>\nTags: \u5e38\u7528\u8bed\u5757\u3001\u53d8\u91cf\u9690\u85cf\u3001\u5c40\u90e8 define\u3001\u53ef\u7ec4\u88c5\u3002\u3002\u3002<\/p>\n<p>Module: 0. \u65e5\u5e38\u6a21\u5757 1. \u4f4d\u8fd0\u7b97\u6a21\u5757\uff08BO\uff09 2. \u6570\u8bba\u6a21\u5757\uff08NT\uff09 9. \u8ba1\u7b97\u51e0\u4f55\u6a21\u5757\uff08CG\uff09 .. .<br \/>\n\u3002\u3002 \u3002A. \u968f\u673a\u53d1\u751f\u5668 (RNG) B. \u65f6\u949f\u6a21\u5757\uff08CLOCK\uff09 \u3002\u3002\u3002<\/p>\n<p><a href=\"http:\/\/paste.ubuntu.com\/1367760\/\">\u3002\u3002\u5b8c\u6574\u7248\u3002\uff08 &#8216; MMMFOE ., Ver 0.1 \u3002\u3002\u3002\u3002<\/a><\/p>\n<p><!--more--><\/p>\n<h3>\u5934\u6587\u4ef6\u3001\u5faa\u73af\u4e0e\u5e38\u7528\u8bed\u53e5\u3002\u3002<\/h3>\n<pre class=\"brush: cpp; light: false; title: \u5934\u6587\u4ef6; toolbar: true; notranslate\" title=\"\u5934\u6587\u4ef6\">\r\n#define LOCAL\r\n\r\n\/** ` Micro Mezzo Macro Flation -- Overheated Economy ., Ver 0.1 **\/\r\n\r\n#include &lt;functional&gt;\r\n#include &lt;algorithm&gt;\r\n#include &lt;iostream&gt;\r\n#include &lt;fstream&gt;\r\n#include &lt;sstream&gt;\r\n#include &lt;iomanip&gt;\r\n#include &lt;numeric&gt;\r\n#include &lt;cstring&gt;\r\n#include &lt;cassert&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;stack&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<\/pre>\n<p>\u3002\u3002\u3002\u5934\u6587\u4ef6\u90e8\u5206\u3002\u3002\u552f\u4e00\u5728\u8fd9\u4e00\u8282\u8bf4\u4e00\u4e0b\u7684\u662f\u6761\u4ef6\u7f16\u8bd1\u3002\u3002\u3002\u7f51\u4e0a\u641c\u4e00\u4e0b\u4ec0\u4e48 #define \u7528\u6cd5\u96c6\u9526\u5c31\u4ec0\u4e48\u90fd\u51fa\u6765\u4e86\u5566\u3002\u3002<br \/>\n<a href=\"http:\/\/blog.21ic.com\/user1\/5928\/archives\/2010\/68116.html\">#define\u7528\u6cd5\u96c6\u9526<\/a><br \/>\n<a href=\"http:\/\/www.cplusplus.com\/doc\/tutorial\/preprocessor\/\">C++ Language Tutorial \u2014\u2014 Preprocessor directives<\/a><br \/>\n\u3002\u73b0\u4ee3 OJ \u5927\u591a\u90fd\u5b9a\u4e49\u4e86 ONLINE_JUDGE \u3002\u3002\u3002\u8003\u8651\u5230\u6709\u4e9b OJ \u6ca1\u6709\u5b9a\u4e49\u8fd9\u91cc\u5c31\u5b9a\u4e49\u4e86\u4e00\u4e2a LOCAL\u3002\u3002<br \/>\n\u3002\u3002\u5f53\u7136\u6709\u65f6\u4e5f\u7528\u6765 DEBUG \u7528\u3002\u3002\u53e6\u5916\u5728\u65f6\u949f\u7c7b\u91cc\u9762\u7528\u6765\u5206\u522b Linux \u548c Win32 \u3002\u3002\uff08\u3002\u3002\u5c0f\u838e\u73b0\u5728\u57fa\u672c\u7ed9 hakanai \u7528\u4e86\u3002\u3002\u3002\u3002\u81ea\u673a\u7684\u8bdd\u3002\u3002\u57fa\u672c\u662f\u5728\u7528\u5b9e\u9a8c\u5ba4\u7684 Win7\u3002\u3002<\/p>\n<pre class=\"brush: cpp; light: false; title: \u5404\u79cd\u5faa\u73af; toolbar: true; notranslate\" title=\"\u5404\u79cd\u5faa\u73af\">\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 ECH(it, A) for (typeof(A.begin()) it=A.begin(); it != A.end(); ++it)\r\n#define ECH(it, A) for (__typeof(A.begin()) it=A.begin(); it != A.end(); ++it)\r\n#define REP_S(it, str) for (char*it=str;*it;++it) \/\/ \u7528\u4e8e\u5b57\u7b26\u4e32\u7684 .. .\r\n#define REP_G(it, u) for (int it=hd&#x5B;u];it;it=suc&#x5B;it]) \/\/ \u7528\u4e8e\u56fe\u8bba\u7684 .. .\r\n#define DO(n) for ( int ____n ## __line__ = n; ____n ## __line__ -- ; )\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#define REP_3(i, j, k, n, m, l) REP(i, n) REP(j, m) REP(k, l)\r\n#define REP_3_1(i, j, k, n, m, l) REP_1(i, n) REP_1(j, m) REP_1(k, l)\r\n<\/pre>\n<ul>\n<li>REP(i, n): \u4ece 0 \u5230 n-1 ..<\/li>\n<li>FOR(i, a, b): \u4ece a \u5230 b-1 ..<\/li>\n<li>DWN(i, b, a): \u4ece b-1 \u5230 a .. .<\/li>\n<\/ul>\n<p>\u4e0b\u5212\u7ebf\u540e\u9762\u63a5\u7684\u662f\u5f00\u5173\u3002\u3002\u3002<\/p>\n<ul>\n<li>_1: \u8868\u793a with 1 offset\u3002\u3002\u3002\uff08\u3002\u3002\u5c31\u662f\u539f\u672c\u7684 [0, n) \u53d8\u6210\u4e86 [1, n] \u3002\u3002\u3002<\/li>\n<li>_C: \u8868\u793a\u5c40\u90e8\u7f13\u5b58\u4e00\u4e0b\uff08cache\uff09\u3002\u3002\u5728\u4e0b\u6807\u662f\u590d\u6742\u8868\u8fbe\u5f0f \uff08\u4f8b\u5982 \u8ddf\u4e86\u4e00\u4e2a\u51fd\u6570 \u6216\u8005 sqrt \u4ec0\u4e48\u4ec0\u4e48\u7684\u65f6\u5019\u7ecf\u5e38\u7528\u5230\u3002\u3002\u3002<\/li>\n<li>_N: \u8868\u793a\u4e0d\u58f0\u660e\u5faa\u73af\u53d8\u91cf\u3002\u3002\u53ef\u80fd\u662f\u524d\u9762\u58f0\u660e\u8fc7\u4e86\u3002\u3002\u6216\u8005\u51fa\u4e86\u5faa\u73af\u540e\u8fd8\u8981\u7528\u3002\u3002<\/li>\n<\/ul>\n<p>\u3002\u3002\u3002DO(n) .. \u7c7b\u4f3c\u4e8e Ruby \u91cc\u9762\u7684 n.times \u3002\u3002\u3002\u5c5e\u4e8e\u7eaf\u7cb9\u8ba1\u6570\u5faa\u73af\u7684\u90a3\u79cd\u8fde\u4e0b\u6807\u90fd\u6ca1\u6709\u3002\u3002\u91cc\u9762\u7684 ## __line__ \u8868\u793a\u5c40\u90e8\u53d8\u91cf\u548c\u884c\u53f7\u6709\u5173\u3002\u3002\u53ef\u4ee5\u4fdd\u8bc1\u4e0d\u91cd\u590d\u3002<br \/>\n\u3002\uff08\u4f46\u540e\u6765\u53d1\u73b0\u4e0d\u8fd9\u6837\u5199\u4f3c\u4e4e\u4e5f\u4e0d\u4f1a\u9020\u6210\u51b2\u7a81\u3002\u3002\u4fdd\u9669\u8d77\u89c1\u8fd8\u662f\u52a0\u4e0a\u628a\u3002\u3002\u3002<br \/>\n\u3002\u3002\u4e4b\u540e\u8fd8\u6709\u4e00\u4e9b REP \u5faa\u73af\u7684\u6d3e\u751f\u3002\u3002\u5927\u5bb6\u81ea\u5df1\u6839\u636e\u5b57\u9762\u610f\u601d yy \u5427\u3002\u3002\u3002<\/p>\n<p>\u7ec3\u4e60\uff1a\u3002\u3002\u8bfb\u5165 n\u3002\u3002\u518d\u4f9d\u6b21\u8bfb\u5165 a \u6570\u7ec4\u3002\u3002\u5bf9\u6570\u7ec4\u7684\u6bcf\u4e2a\u5143\u7d20 -= 1\u3002\u3002<\/p>\n<pre class=\"brush: cpp; collapse: false; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\n.. .\r\n  REP_C(i, RD(n)) --RD(a&#x5B;i]);\r\n.. .\r\n<\/pre>\n<pre class=\"brush: cpp; light: false; title: \u5e38\u7528\u8bed\u53e5; toolbar: true; notranslate\" title=\"\u5e38\u7528\u8bed\u53e5\">\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#define PTT pair&lt;T, T&gt;\r\n#define fi first\r\n#define se second\r\n\r\n#define Rush int T____; RD(T____); DO(T____)\r\n\r\n#define Display(A, n, m) {                      \\\r\n\tREP(i, n){\t\t                            \\\r\n        REP(j, m) cout &lt;&lt; A&#x5B;i]&#x5B;j] &lt;&lt; &quot; &quot;;       \\\r\n        cout &lt;&lt; endl;\t\t\t\t            \\\r\n\t}\t\t\t\t\t\t                    \\\r\n}\r\n\r\n#define Display_1(A, n, m) {\t\t\t\t    \\\r\n\tREP_1(i, n){\t\t                        \\\r\n        REP_1(j, m) cout &lt;&lt; A&#x5B;i]&#x5B;j] &lt;&lt; &quot; &quot;;     \\\r\n\t\tcout &lt;&lt; endl;\t\t            \t\t\\\r\n\t}\t\t\t\t\t\t                    \\\r\n}\r\n\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 Python system(&quot;python main.py&quot;)\r\n#define Pascal system(&quot;fpc main.pas&quot;)\r\n<\/pre>\n<p>\u3002\u3002\u3002Display \u662f\u65b9\u4fbf\u8c03\u8bd5\u7528\u7684\u3002\u3002\u8fd9\u91cc\u7528\u4e86\u591a\u884c #define\u3002\u3002<br \/>\n\u7136\u540e\u4e0b\u9762\u63a5\u4e86\u4e00\u5806\u65b9\u4fbf\u5e73\u5e38\u8c03\u8bd5\u811a\u672c\u8bed\u8a00\u7684 =w=\u3002\u3002\uff08\u3002\u3002\u6211\u5230\u73b0\u5728\u8fd8\u53ea\u4f1a\u7528 NotePad 2 \u3002\u3002\u3002\u3002<\/p>\n<pre class=\"brush: cpp; light: false; title: \u5e38\u7528 typedef\u3002\u3002; toolbar: true; notranslate\" title=\"\u5e38\u7528 typedef\u3002\u3002\">\r\ntypedef long long LL;\r\n\/\/typedef long double DB;\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 pair&lt;int, int&gt; PII;\r\ntypedef pair&lt;int, bool&gt; PIB;\r\ntypedef pair&lt;LL, LL&gt; PLL;\r\ntypedef vector&lt;PII&gt; VII;\r\ntypedef vector&lt;VI&gt; VVI;\r\ntypedef vector&lt;VII&gt; VVII;\r\n<\/pre>\n<pre class=\"brush: cpp; light: false; title: \u5404\u79cd\u8bfb\u5165\u51fd\u6570; toolbar: true; notranslate\" title=\"\u5404\u79cd\u8bfb\u5165\u51fd\u6570\">\r\ntemplate&lt;class T&gt; inline T&amp; RD(T &amp;);\r\ntemplate&lt;class T&gt; inline void OT(const T &amp;);\r\ninline LL RD(){LL x; return RD(x);}\r\ninline char&amp; RC(char &amp;c){scanf(&quot; %c&quot;, &amp;c); return c;}\r\ninline char RC(){char c; return RC(c);}\r\n\/\/inline char&amp; RC(char &amp;c){c = getchar(); return c;}\r\n\/\/inline char RC(){return getchar();}\r\ninline DB&amp; RF(DB &amp;x){scanf(&quot;%lf&quot;, &amp;x); return x;}\r\ninline DB RF(){DB x; return RF(x);}\r\ninline char* RS(char *s){scanf(&quot;%s&quot;, s); return s;}\r\n<\/pre>\n<p>\u3002\u3002\u6ce8\u610f\u6700\u6700\u5e38\u7528\u7684 RD(x) \u548c OT(x) \u3002\u3002\u7684\u63a5\u53e3\u653e\u5728\u6700\u4e0b\u9762\u4e86\u3002\u3002\u3002\u3002\uff08\u56e0\u4e3a\u7ecf\u5e38\u8981\u6839\u636e\u4e0d\u540c\u7684\u9898\u76ee\u3002\u3002\u5fae\u8c03\u4e00\u4e0b\u3002\u3002\u3002<\/p>\n<pre class=\"brush: cpp; light: false; title: \u5404\u79cd\u547d\u4ee4\u8865\u5b8c\u3002\u3002\u6700\u5927\u64cd\u4f5c\u6570 7 \u3002\u3002; toolbar: true; notranslate\" title=\"\u5404\u79cd\u547d\u4ee4\u8865\u5b8c\u3002\u3002\u6700\u5927\u64cd\u4f5c\u6570 7 \u3002\u3002\">\r\ntemplate&lt;class T0, class T1&gt; inline T0&amp; RD(T0 &amp;x0, T1 &amp;x1){RD(x0), RD(x1); return x0;}\r\ntemplate&lt;class T0, class T1, class T2&gt; inline T0&amp; RD(T0 &amp;x0, T1 &amp;x1, T2 &amp;x2){RD(x0), RD(x1), RD(x2); return x0;}\r\ntemplate&lt;class T0, class T1, class T2, class T3&gt; inline T0&amp; RD(T0 &amp;x0, T1 &amp;x1, T2 &amp;x2, T3 &amp;x3){RD(x0), RD(x1), RD(x2), RD(x3); return x0;}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4&gt; inline T0&amp; 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); return x0;}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4, class T5&gt; inline T0&amp; 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); return x0;}\r\ntemplate&lt;class T0, class T1, class T2, class T3, class T4, class T5, class T6&gt; inline T0&amp; 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); return x0;}\r\ntemplate&lt;class T0, class T1&gt; inline void OT(const T0 &amp;x0, const T1 &amp;x1){OT(x0), OT(x1);}\r\ntemplate&lt;class T0, class T1, class T2&gt; inline void OT(const T0 &amp;x0, const T1 &amp;x1, const T2 &amp;x2){OT(x0), OT(x1), OT(x2);}\r\ntemplate&lt;class T0, class T1, class T2, class T3&gt; inline void OT(const T0 &amp;x0, const T1 &amp;x1, const T2 &amp;x2, const 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(const T0 &amp;x0, const T1 &amp;x1, const T2 &amp;x2, const T3 &amp;x3, const 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(const T0 &amp;x0, const T1 &amp;x1, const T2 &amp;x2, const T3 &amp;x3, const T4 &amp;x4, const 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(const T0 &amp;x0, const T1 &amp;x1, const T2 &amp;x2, const T3 &amp;x3, const T4 &amp;x4, const T5 &amp;x5, const T6 &amp;x6){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4), OT(x5), OT(x6);}\r\ninline char&amp; RC(char &amp;a, char &amp;b){RC(a), RC(b); return a;}\r\ninline char&amp; RC(char &amp;a, char &amp;b, char &amp;c){RC(a), RC(b), RC(c); return a;}\r\ninline char&amp; RC(char &amp;a, char &amp;b, char &amp;c, char &amp;d){RC(a), RC(b), RC(c), RC(d); return a;}\r\ninline char&amp; RC(char &amp;a, char &amp;b, char &amp;c, char &amp;d, char &amp;e){RC(a), RC(b), RC(c), RC(d), RC(e); return a;}\r\ninline char&amp; RC(char &amp;a, char &amp;b, char &amp;c, char &amp;d, char &amp;e, char &amp;f){RC(a), RC(b), RC(c), RC(d), RC(e), RC(f); return a;}\r\ninline char&amp; RC(char &amp;a, char &amp;b, char &amp;c, char &amp;d, char &amp;e, char &amp;f, char &amp;g){RC(a), RC(b), RC(c), RC(d), RC(e), RC(f), RC(g); return a;}\r\ninline DB&amp; RF(DB &amp;a, DB &amp;b){RF(a), RF(b); return a;}\r\ninline DB&amp; RF(DB &amp;a, DB &amp;b, DB &amp;c){RF(a), RF(b), RF(c); return a;}\r\ninline DB&amp; RF(DB &amp;a, DB &amp;b, DB &amp;c, DB &amp;d){RF(a), RF(b), RF(c), RF(d); return a;}\r\ninline DB&amp; RF(DB &amp;a, DB &amp;b, DB &amp;c, DB &amp;d, DB &amp;e){RF(a), RF(b), RF(c), RF(d), RF(e); return a;}\r\ninline DB&amp; RF(DB &amp;a, DB &amp;b, DB &amp;c, DB &amp;d, DB &amp;e, DB &amp;f){RF(a), RF(b), RF(c), RF(d), RF(e), RF(f); return a;}\r\ninline DB&amp; RF(DB &amp;a, DB &amp;b, DB &amp;c, DB &amp;d, DB &amp;e, DB &amp;f, DB &amp;g){RF(a), RF(b), RF(c), RF(d), RF(e), RF(f), RF(g); return a;}\r\ninline void RS(char *s1, char *s2){RS(s1), RS(s2);}\r\ninline void RS(char *s1, char *s2, char *s3){RS(s1), RS(s2), RS(s3);}\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 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, int x){FLC(A0, x), FLC(A1, x), FLC(A2, x);}\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, int x){FLC(A0, x), FLC(A1, x), FLC(A2, x), FLC(A3, x);}\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, int x){FLC(A0, x), FLC(A1, x), FLC(A2, x), FLC(A3, x), FLC(A4, x);}\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, int x){FLC(A0, x), FLC(A1, x), FLC(A2, x), FLC(A3, x), FLC(A4, x), FLC(A5, x);}\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, int x){FLC(A0, x), FLC(A1, x), FLC(A2, x), FLC(A3, x), FLC(A4, x), FLC(A5, x), FLC(A6, x);}\r\ntemplate&lt;class T&gt; inline void CLR(priority_queue&lt;T, vector&lt;T&gt;, less&lt;T&gt; &gt; &amp;Q){while (!Q.empty()) Q.pop();}\r\ntemplate&lt;class T&gt; inline void CLR(priority_queue&lt;T, vector&lt;T&gt;, greater&lt;T&gt; &gt; &amp;Q){while (!Q.empty()) Q.pop();}\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\n\r\ntemplate&lt;class T&gt; inline T&amp; SRT(T &amp;A){sort(ALL(A)); return A;}\r\ntemplate&lt;class T, class C&gt; inline T&amp; SRT(T &amp;A, C B){sort(ALL(A), B); return A;}\r\n<\/pre>\n<p>\u3002\u3002\u3002\u5176\u5b9e\u8fd9\u6bb5\u9b3c\u755c\u7684\u4e1c\u897f\u4e3b\u8981\u5c31 3 \u4e2a\u51fd\u6570\u3002\u3002<\/p>\n<ul>\n<li>.. RST(A) .. reset \u3002\u3002\u3002\u6e05 0 \u3002\u3002\u3002<\/li>\n<li>.. FLC(A, x) .. fillchar\uff08\u53d6\u81ea Pascall\uff09&#8230; \u8868\u793a\u666e\u901a\u7684 memset\u3002\u3002\u3002<\/li>\n<li>.. CLR(A).. clear\u3002\u3002\u3002\u8868\u793a clear \u6389\u3002\u3002\u6ce8\u610f\u8fd9\u4e2a\u4e1c\u897f\u3002\u3002\u5982\u679c\u4f20\u8fdb\u53bb\u7684\u662f \u4f18\u5148\u961f\u5217 \u7684\u8bdd\u4e5f\u4f1a\u6709\u5904\u7406\u3002\u3002\u3002\u4e00\u4e2a\u4e00\u4e2a\u5f39\u6389\u3002\u3002\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u5f00\u59cb\u662f Add &#8211; On \u7684\u90e8\u5206\u5566\u3002\u3002\u9996\u5148\u662f\u653e\u5e38\u91cf\u8868\u7684\u5730\u65b9\u3002\u3002\u3002\u3002\u3002<\/p>\n<pre class=\"brush: cpp; light: false; title: \u5e38\u91cf\u8868; toolbar: true; notranslate\" title=\"\u5e38\u91cf\u8868\">\r\n\/** Add - On **\/\r\n\r\nconst int dx&#x5B;] = {-1, 0, 1, 0};\r\nconst int dy&#x5B;] = {0, 1, 0, -1};\r\n\r\nconst int MOD = 1000000007;\r\n\/\/int MOD = 99990001;\r\nconst int INF = 0x3f3f3f3f;\r\nconst LL INFF = 1LL &lt;&lt; 60;\r\nconst DB EPS = 1e-9;\r\nconst DB OO = 1e15;\r\nconst DB PI = acos(-1.0); \/\/M_PI;\r\n<\/pre>\n<p>\u4e4b\u540e\u662f\u5404\u79cd\u6a21\u5757\u3002\u3002\u3002<\/p>\n<pre class=\"brush: cpp; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\n<\/pre>\n<p>\u3002\u3002\u3002\u6ce8\u610f\u4e00\u822c\u6765\u8bf4 checkMin\u3002\u3002 checkMax\u3002\u3002\u90fd\u662f\u53ea\u9700\u8981\u5b9a\u4e49 < \u53f7\u3002\u3002\u3002\u3002\n\n[cpp title=\"&lt;&lt;= ` 1. Bitwise Operation ., \uff08\u4f4d\u8fd0\u7b97\u3002\u3002\"]\n\/\/ &lt;&lt;= ` 1. Bitwise Operation .,\n\nnamespace BO{\n\ninline bool _1(int x, int i){return bool(x&amp;1&lt;&lt;i);}\ninline bool _1(LL x, int i){return bool(x&amp;1LL&lt;&lt;i);}\ninline LL _1(int i){return 1LL&lt;&lt;i;}\ninline LL _U(int i){return _1(i) - 1;};\n\ninline int reverse_bits(int x){\n    x = ((x &gt;&gt; 1) &amp; 0x55555555) | ((x &lt;&lt; 1) &amp; 0xaaaaaaaa);\n    x = ((x &gt;&gt; 2) &amp; 0x33333333) | ((x &lt;&lt; 2) &amp; 0xcccccccc);\n    x = ((x &gt;&gt; 4) &amp; 0x0f0f0f0f) | ((x &lt;&lt; 4) &amp; 0xf0f0f0f0);\n    x = ((x &gt;&gt; 8) &amp; 0x00ff00ff) | ((x &lt;&lt; 8) &amp; 0xff00ff00);\n    x = ((x &gt;&gt;16) &amp; 0x0000ffff) | ((x &lt;&lt;16) &amp; 0xffff0000);\n    return x;\n}\n\ninline LL reverse_bits(LL x){\n    x = ((x &gt;&gt; 1) &amp; 0x5555555555555555LL) | ((x &lt;&lt; 1) &amp; 0xaaaaaaaaaaaaaaaaLL);\n    x = ((x &gt;&gt; 2) &amp; 0x3333333333333333LL) | ((x &lt;&lt; 2) &amp; 0xccccccccccccccccLL);\n    x = ((x &gt;&gt; 4) &amp; 0x0f0f0f0f0f0f0f0fLL) | ((x &lt;&lt; 4) &amp; 0xf0f0f0f0f0f0f0f0LL);\n    x = ((x &gt;&gt; 8) &amp; 0x00ff00ff00ff00ffLL) | ((x &lt;&lt; 8) &amp; 0xff00ff00ff00ff00LL);\n    x = ((x &gt;&gt;16) &amp; 0x0000ffff0000ffffLL) | ((x &lt;&lt;16) &amp; 0xffff0000ffff0000LL);\n    x = ((x &gt;&gt;32) &amp; 0x00000000ffffffffLL) | ((x &lt;&lt;32) &amp; 0xffffffff00000000LL);\n    return x;\n}\n\ntemplate&lt;class T&gt; inline bool odd(T x){return x&amp;1;}\ntemplate&lt;class T&gt; inline T low_bit(T x) {return x &amp; -x;}\ntemplate&lt;class T&gt; inline T high_bit(T x) {T p = low_bit(x);while (p != x) x -= p, p = low_bit(x);return p;}\ntemplate&lt;class T&gt; inline T cover_bit(T x){T p = 1; while (p &lt; x) p &lt;&lt;= 1;return p;}\ninline int low_idx(int x){return __builtin_ffs(x);}\ninline int low_idx(LL x){return __builtin_ffsll(x);}\ninline int high_idx(int x){return low_idx(reverse_bits(x));}\ninline int high_idx(LL x){return low_idx(reverse_bits(x));}\ninline int clz(int x){return __builtin_clz(x);}\ninline int clz(LL x){return __builtin_clzll(x);}\ninline int ctz(int x){return __builtin_ctz(x);}\ninline int ctz(LL x){return __builtin_ctzll(x);}\ninline int parity(int x){return __builtin_parity(x);}\ninline int parity(LL x){return __builtin_parityll(x);}\ninline int lg2(int a){return 31 - __builtin_clz(a);}\ninline int count_bits(int x){return __builtin_popcount(x);}\ninline int count_bits(LL x){return __builtin_popcountll(x);}\n\n} using namespace BO;\n[\/cpp]\n\nFrom <a href=\"http:\/\/matrix67.com\/blog\">Matrix67 .. .<\/a><br \/>\n<a href=\"http:\/\/www.matrix67.com\/blog\/archives\/122\">\u4f4d\u8fd0\u7b97\u8bb2\u89e3\u7cfb\u5217\u6587\u7ae0\uff08\u76ee\u5f55\uff09\uff08\u5fc5\u8bfb\u3002\u3002<\/a><br \/>\n<a href=\"http:\/\/www.matrix67.com\/blog\/archives\/813\">\u8da3\u9898\uff1a\u7528\u4f4d\u8fd0\u7b97\u751f\u6210\u4e0b\u4e00\u4e2a\u542b\u6709 k \u4e2a 1 \u7684\u4e8c\u8fdb\u5236\u6570<\/a><br \/>\n<a href=\"http:\/\/www.matrix67.com\/blog\/archives\/3985\">\u795e\u79d8\u5e38\u91cf\u590d\u51fa\uff01\u7528 0x077CB531 \u8ba1\u7b97\u672b\u5c3e 0 \u7684\u4e2a\u6570<\/a><\/p>\n<p>From <a href=\"http:\/\/www.csie.ntnu.edu.tw\/~u91029\/\">\u6f14\u7b97\u6cd5\u7b14\u8bb0 .. .<\/a><br \/>\n<a href=\"http:\/\/www.csie.ntnu.edu.tw\/~u91029\/language.html\">Bitwise Operation \uff08 Under Construction! <\/a><\/p>\n<p>\u5176\u4ed6\u3002\u3002<br \/>\n<a href=\"http:\/\/www.cnblogs.com\/jffifa\/archive\/2012\/01\/16\/2323999.html\">[\u6280\u5de7]\u679a\u4e3e\u5b50\u96c6\u7684\u98d8\u9038\u5199\u6cd5 by \u67ef\u795e<\/a><\/p>\n<pre class=\"brush: cpp; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\nnamespace NT{\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\ninline int sum(int a, int b, int c){return sum(sum(a, b), c);}\r\ninline int sum(int a, int b, int c, int d){return sum(sum(a, b), sum(c, d));}\r\ninline int pdt(int a, int b, int c){return pdt(pdt(a, b), c);}\r\ninline int pdt(int a, int b, int c, int d){return pdt(pdt(pdt(a, b), c), d);}\r\n\r\ninline int pow(int a, LL b){\r\n    int c(1); while (b){\r\n        if (b&amp;1) MUL(c, a);\r\n        MUL(a, a), b &gt;&gt;= 1;\r\n    }\r\n    return c;\r\n}\r\n\r\ntemplate&lt;class T&gt; inline T pow(T a, LL b){\r\n    T c(1); while (b){\r\n        if (b&amp;1) c *= a;\r\n        a *= a, b &gt;&gt;= 1;\r\n    }\r\n    return c;\r\n}\r\n\r\ninline int _I(int b){\r\n    int a = MOD, x1 = 0, x2 = 1, q;\r\n    while (true){\r\n        q = a \/ b, a %= b;\r\n        if (!a) return (x2 + MOD) % MOD;\r\n        DEC(x1, pdt(q, x2));\r\n\r\n        q = b \/ a, b %= a;\r\n        if (!b) return (x1 + MOD) % MOD;\r\n        DEC(x2, pdt(q, x1));\r\n    }\r\n}\r\n\r\ninline void DIA(int &amp;a, int b){MUL(a, _I(b));}\r\ninline int qtt(int a, int b){return pdt(a, _I(b));}\r\n\r\n\r\ninline int phi(int n){\r\n    int res = n; for (int i=2;sqr(i)&lt;=n;++i) if (!(n%i)){\r\n        DEC(res, qtt(res, i));\r\n        do{n \/= i;} while(!(n%i));\r\n    }\r\n    if (n != 1)\r\n        DEC(res, qtt(res, n));\r\n    return res;\r\n}\r\n\r\n} using namespace NT;\r\n<\/pre>\n<p>\u5475\u5475\u3002\u3002\u8fd9\u4e2a\u6570\u8bba\u6a21\u5757\u4e5f\u592a\u5f31\u4e86\u5427\uff1f\u3002\u3002\uff08\u3002\u6682\u65f6\u5148\u8fd9\u6837\u5427\u3002\u3002<\/p>\n<p>\uff08\u3002\u3002\u30023 &#8211; 8 \u5360\u4f4d\u3002\u3002\u3002\u65e5\u540e\u5f85\u8865\u5145\u3002\u3002\u3002<\/p>\n<pre class=\"brush: cpp; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\nnamespace CG{\r\n\r\nstruct Po; struct Line; struct Seg;\r\n\r\ninline int sgn(DB x){return x &lt; -EPS ? -1 : x &gt; EPS;}\r\ninline int sgn(DB x, DB y){return sgn(x - y);}\r\n\r\nstruct Po{\r\n    DB x, y;\r\n    Po(DB _x = 0, DB _y = 0):x(_x), y(_y){}\r\n\r\n    friend istream&amp; operator &gt;&gt;(istream&amp; in, Po &amp;p){return in &gt;&gt; p.x &gt;&gt; p.y;}\r\n    friend ostream&amp; operator &lt;&lt;(ostream&amp; out, Po p){return out &lt;&lt; &quot;(&quot; &lt;&lt; p.x &lt;&lt; &quot;, &quot; &lt;&lt; p.y &lt;&lt; &quot;)&quot;;}\r\n\r\n    friend bool operator ==(Po, Po);\r\n    friend bool operator !=(Po, Po);\r\n\r\n    friend Po operator +(Po, Po);\r\n    friend Po operator -(Po, Po);\r\n    friend Po operator *(Po, DB);\r\n    friend Po operator \/(Po, DB);\r\n\r\n    bool operator &lt; (const Po &amp;rhs) const{return sgn(x, rhs.x) &lt; 0 || sgn(x, rhs.x) == 0 &amp;&amp; sgn(y, rhs.y) &lt; 0;}\r\n    Po operator -() const{return Po(-x, -y);}\r\n    Po&amp; operator +=(Po rhs){x += rhs.x, y += rhs.y; return *this;}\r\n    Po&amp; operator -=(Po rhs){x -= rhs.x, y -= rhs.y; return *this;}\r\n    Po&amp; operator *=(DB k){x *= k, y *= k; return *this;}\r\n    Po&amp; operator \/=(DB k){x \/= k, y \/= k; return *this;}\r\n\r\n    DB length_sqr() const{return sqr(x) + sqr(y);}\r\n    DB length() const{return sqrt(length_sqr());}\r\n    Po unit() const{return (*this) \/ length();}\r\n    bool dgt() const{return !sgn(x) &amp;&amp; !sgn(y);}\r\n    DB atan() const{return atan2(y, x);}\r\n    void input(){scanf(&quot;%lf %lf&quot;, &amp;x, &amp;y);}\r\n};\r\n\r\nbool operator ==(Po a, Po b){return sgn(a.x - b.x) == 0 &amp;&amp; sgn(a.y - b.y) == 0;}\r\nbool operator !=(Po a, Po b){return sgn(a.x - b.x) != 0 || sgn(a.y - b.y) != 0;}\r\nPo operator +(Po a, Po b){return Po(a.x + b.x, a.y + b.y);}\r\nPo operator -(Po a, Po b){return Po(a.x - b.x, a.y - b.y);}\r\nPo operator *(Po a, DB k){return Po(a.x * k, a.y * k);}\r\nPo operator *(DB k, Po a){return a * k;}\r\nPo operator \/(Po a, DB k){return Po(a.x \/ k, a.y \/ k);}\r\n\r\n\r\nstruct Line{\r\n    Po a, b;\r\n    Line(const Po &amp;a = Po(), const Po &amp;b = Po()):a(a), b(b){}\r\n    Line(const Line &amp;l):a(l.a), b(l.b){}\r\n    Line(DB x0, DB y0, DB x1, DB y1):a(Po(x0, y0)), b(Po(x1, y1)){}\r\n\r\n    void getequation(DB, DB, DB) const;\r\n\r\n    Line operator +(Po x) const{return Line(a + x, b + x);}\r\n    friend ostream&amp; operator &lt;&lt;(ostream&amp; out, Line p){return out &lt;&lt; p.a &lt;&lt; &quot;-&quot; &lt;&lt; p.b;}\r\n    DB length() const{return (b - a).length();}\r\n    bool dgt() const{return (a-b).dgt();}\r\n    void input(){a.input(), b.input();}\r\n};\r\n\r\n\r\nstruct Seg: Line{\r\n    Seg(const Po &amp;a = Po(), const Po &amp;b = Po()):Line(a, b){}\r\n    Seg(const Line &amp;l):Line(l){}\r\n    Seg(DB x0, DB y0, DB x1, DB y1):Line(x0, y0, x1, y1){}\r\n};\r\n\r\n#define innerProduct dot\r\n#define scalarProduct dot\r\n#define dotProduct dot\r\n#define outerProduct det\r\n#define crossProduct det\r\n\r\ninline DB dot(const DB &amp;x1, const DB &amp;y1, const DB &amp;x2, const DB &amp;y2){return x1 * x2 + y1 * y2;}\r\ninline DB dot(const Po &amp;a, const Po &amp;b){return dot(a.x, a.y, b.x, b.y);}\r\ninline DB dot(const Po &amp;p0, const Po &amp;p1, const Po &amp;p2){return dot(p1 - p0, p2 - p0);}\r\ninline DB dot(const Po &amp;o, const Line &amp;l){return dot(o, l.a, l.b);}\r\ninline DB dot(const Line &amp;l, const Po &amp;o){return dot(o, l.a, l.b);}\r\ninline DB dot(const Line &amp;l1, const Line &amp;l2){return dot(l1.b - l1.a, l2.b - l2.a);}\r\n\r\ninline DB det(const DB &amp;x1, const DB &amp;y1, const DB &amp;x2, const DB &amp;y2){return x1 * y2 - x2 * y1;}\r\ninline DB det(const Po &amp;a, const Po &amp;b){return det(a.x, a.y, b.x, b.y);}\r\ninline DB det(const Po &amp;p0, const Po &amp;p1, const Po &amp;p2){return det(p1 - p0, p2 - p0);}\r\ninline DB det(const Po &amp;o, const Line &amp;l){return det(o, l.a, l.b);}\r\ninline DB det(const Line &amp;l, const Po &amp;o){return det(o, l.a, l.b);}\r\ninline DB det(const Line &amp;l1, const Line &amp;l2){return det(l1.b - l1.a, l2.b - l2.a);}\r\n\r\nvoid Line::getequation(DB A, DB B, DB C) const{\r\n    A = a.y - b.y, B = b.x - a.x, C = det(a, b);\r\n}\r\n\r\ntemplate&lt;class T1, class T2&gt; inline DB dist(const T1 &amp;x, const T2 &amp;y){return sqrt(dist_sqr(x, y));}\r\ntemplate&lt;class T1, class T2, class T3&gt; inline DB dist(const T1 &amp;x, const T2 &amp;y, const T3 &amp;z){return sqrt(dist_sqr(x, y, z));}\r\ntemplate&lt;class T1, class T2&gt; inline int dett(const T1 &amp;x, const T2 &amp;y){return sgn(det(x, y));}\r\ntemplate&lt;class T1, class T2&gt; inline int dott(const T1 &amp;x, const T2 &amp;y){return sgn(dot(x, y));}\r\ntemplate&lt;class T1, class T2, class T3&gt; inline int dett(const T1 &amp;x, const T2 &amp;y, const T3 &amp;z){return sgn(det(x, y, z));}\r\ntemplate&lt;class T1, class T2, class T3&gt; inline int dott(const T1 &amp;x, const T2 &amp;y, const T3 &amp;z){return sgn(dot(x, y, z));}\r\ntemplate&lt;class T1, class T2, class T3, class T4&gt; inline int dett(const T1 &amp;x, const T2 &amp;y, const T3 &amp;z, const T4 &amp;w){return sgn(det(x, y, z, w));}\r\ntemplate&lt;class T1, class T2, class T3, class T4&gt; inline int dott(const T1 &amp;x, const T2 &amp;y, const T3 &amp;z, const T4 &amp;w){return sgn(dot(x, y, z, w));}\r\n\r\ninline DB dist_sqr(const DB &amp;x, const DB &amp;y){return sqr(x) + sqr(y);}\r\ninline DB dist_sqr(const DB &amp;x, const DB &amp;y, const DB &amp;z){return sqr(x) + sqr(y) + sqr(z);}\r\ninline DB dist_sqr(const Po &amp;a, const Po &amp;b){return sqr(a.x - b.x) + sqr(a.y - b.y);}\r\ninline DB dist_sqr(const Po &amp;p, const Line &amp;l){Po v0 = l.b - l.a, v1 = p - l.a; return sqr(fabs(det(v0, v1))) \/ v0.length_sqr();}\r\ninline DB dist_sqr(const Po &amp;p, const Seg &amp;l){\r\n    Po v0 = l.b - l.a, v1 = p - l.a, v2 = p - l.b;\r\n    if (sgn(dot(v0, v1)) * sgn(dot(v0, v2)) &lt;= 0) return dist_sqr(p, Line(l));\r\n    else return min(v1.length_sqr(), v2.length_sqr());\r\n}\r\ninline DB dist_sqr(Line l, Po p){return dist_sqr(p, l);}\r\ninline DB dist_sqr(Seg l, Po p){return dist_sqr(p, l);}\r\ninline DB dist_sqr(Line l1, Line l2){\r\n    if (sgn(det(l1, l2)) != 0) return 0;\r\n    return dist_sqr(l1.a, l2);\r\n}\r\ninline DB dist_sqr(Line l1, Seg l2){\r\n    Po v0 = l1.b - l1.a, v1 = l2.a - l1.a, v2 = l2.b - l1.a; DB c1 = det(v0, v1), c2 = det(v0, v2);\r\n    return sgn(c1) != sgn(c2) ? 0 : sqr(min(fabs(c1), fabs(c2))) \/ v0.length_sqr();\r\n}\r\n\r\nbool isIntersect(Seg l1, Seg l2){\r\n\r\n    if (l1.a == l2.a || l1.a == l2.b || l1.b == l2.a || l1.b == l2.b) return true;\r\n\r\n    return\r\n        min(l1.a.x, l1.b.x) &lt;= max(l2.a.x, l2.b.x) &amp;&amp;\r\n        min(l2.a.x, l2.b.x) &lt;= max(l1.a.x, l1.b.x) &amp;&amp;\r\n        min(l1.a.y, l1.b.y) &lt;= max(l2.a.y, l2.b.y) &amp;&amp;\r\n        min(l2.a.y, l2.b.y) &lt;= max(l1.a.y, l1.b.y) &amp;&amp;\r\n    sgn( det(l1.a, l2.a, l2.b) ) * sgn( det(l1.b, l2.a, l2.b) ) &lt;= 0 &amp;&amp;\r\n    sgn( det(l2.a, l1.a, l1.b) ) * sgn( det(l2.b, l1.a, l1.b) ) &lt;= 0;\r\n\r\n}\r\n\r\ninline DB dist_sqr(Seg l1, Seg l2){\r\n    if (isIntersect(l1, l2)) return 0;\r\n    else return min(dist_sqr(l1.a, l2), dist_sqr(l1.b, l2), dist_sqr(l2.a, l1), dist_sqr(l2.b, l1));\r\n}\r\n\r\ninline bool isOnSide(const Po &amp;p, const Seg &amp;l){\r\n    return p == l.a || p == l.b;\r\n}\r\n\r\ninline bool isOnSeg(const Po &amp;p, const Seg &amp;l){\r\n    return sgn(det(p, l.a, l.b)) == 0 &amp;&amp;\r\n        sgn(l.a.x, p.x) * sgn(l.b.x, p.x) &lt;= 0 &amp;&amp; sgn(l.a.y, p.y) * sgn(l.b.y, p.y) &lt;= 0;\r\n}\r\n\r\ninline bool isOnSegg(const Po &amp;p, const Seg &amp;l){\r\n    return sgn(det(p, l.a, l.b)) == 0 &amp;&amp;\r\n        sgn(l.a.x, p.x) * sgn(l.b.x, p.x) &lt; 0 &amp;&amp; sgn(l.a.y, p.y) * sgn(l.b.y, p.y) &lt; 0;\r\n}\r\n\r\ninline Po intersect(const Line &amp;l1, const Line &amp;l2){\r\n    return l1.a + (l1.b - l1.a) * (det(l2.a, l1.a, l2.b) \/ det(l2, l1));\r\n}\r\n\r\n\/\/ perpendicular foot\r\ninline Po intersect(const Po &amp; p, const Line &amp;l){\r\n    return intersect(Line(p, p + Po(l.a.y - l.b.y, l.b.x - l.a.x)), l);\r\n}\r\n\r\ninline Po rotate(Po p, DB alpha, Po o = Po()){\r\n    p.x -= o.x, p.y -= o.y;\r\n    return Po(p.x * cos(alpha) - p.y * sin(alpha), p.y * cos(alpha) + p.x * sin(alpha)) + o;\r\n}\r\n\r\n} using namespace CG;\r\n<\/pre>\n<p>\u3002\u3002\u3002\u3002\u6c42\u5782\u8db3\u7684\u5730\u65b9\u597d\u50cf\u6709\u70b9\u95ee\u9898\u3002\u3002\u3002<\/p>\n<pre class=\"brush: cpp; light: false; title: Miscellaneous; toolbar: true; notranslate\" title=\"Miscellaneous\">\r\n\/\/ &lt;&lt;= ' A. Random Event ..\r\n\r\nnamespace RNG{\r\n\/\/srand((unsigned)time(NULL));\r\ninline unsigned int rand16(){return (bool(rand()&amp;1) &lt;&lt; 15) | rand();}\r\ninline unsigned int rand32(){return (rand16() &lt;&lt; 16) | rand16();}\r\ninline ULL rand64(){return ((LL)rand32() &lt;&lt; 32) | rand32();}\r\ninline ULL random(LL l, LL r){return rand64() % (r - l) + l;}\r\nint dice(){return rand() % 6;}\r\nbool coin(){return bool(rand() % 2);}\r\n} using namespace RNG;\r\n\r\n\/\/ &lt;&lt;= ' B. Clock\r\n\r\nnamespace CLOCK{\r\nDB s0, s1, rd, k, T;\r\ninline DB getTime(){\r\n#ifdef LOCAL\r\n    return 1.0 * clock() \/ CLOCKS_PER_SEC;\r\n#else\r\n    timeval tv;\r\n    gettimeofday(&amp;tv, 0);\r\n    return tv.tv_sec + tv.tv_usec * 1e-6;\r\n#endif\r\n}\r\n\r\ninline void st0(DB _T = 0.98){T = _T, s0 = getTime();}\r\ninline void st1(DB _k = 1.618){k = _k, s1 = getTime();}\r\ninline void ed1(){rd = getTime() - s1;}\r\ninline DB elapsed(){return getTime() - s0;}\r\ninline bool safe(){return elapsed() + rd * k &lt; T;}\r\n} \/\/using namespace CLOCK;\r\n\r\n\/\/ &lt;&lt;= ' C. Temp .. .\r\n\r\ntemplate&lt;class T&gt; PTT operator+(const PTT &amp;p1, const PTT &amp;p2) {\r\n\treturn PTT(p1.fi + p2.fi, p1.se + p2.se);\r\n}\r\n\r\ntemplate&lt;class T&gt; PTT operator-(const PTT &amp;p1, const PTT &amp;p2) {\r\n\treturn PTT(p1.fi - p2.fi, p1.se - p2.se);\r\n}\r\n\r\ntemplate&lt;class T&gt; PTT operator*(const PTT &amp;lhs, T k){\r\n    return PTT(lhs.fi * k, lhs.se * k);\r\n}\r\n\r\n\/\/ &lt;&lt;= ' 0. I\/O Accelerator interface .,\r\n\r\ntemplate&lt;class T&gt; inline T&amp; 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(); '0' &lt;= c &amp;&amp; c &lt;= '9'; 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    return x;\r\n}\r\n\r\nint ____Case; template&lt;class T&gt; inline void OT(const T &amp;x){\r\n    \/\/if (x == -1) printf(&quot;Case %d: NO\\n&quot;, ++____Case);\r\n    \/\/else printf(&quot;Case %d: %d\\n&quot;, ++____Case, x);\r\n    \/\/printf(&quot;%I64d\\n&quot;, x);\r\n    \/\/printf(&quot;%.2lf\\n&quot;, x);\r\n    printf(&quot;%d\\n&quot;, x);\r\n    \/\/cout &lt;&lt; x &lt;&lt; endl;\r\n}\r\n\r\n\/* .................................................................................................................................. *\/\r\n\r\nconst int N = 100009;\r\n\r\nint n;\r\n\r\nint main(){\r\n\r\n#ifndef ONLINE_JUDGE\r\n    \/\/freopen(&quot;in.txt&quot;, &quot;r&quot;, stdin);\r\n#endif\r\n\r\n    while (scanf(&quot;%d&quot;, &amp;n) != EOF){\r\n    }\r\n}\r\n<\/pre>\n<p>\u3002\u3002\u3002\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3002\u3002 \u3002\u3002\u201c Micro Mezzo Macro Flation &#8212; Overheated Economy \u201d\u3002\u3002\uff08\u4ee5\u4e0b\u7b80\u79f0 \u201c \u8fc7\u70ed\u7ecf\u6d4e \u201d \u3002\u3002\u3002\u3002 \u3002\u662f\u6211\u73b0\u5728\u5404\u5927 OJ \u4ea4\u9898\u662f\u7c98\u7684\u5934\u6587\u4ef6\u3002\u3002\u3002\u3002\u6700\u65e9\u5927\u6982\u662f\u6211\u53bb\u5e74\u770b\u5230\u4e86 ACRush \u7684\u5934\u6587\u4ef6\u4ee5\u540e\u5927\u4e3a\u60ca\u8bb6\u3002\u3002\u53c2\u8003\u4ee5\u540e\u9010\u6e10\u4fee\u8ba2\u5f62\u6210\u7684\u3002\u3002 \u3002\u6700\u8fd1\u53d1\u73b0\u5c45\u7136\u6709\u9664\u6211\u4e4b\u5916\u7684\u540c\u5b66\u4e5f\u5728\u4f7f\u7528\u8fd9\u4efd\u6a21\u677f\u3002\u3002\uff08\u3002\u4f46\u662f\u4f7f\u7528\u7684\u662f\u51e0\u4e2a\u6708\u524d\u7684\u8fc7\u65f6\u7248\u672c\u3002\u3002\u3002\u3002\u3002 \u3002\u3002\u3002\u3002\u53e6\u5916\u8003\u8651\u8fd9\u4efd\u6a21\u677f\u4e2a\u4eba\u5411\u4e25\u91cd\u3002\u3002\u8fd9\u91cc\u505a\u4e00\u70b9\u8bb0\u5f55\u3002\u3002 Name: Micro Mezzo Macro Flation &#8212; Overheated Economy Usage: Put it before main function .. . Tags: \u5e38\u7528\u8bed\u5757\u3001\u53d8\u91cf\u9690\u85cf\u3001\u5c40\u90e8 define\u3001\u53ef\u7ec4\u88c5\u3002\u3002\u3002 Module: 0. \u65e5\u5e38\u6a21\u5757 1. \u4f4d\u8fd0\u7b97\u6a21\u5757\uff08BO\uff09 2. \u6570\u8bba\u6a21\u5757\uff08NT\uff09 9. \u8ba1\u7b97\u51e0\u4f55\u6a21\u5757\uff08CG\uff09 .. . \u3002\u3002 \u3002A. \u968f\u673a\u53d1\u751f\u5668 (RNG) [&hellip;]<\/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":[1],"tags":[],"class_list":["post-574","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2tdP7-9g","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/574","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=574"}],"version-history":[{"count":1,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/574\/revisions"}],"predecessor-version":[{"id":575,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/574\/revisions\/575"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/media?parent=574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/categories?post=574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/tags?post=574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}