Hex Artifact Content
Not logged in

Artifact 3aabd385e4b10b4a14a416f01a477aa280d34f7d:


0000: 23 69 6e 63 6c 75 64 65 20 3c 69 6f 73 74 72 65  #include <iostre
0010: 61 6d 3e 0d 0a 23 69 6e 63 6c 75 64 65 20 3c 73  am>..#include <s
0020: 73 74 72 65 61 6d 3e 0d 0a 23 69 6e 63 6c 75 64  stream>..#includ
0030: 65 20 3c 69 6f 6d 61 6e 69 70 3e 0d 0a 23 69 6e  e <iomanip>..#in
0040: 63 6c 75 64 65 20 3c 76 65 63 74 6f 72 3e 0d 0a  clude <vector>..
0050: 23 69 6e 63 6c 75 64 65 20 3c 73 74 72 69 6e 67  #include <string
0060: 3e 0d 0a 23 69 6e 63 6c 75 64 65 20 3c 6d 61 70  >..#include <map
0070: 3e 0d 0a 23 69 6e 63 6c 75 64 65 20 3c 73 65 74  >..#include <set
0080: 3e 0d 0a 23 69 6e 63 6c 75 64 65 20 3c 61 6c 67  >..#include <alg
0090: 6f 72 69 74 68 6d 3e 0d 0a 23 69 6e 63 6c 75 64  orithm>..#includ
00a0: 65 20 3c 6e 75 6d 65 72 69 63 3e 0d 0a 23 69 6e  e <numeric>..#in
00b0: 63 6c 75 64 65 20 3c 69 74 65 72 61 74 6f 72 3e  clude <iterator>
00c0: 0d 0a 23 69 6e 63 6c 75 64 65 20 3c 66 75 6e 63  ..#include <func
00d0: 74 69 6f 6e 61 6c 3e 0d 0a 23 69 6e 63 6c 75 64  tional>..#includ
00e0: 65 20 3c 63 6f 6d 70 6c 65 78 3e 0d 0a 23 69 6e  e <complex>..#in
00f0: 63 6c 75 64 65 20 3c 71 75 65 75 65 3e 0d 0a 23  clude <queue>..#
0100: 69 6e 63 6c 75 64 65 20 3c 73 74 61 63 6b 3e 0d  include <stack>.
0110: 0a 23 69 6e 63 6c 75 64 65 20 3c 63 6d 61 74 68  .#include <cmath
0120: 3e 0d 0a 23 69 6e 63 6c 75 64 65 20 3c 63 61 73  >..#include <cas
0130: 73 65 72 74 3e 0d 0a 23 69 6e 63 6c 75 64 65 20  sert>..#include 
0140: 3c 63 73 74 72 69 6e 67 3e 0d 0a 75 73 69 6e 67  <cstring>..using
0150: 20 6e 61 6d 65 73 70 61 63 65 20 73 74 64 3b 0d   namespace std;.
0160: 0a 74 79 70 65 64 65 66 20 6c 6f 6e 67 20 6c 6f  .typedef long lo
0170: 6e 67 20 4c 4c 3b 0d 0a 74 79 70 65 64 65 66 20  ng LL;..typedef 
0180: 63 6f 6d 70 6c 65 78 3c 64 6f 75 62 6c 65 3e 20  complex<double> 
0190: 43 4d 50 3b 0d 0a 0d 0a 63 6c 61 73 73 20 55 6e  CMP;....class Un
01a0: 66 6f 6c 64 69 6e 67 54 72 69 61 6e 67 6c 65 73  foldingTriangles
01b0: 20 7b 20 70 75 62 6c 69 63 3a 0d 0a 09 69 6e 74   { public:...int
01c0: 20 73 6f 6c 76 65 28 76 65 63 74 6f 72 20 3c 73   solve(vector <s
01d0: 74 72 69 6e 67 3e 20 67 72 69 64 2c 20 69 6e 74  tring> grid, int
01e0: 20 75 6e 66 6f 6c 64 4c 69 6d 69 74 29 20 0d 0a   unfoldLimit) ..
01f0: 09 7b 0d 0a 09 09 69 6e 74 20 58 20 3d 20 67 72  .{....int X = gr
0200: 69 64 5b 30 5d 2e 73 69 7a 65 28 29 3b 0d 0a 09  id[0].size();...
0210: 09 69 6e 74 20 59 20 3d 20 67 72 69 64 2e 73 69  .int Y = grid.si
0220: 7a 65 28 29 3b 0d 0a 0d 0a 09 09 69 6e 74 20 4d  ze();......int M
0230: 61 78 20 3d 20 2d 31 3b 0d 0a 09 09 2f 2f 20 74  ax = -1;....// t
0240: 6f 70 2d 72 69 67 68 74 0d 0a 09 09 66 6f 72 28  op-right....for(
0250: 69 6e 74 20 79 3d 30 3b 20 79 3c 59 3b 20 2b 2b  int y=0; y<Y; ++
0260: 79 29 0d 0a 09 09 09 66 6f 72 28 69 6e 74 20 78  y).....for(int x
0270: 3d 58 3b 20 78 3e 3d 31 3b 20 2d 2d 78 29 0d 0a  =X; x>=1; --x)..
0280: 09 09 09 7b 0d 0a 09 09 09 09 69 6e 74 20 6e 75  ...{......int nu
0290: 6d 54 72 69 20 3d 20 30 3b 0d 0a 09 09 09 09 2f  mTri = 0;....../
02a0: 2f 20 73 69 7a 65 0d 0a 09 09 09 09 66 6f 72 28  / size......for(
02b0: 69 6e 74 20 6e 3d 31 3b 20 78 2d 6e 3e 3d 30 20  int n=1; x-n>=0 
02c0: 26 26 20 79 2b 6e 3c 3d 59 3b 20 2b 2b 6e 29 0d  && y+n<=Y; ++n).
02d0: 0a 09 09 09 09 7b 0d 0a 09 09 09 09 09 2f 2f 20  .....{.......// 
02e0: 72 69 67 68 74 2d 63 68 65 63 6b 0d 0a 09 09 09  right-check.....
02f0: 09 09 69 66 28 20 78 3c 58 20 26 26 20 67 72 69  ..if( x<X && gri
0300: 64 5b 79 2b 6e 2d 31 5d 5b 78 5d 3d 3d 27 23 27  d[y+n-1][x]=='#'
0310: 20 29 0d 0a 09 09 09 09 09 09 67 6f 74 6f 20 4e   )........goto N
0320: 65 78 74 54 6f 70 52 69 67 68 74 3b 0d 0a 09 09  extTopRight;....
0330: 09 09 09 2f 2f 20 64 69 61 67 2d 63 68 65 63 6b  ...// diag-check
0340: 0d 0a 09 09 09 09 09 69 66 28 20 67 72 69 64 5b  .......if( grid[
0350: 79 2b 6e 2d 31 5d 5b 78 2d 6e 5d 21 3d 27 2f 27  y+n-1][x-n]!='/'
0360: 20 29 0d 0a 09 09 09 09 09 09 67 6f 74 6f 20 4e   )........goto N
0370: 65 78 74 54 6f 70 52 69 67 68 74 3b 0d 0a 09 09  extTopRight;....
0380: 09 09 09 2f 2f 20 69 6e 6e 65 72 2d 63 68 65 63  ...// inner-chec
0390: 6b 0d 0a 09 09 09 09 09 66 6f 72 28 69 6e 74 20  k.......for(int 
03a0: 6b 3d 31 3b 20 6b 3c 6e 3b 20 2b 2b 6b 29 20 7b  k=1; k<n; ++k) {
03b0: 0d 0a 09 09 09 09 09 09 69 66 28 20 67 72 69 64  ........if( grid
03c0: 5b 79 2b 6e 2d 31 5d 5b 78 2d 6b 5d 20 3d 3d 20  [y+n-1][x-k] == 
03d0: 27 2e 27 20 29 0d 0a 09 09 09 09 09 09 09 67 6f  '.' ).........go
03e0: 74 6f 20 4e 65 78 74 54 6f 70 52 69 67 68 74 3b  to NextTopRight;
03f0: 0d 0a 09 09 09 09 09 09 69 66 28 20 67 72 69 64  ........if( grid
0400: 5b 79 2b 6e 2d 31 5d 5b 78 2d 6b 5d 20 3d 3d 20  [y+n-1][x-k] == 
0410: 27 2f 27 20 29 0d 0a 09 09 09 09 09 09 09 69 66  '/' ).........if
0420: 28 20 2b 2b 6e 75 6d 54 72 69 20 3e 20 75 6e 66  ( ++numTri > unf
0430: 6f 6c 64 4c 69 6d 69 74 20 29 0d 0a 09 09 09 09  oldLimit )......
0440: 09 09 09 09 67 6f 74 6f 20 4e 65 78 74 54 6f 70  ....goto NextTop
0450: 52 69 67 68 74 3b 0d 0a 09 09 09 09 09 7d 0d 0a  Right;.......}..
0460: 09 09 09 09 09 2f 2f 20 62 6f 74 74 6f 6d 2d 63  .....// bottom-c
0470: 68 65 63 6b 0d 0a 09 09 09 09 09 62 6f 6f 6c 20  heck.......bool 
0480: 6f 6b 20 3d 20 74 72 75 65 3b 0d 0a 09 09 09 09  ok = true;......
0490: 09 69 66 28 20 79 2b 6e 20 3d 3d 20 59 20 29 0d  .if( y+n == Y ).
04a0: 0a 09 09 09 09 09 09 6f 6b 20 3d 20 74 72 75 65  .......ok = true
04b0: 3b 0d 0a 09 09 09 09 09 65 6c 73 65 0d 0a 09 09  ;.......else....
04c0: 09 09 09 09 66 6f 72 28 69 6e 74 20 6b 3d 31 3b  ....for(int k=1;
04d0: 20 6b 3c 3d 6e 3b 20 2b 2b 6b 29 20 7b 0d 0a 09   k<=n; ++k) {...
04e0: 09 09 09 09 09 09 69 66 28 20 67 72 69 64 5b 79  ......if( grid[y
04f0: 2b 6e 5d 5b 78 2d 6b 5d 20 3d 3d 20 27 23 27 20  +n][x-k] == '#' 
0500: 29 0d 0a 09 09 09 09 09 09 09 09 7b 6f 6b 3d 66  )..........{ok=f
0510: 61 6c 73 65 3b 20 62 72 65 61 6b 3b 7d 0d 0a 09  alse; break;}...
0520: 09 09 09 09 09 7d 0d 0a 0d 0a 09 09 09 09 09 2f  .....}........./
0530: 2f 20 75 70 64 61 74 65 0d 0a 09 09 09 09 09 69  / update.......i
0540: 66 28 20 6f 6b 20 29 0d 0a 09 09 09 09 09 09 4d  f( ok )........M
0550: 61 78 20 3d 20 6d 61 78 28 20 4d 61 78 2c 20 6e  ax = max( Max, n
0560: 2a 28 6e 2b 31 29 2f 32 20 29 3b 0d 0a 09 09 09  *(n+1)/2 );.....
0570: 09 7d 0d 0a 09 09 09 4e 65 78 74 54 6f 70 52 69  .}.....NextTopRi
0580: 67 68 74 3a 3b 0d 0a 09 09 09 7d 0d 0a 0d 0a 09  ght:;.....}.....
0590: 09 72 65 74 75 72 6e 20 4d 61 78 3b 0d 0a 09 7d  .return Max;...}
05a0: 0d 0a 7d 3b 0d 0a 0d 0a 2f 2f 20 42 45 47 49 4e  ..};....// BEGIN
05b0: 20 43 55 54 20 48 45 52 45 0d 0a 23 69 6e 63 6c   CUT HERE..#incl
05c0: 75 64 65 20 3c 63 74 69 6d 65 3e 0d 0a 64 6f 75  ude <ctime>..dou
05d0: 62 6c 65 20 73 74 61 72 74 5f 74 69 6d 65 3b 20  ble start_time; 
05e0: 73 74 72 69 6e 67 20 74 69 6d 65 72 28 29 0d 0a  string timer()..
05f0: 20 7b 20 6f 73 74 72 69 6e 67 73 74 72 65 61 6d   { ostringstream
0600: 20 6f 73 3b 20 6f 73 20 3c 3c 20 22 20 28 22 20   os; os << " (" 
0610: 3c 3c 20 69 6e 74 28 28 63 6c 6f 63 6b 28 29 2d  << int((clock()-
0620: 73 74 61 72 74 5f 74 69 6d 65 29 2f 43 4c 4f 43  start_time)/CLOC
0630: 4b 53 5f 50 45 52 5f 53 45 43 2a 31 30 30 30 29  KS_PER_SEC*1000)
0640: 20 3c 3c 20 22 20 6d 73 65 63 29 22 3b 20 72 65   << " msec)"; re
0650: 74 75 72 6e 20 6f 73 2e 73 74 72 28 29 3b 20 7d  turn os.str(); }
0660: 0d 0a 74 65 6d 70 6c 61 74 65 3c 74 79 70 65 6e  ..template<typen
0670: 61 6d 65 20 54 3e 20 6f 73 74 72 65 61 6d 26 20  ame T> ostream& 
0680: 6f 70 65 72 61 74 6f 72 3c 3c 28 6f 73 74 72 65  operator<<(ostre
0690: 61 6d 26 20 6f 73 2c 20 63 6f 6e 73 74 20 76 65  am& os, const ve
06a0: 63 74 6f 72 3c 54 3e 26 20 76 29 0d 0a 20 7b 20  ctor<T>& v).. { 
06b0: 6f 73 20 3c 3c 20 22 7b 20 22 3b 0d 0a 20 20 20  os << "{ ";..   
06c0: 66 6f 72 28 74 79 70 65 6e 61 6d 65 20 76 65 63  for(typename vec
06d0: 74 6f 72 3c 54 3e 3a 3a 63 6f 6e 73 74 5f 69 74  tor<T>::const_it
06e0: 65 72 61 74 6f 72 20 69 74 3d 76 2e 62 65 67 69  erator it=v.begi
06f0: 6e 28 29 3b 20 69 74 21 3d 76 2e 65 6e 64 28 29  n(); it!=v.end()
0700: 3b 20 2b 2b 69 74 29 0d 0a 20 20 20 6f 73 20 3c  ; ++it)..   os <
0710: 3c 20 27 5c 22 27 20 3c 3c 20 2a 69 74 20 3c 3c  < '\"' << *it <<
0720: 20 27 5c 22 27 20 3c 3c 20 28 69 74 2b 31 3d 3d   '\"' << (it+1==
0730: 76 2e 65 6e 64 28 29 20 3f 20 22 22 20 3a 20 22  v.end() ? "" : "
0740: 2c 20 22 29 3b 20 6f 73 20 3c 3c 20 22 20 7d 22  , "); os << " }"
0750: 3b 20 72 65 74 75 72 6e 20 6f 73 3b 20 7d 0d 0a  ; return os; }..
0760: 76 6f 69 64 20 76 65 72 69 66 79 5f 63 61 73 65  void verify_case
0770: 28 63 6f 6e 73 74 20 69 6e 74 26 20 45 78 70 65  (const int& Expe
0780: 63 74 65 64 2c 20 63 6f 6e 73 74 20 69 6e 74 26  cted, const int&
0790: 20 52 65 63 65 69 76 65 64 29 20 7b 0d 0a 20 62   Received) {.. b
07a0: 6f 6f 6c 20 6f 6b 20 3d 20 28 45 78 70 65 63 74  ool ok = (Expect
07b0: 65 64 20 3d 3d 20 52 65 63 65 69 76 65 64 29 3b  ed == Received);
07c0: 0d 0a 20 69 66 28 6f 6b 29 20 63 65 72 72 20 3c  .. if(ok) cerr <
07d0: 3c 20 22 50 41 53 53 45 44 22 20 3c 3c 20 74 69  < "PASSED" << ti
07e0: 6d 65 72 28 29 20 3c 3c 20 65 6e 64 6c 3b 20 20  mer() << endl;  
07f0: 65 6c 73 65 20 7b 20 63 65 72 72 20 3c 3c 20 22  else { cerr << "
0800: 46 41 49 4c 45 44 22 20 3c 3c 20 74 69 6d 65 72  FAILED" << timer
0810: 28 29 20 3c 3c 20 65 6e 64 6c 3b 0d 0a 20 63 65  () << endl;.. ce
0820: 72 72 20 3c 3c 20 22 5c 74 6f 3a 20 5c 22 22 20  rr << "\to: \"" 
0830: 3c 3c 20 45 78 70 65 63 74 65 64 20 3c 3c 20 27  << Expected << '
0840: 5c 22 27 20 3c 3c 20 65 6e 64 6c 20 3c 3c 20 22  \"' << endl << "
0850: 5c 74 78 3a 20 5c 22 22 20 3c 3c 20 52 65 63 65  \tx: \"" << Rece
0860: 69 76 65 64 20 3c 3c 20 27 5c 22 27 20 3c 3c 20  ived << '\"' << 
0870: 65 6e 64 6c 3b 20 7d 20 7d 0d 0a 23 64 65 66 69  endl; } }..#defi
0880: 6e 65 20 43 41 53 45 28 4e 29 20 7b 63 65 72 72  ne CASE(N) {cerr
0890: 20 3c 3c 20 22 54 65 73 74 20 43 61 73 65 20 23   << "Test Case #
08a0: 22 20 3c 3c 20 4e 20 3c 3c 20 22 2e 2e 2e 22 20  " << N << "..." 
08b0: 3c 3c 20 66 6c 75 73 68 3b 20 73 74 61 72 74 5f  << flush; start_
08c0: 74 69 6d 65 3d 63 6c 6f 63 6b 28 29 3b 0d 0a 23  time=clock();..#
08d0: 64 65 66 69 6e 65 20 45 4e 44 09 20 76 65 72 69  define END. veri
08e0: 66 79 5f 63 61 73 65 28 5f 2c 20 55 6e 66 6f 6c  fy_case(_, Unfol
08f0: 64 69 6e 67 54 72 69 61 6e 67 6c 65 73 28 29 2e  dingTriangles().
0900: 73 6f 6c 76 65 28 67 72 69 64 2c 20 75 6e 66 6f  solve(grid, unfo
0910: 6c 64 4c 69 6d 69 74 29 29 3b 7d 0d 0a 69 6e 74  ldLimit));}..int
0920: 20 6d 61 69 6e 28 29 7b 0d 0a 0d 0a 43 41 53 45   main(){....CASE
0930: 28 30 29 0d 0a 09 73 74 72 69 6e 67 20 67 72 69  (0)...string gri
0940: 64 5f 5b 5d 20 3d 20 7b 22 2e 2e 2e 2f 22 2c 0d  d_[] = {".../",.
0950: 0a 20 22 2e 2e 2f 23 22 2c 0d 0a 20 22 2e 2f 23  . "../#",.. "./#
0960: 2f 22 2c 0d 0a 20 22 2f 23 2f 2f 22 7d 3b 0d 0a  /",.. "/#//"};..
0970: 09 20 20 76 65 63 74 6f 72 20 3c 73 74 72 69 6e  .  vector <strin
0980: 67 3e 20 67 72 69 64 28 67 72 69 64 5f 2c 20 67  g> grid(grid_, g
0990: 72 69 64 5f 2b 73 69 7a 65 6f 66 28 67 72 69 64  rid_+sizeof(grid
09a0: 5f 29 2f 73 69 7a 65 6f 66 28 2a 67 72 69 64 5f  _)/sizeof(*grid_
09b0: 29 29 3b 20 0d 0a 09 69 6e 74 20 75 6e 66 6f 6c  )); ...int unfol
09c0: 64 4c 69 6d 69 74 20 3d 20 34 3b 20 0d 0a 09 69  dLimit = 4; ...i
09d0: 6e 74 20 5f 20 3d 20 31 30 3b 20 0d 0a 45 4e 44  nt _ = 10; ..END
09e0: 0d 0a 43 41 53 45 28 31 29 0d 0a 09 73 74 72 69  ..CASE(1)...stri
09f0: 6e 67 20 67 72 69 64 5f 5b 5d 20 3d 20 7b 22 2e  ng grid_[] = {".
0a00: 2e 2e 2f 22 2c 0d 0a 20 22 2e 2e 2f 23 22 2c 0d  ../",.. "../#",.
0a10: 0a 20 22 2e 2f 23 2f 22 2c 0d 0a 20 22 2f 23 2f  . "./#/",.. "/#/
0a20: 2f 22 7d 3b 0d 0a 09 20 20 76 65 63 74 6f 72 20  /"};...  vector 
0a30: 3c 73 74 72 69 6e 67 3e 20 67 72 69 64 28 67 72  <string> grid(gr
0a40: 69 64 5f 2c 20 67 72 69 64 5f 2b 73 69 7a 65 6f  id_, grid_+sizeo
0a50: 66 28 67 72 69 64 5f 29 2f 73 69 7a 65 6f 66 28  f(grid_)/sizeof(
0a60: 2a 67 72 69 64 5f 29 29 3b 20 0d 0a 09 69 6e 74  *grid_)); ...int
0a70: 20 75 6e 66 6f 6c 64 4c 69 6d 69 74 20 3d 20 32   unfoldLimit = 2
0a80: 3b 20 0d 0a 09 69 6e 74 20 5f 20 3d 20 33 3b 20  ; ...int _ = 3; 
0a90: 0d 0a 45 4e 44 0d 0a 43 41 53 45 28 32 29 0d 0a  ..END..CASE(2)..
0aa0: 09 73 74 72 69 6e 67 20 67 72 69 64 5f 5b 5d 20  .string grid_[] 
0ab0: 3d 20 7b 22 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f  = {"////",.. "//
0ac0: 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 22 2c 0d 0a  //",.. "////",..
0ad0: 20 22 2f 2f 2f 2f 22 7d 3b 0d 0a 09 20 20 76 65   "////"};...  ve
0ae0: 63 74 6f 72 20 3c 73 74 72 69 6e 67 3e 20 67 72  ctor <string> gr
0af0: 69 64 28 67 72 69 64 5f 2c 20 67 72 69 64 5f 2b  id(grid_, grid_+
0b00: 73 69 7a 65 6f 66 28 67 72 69 64 5f 29 2f 73 69  sizeof(grid_)/si
0b10: 7a 65 6f 66 28 2a 67 72 69 64 5f 29 29 3b 20 0d  zeof(*grid_)); .
0b20: 0a 09 69 6e 74 20 75 6e 66 6f 6c 64 4c 69 6d 69  ..int unfoldLimi
0b30: 74 20 3d 20 35 3b 20 0d 0a 09 69 6e 74 20 5f 20  t = 5; ...int _ 
0b40: 3d 20 36 3b 20 0d 0a 45 4e 44 0d 0a 43 41 53 45  = 6; ..END..CASE
0b50: 28 33 29 0d 0a 09 73 74 72 69 6e 67 20 67 72 69  (3)...string gri
0b60: 64 5f 5b 5d 20 3d 20 7b 22 2e 2e 2e 2e 2e 23 2e  d_[] = {".....#.
0b70: 2e 2e 22 2c 0d 0a 20 22 2e 2e 2e 2e 23 23 23 2e  ..",.. "....###.
0b80: 2e 22 7d 3b 0d 0a 09 20 20 76 65 63 74 6f 72 20  ."};...  vector 
0b90: 3c 73 74 72 69 6e 67 3e 20 67 72 69 64 28 67 72  <string> grid(gr
0ba0: 69 64 5f 2c 20 67 72 69 64 5f 2b 73 69 7a 65 6f  id_, grid_+sizeo
0bb0: 66 28 67 72 69 64 5f 29 2f 73 69 7a 65 6f 66 28  f(grid_)/sizeof(
0bc0: 2a 67 72 69 64 5f 29 29 3b 20 0d 0a 09 69 6e 74  *grid_)); ...int
0bd0: 20 75 6e 66 6f 6c 64 4c 69 6d 69 74 20 3d 20 31   unfoldLimit = 1
0be0: 30 3b 20 0d 0a 09 69 6e 74 20 5f 20 3d 20 2d 31  0; ...int _ = -1
0bf0: 3b 20 0d 0a 45 4e 44 0d 0a 43 41 53 45 28 34 29  ; ..END..CASE(4)
0c00: 0d 0a 09 73 74 72 69 6e 67 20 67 72 69 64 5f 5b  ...string grid_[
0c10: 5d 20 3d 20 7b 22 23 2f 2f 23 22 2c 0d 0a 20 22  ] = {"#//#",.. "
0c20: 23 2f 2f 23 22 2c 0d 0a 20 22 23 23 23 23 22 2c  #//#",.. "####",
0c30: 0d 0a 20 22 2f 2f 2f 23 22 7d 3b 0d 0a 09 20 20  .. "///#"};...  
0c40: 76 65 63 74 6f 72 20 3c 73 74 72 69 6e 67 3e 20  vector <string> 
0c50: 67 72 69 64 28 67 72 69 64 5f 2c 20 67 72 69 64  grid(grid_, grid
0c60: 5f 2b 73 69 7a 65 6f 66 28 67 72 69 64 5f 29 2f  _+sizeof(grid_)/
0c70: 73 69 7a 65 6f 66 28 2a 67 72 69 64 5f 29 29 3b  sizeof(*grid_));
0c80: 20 0d 0a 09 69 6e 74 20 75 6e 66 6f 6c 64 4c 69   ...int unfoldLi
0c90: 6d 69 74 20 3d 20 34 3b 20 0d 0a 09 69 6e 74 20  mit = 4; ...int 
0ca0: 5f 20 3d 20 31 3b 20 0d 0a 45 4e 44 0d 0a 43 41  _ = 1; ..END..CA
0cb0: 53 45 28 35 29 0d 0a 09 73 74 72 69 6e 67 20 67  SE(5)...string g
0cc0: 72 69 64 5f 5b 5d 20 3d 20 7b 22 2e 2e 2e 2f 2e  rid_[] = {".../.
0cd0: 2e 2e 2f 22 2c 0d 0a 20 22 2e 2e 2f 23 2e 2e 2f  ../",.. "../#../
0ce0: 2f 22 2c 0d 0a 20 22 2e 2f 2e 23 2e 2f 2f 2f 22  /",.. "./.#.///"
0cf0: 2c 0d 0a 20 22 2f 23 23 23 2e 2e 2e 2e 22 7d 3b  ,.. "/###...."};
0d00: 0d 0a 09 20 20 76 65 63 74 6f 72 20 3c 73 74 72  ...  vector <str
0d10: 69 6e 67 3e 20 67 72 69 64 28 67 72 69 64 5f 2c  ing> grid(grid_,
0d20: 20 67 72 69 64 5f 2b 73 69 7a 65 6f 66 28 67 72   grid_+sizeof(gr
0d30: 69 64 5f 29 2f 73 69 7a 65 6f 66 28 2a 67 72 69  id_)/sizeof(*gri
0d40: 64 5f 29 29 3b 20 0d 0a 09 69 6e 74 20 75 6e 66  d_)); ...int unf
0d50: 6f 6c 64 4c 69 6d 69 74 20 3d 20 33 3b 20 0d 0a  oldLimit = 3; ..
0d60: 09 69 6e 74 20 5f 20 3d 20 36 3b 20 0d 0a 45 4e  .int _ = 6; ..EN
0d70: 44 0d 0a 43 41 53 45 28 36 29 0d 0a 09 73 74 72  D..CASE(6)...str
0d80: 69 6e 67 20 67 72 69 64 5f 5b 5d 20 3d 20 7b 0d  ing grid_[] = {.
0d90: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
0da0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0db0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0dc0: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
0dd0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0de0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0df0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
0e00: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
0e10: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0e20: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0e30: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
0e40: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0e50: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0e60: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
0e70: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
0e80: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0e90: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0ea0: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
0eb0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0ec0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0ed0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
0ee0: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
0ef0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0f00: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0f10: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
0f20: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0f30: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0f40: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
0f50: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
0f60: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0f70: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0f80: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
0f90: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0fa0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0fb0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
0fc0: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
0fd0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0fe0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
0ff0: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
1000: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1010: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1020: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
1030: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
1040: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1050: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1060: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
1070: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1080: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1090: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
10a0: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
10b0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
10c0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
10d0: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
10e0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
10f0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1100: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
1110: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
1120: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1130: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1140: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
1150: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1160: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1170: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
1180: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
1190: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
11a0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
11b0: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
11c0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
11d0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
11e0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
11f0: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
1200: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1210: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1220: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
1230: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1240: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1250: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
1260: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
1270: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1280: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1290: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
12a0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
12b0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
12c0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
12d0: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
12e0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
12f0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1300: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
1310: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1320: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1330: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
1340: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
1350: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1360: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1370: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
1380: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1390: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
13a0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
13b0: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
13c0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
13d0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
13e0: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
13f0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1400: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1410: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
1420: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
1430: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1440: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1450: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
1460: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1470: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1480: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
1490: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
14a0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
14b0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
14c0: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
14d0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
14e0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
14f0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
1500: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
1510: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1520: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1530: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
1540: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1550: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1560: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
1570: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
1580: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1590: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
15a0: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
15b0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
15c0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
15d0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
15e0: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
15f0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1600: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1610: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
1620: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1630: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1640: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
1650: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
1660: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1670: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1680: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
1690: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
16a0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
16b0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
16c0: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
16d0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
16e0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
16f0: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
1700: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1710: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1720: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
1730: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
1740: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1750: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1760: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
1770: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1780: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1790: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
17a0: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
17b0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
17c0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
17d0: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
17e0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
17f0: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1800: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
1810: 0a 20 22 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  . "/////////////
1820: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1830: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1840: 2f 2f 2f 2f 2f 22 2c 0d 0a 20 22 2f 2f 2f 2f 2f  /////",.. "/////
1850: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1860: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f  ////////////////
1870: 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 22 2c 0d  /////////////",.
1880: 0a 20 7d 3b 0d 0a 09 20 20 76 65 63 74 6f 72 20  . };...  vector 
1890: 3c 73 74 72 69 6e 67 3e 20 67 72 69 64 28 67 72  <string> grid(gr
18a0: 69 64 5f 2c 20 67 72 69 64 5f 2b 73 69 7a 65 6f  id_, grid_+sizeo
18b0: 66 28 67 72 69 64 5f 29 2f 73 69 7a 65 6f 66 28  f(grid_)/sizeof(
18c0: 2a 67 72 69 64 5f 29 29 3b 20 0d 0a 09 69 6e 74  *grid_)); ...int
18d0: 20 75 6e 66 6f 6c 64 4c 69 6d 69 74 20 3d 20 32   unfoldLimit = 2
18e0: 35 30 30 3b 20 0d 0a 09 69 6e 74 20 5f 20 3d 20  500; ...int _ = 
18f0: 36 3b 20 0d 0a 45 4e 44 0d 0a 0d 0a 7d 0d 0a 2f  6; ..END....}../
1900: 2f 20 45 4e 44 20 43 55 54 20 48 45 52 45 0d 0a  / END CUT HERE..