确切的封面难题


10

挑战

给定一组分组的字母,将它们排列在板上,以便它们完全覆盖该区域。

董事会代表(又名船舶甲板)

  • 该板是一个6x6的网格。
  • 总会有36个正方形。
  • 列标记为AF。
  • 行标记为1-6。

例:

    A   B   C   D   E   F
  +---+---+---+---+---+---+
1 :   :   :   :   :   :   :
  +---+---+---+---+---+---+
2 :   :   :   :   :   :   :
  +---+---+---+---+---+---+
3 :   :   :   :   :   :   :
  +---+---+---+---+---+---+
4 :   :   :   :   :   :   :
  +---+---+---+---+---+---+
5 :   :   :   :   :   :   :
  +---+---+---+---+---+---+
6 :   :   :   :   :   :   :
  +---+---+---+---+---+---+

输入(又称板条箱)

  • 多行字符串,其中包含一组分组的字母。
  • 板条箱由相同字母组成的组组成。
  • 板条箱是不可变的,这意味着它们无法旋转或翻转。
  • 每个板条箱的起点在左上角(将板条箱移到甲板上时应考虑在内)。
  • 从板条箱的左上角开始,以下相同的方块只能在右侧或下方。
  • 任何字母都可以用来代表板条箱。板条箱始终以字母开头[a],然后以字母上移。
  • 板条箱用字母标记(例如板条箱A,板条箱B等)
  • 板条箱的数量可以变化(尽管给出了示例,但并不总是10个)。
  • 每行有24个字符分隔每个包装箱。([a]的开始到[b]的开始,以24个字符分隔,等等。)

例:

[a][a][a]               [b]                     [c][c]               
      [a]               [b][b][b]                  [c]               
      [a]               [b][b]                                       

[d]                     [e]                     [f][f][f][f][f]      
[d][d]                  [e]                                          
[d][d]                  [e]                                          
                        [e]                                          
                        [e][e]                                       

[g]                     [h]                     [i]                  
[g]                                             [i]                  
                                                [i]                  

输出值

要求您打印出一系列将板条箱放置在甲板上的位置的命令,以使板条被完全覆盖(没有空白)。

命令格式如下:

HAUL <crate> TO <column> <row>

即向A传送1

为了澄清起见,对于给定的输入将始终有解决方案。

测试案例 <-单击更多。

输入值

[a][a][a]               [b]                     [c][c][c]            
   [a][a]               [b]                                          
   [a]                  [b][b]                                       
                        [b][b]                                       

[d]                     [e]                     [f]                  
[d]                                             [f]                  
[d]                                             [f]                  
[d]                                                                  
[d]                                                                  

[g][g]                  [h]                     [i]                  
                                                [i][i]               
                                                   [i]               
                                                   [i][i]            

[j][j][j]                                                            

输出量

HAUL I TO A 1
HAUL B TO A 3
HAUL A TO B 1
HAUL J TO D 6
HAUL D TO F 1
HAUL F TO E 1
HAUL C TO C 5
HAUL G TO D 4
HAUL E TO D 3
HAUL H TO C 6

结果:

    A   B   C   D   E   F
  +---+---+---+---+---+---+
1 : i : a : a : a : f : d :
  +---+---+---+---+---+---+
2 : i : i : a : a : f : d :
  +---+---+---+---+---+---+
3 : b : i : a : e : f : d :
  +---+---+---+---+---+---+
4 : b : i : i : g : g : d :
  +---+---+---+---+---+---+
5 : b : b : c : c : c : d :
  +---+---+---+---+---+---+
6 : b : b : h : j : j : j :
  +---+---+---+---+---+---+

评分

这是所以最短的答案以字符为准。


可以假设没有一个板条箱会没有孔吗?
乔纳森·弗雷希

我认为最多可以有26个板条箱?
乔纳森·弗雷希

板条箱布局括号被输入的不必要的部分,在这个意义上,可以输入没有它们更清楚,并且布局乏味解析。照原样,在有关实际问题解决阶段的答案中,解析阶段可能是主要的。但这毕竟是您的挑战,因此我们需要遵守您的规则
edc65

Answers:


5

蟒3.6,435个 437 385 331字节

F()用板条箱字符串调用。

def R(b,d,i=0):
 if not d:return 1
 (k,x),*d=d
 while x:
  if x&b<1and R(b|x,d):print(f'HAUL {k.upper()} TO {i%7+65:c} {i//7+1}');return 1
  i+=1;x>>=1
def F(t,d={},e={}):
 r=c=0
 for a in t:
  if'`'<a<'{':e[a]=x,y=e.get(a,(r,c));d[a]=d.get(a,0)+(1<<(48-(r-x)*7-(c-y)//3))
  elif'\n'==a:r+=1;c=-1
  c+=1
 R(4432676798719,d.items())

设法使高尔夫更多:

  1. 直接解析条板箱字符串,而不使用re库。
  2. 使用setdefault保存一组包装箱的第一个坐标,以便在分析包装箱字符串时可以创建位掩码。消除for循环。
先前版本
import re
def R(b,d,i=0):
 if not d:return 1
 (k,x),*d=d
 while x:
  if not x&b and R(b|x,d):print(f'HAUL {k.upper()} TO {i%7+65:c} {i//7+1}');return 1
  i+=1;x>>=1
def F(t,d={},n=0):
 for r in t.split('\n'):
  for m in re.finditer(r'(.)]',r):d[m[1]]=d.get(m[1],[])+[(n,m.start())]
  n+=1
 R(4432676798719,[(k,sum(1<<(48-(r-v[0][0])*7-(c-v[0][1])//3)for r,c in v))for k,v in d.items()])

重组代码以消除冗余循环。

  1. 先前的代码建立了一个条板箱的所有位置的列表,F()然后遍历中的列表R()。新代码在其中创建一个位置,F()然后R()尝试所有可能的位置。

  2. 在先前的代码中,R()收集了一个可能的解决方案aF()然后在返回的解决方案上进行迭代。在新代码中,R()直接打印HAUL命令

先前版本
import re
def R(b,d,a=[]):
 if not d:yield a
 for x in d[0]:
  if not x&b:yield from R(b|x,d[1:],a+[x])
def F(t,d={},n=0):
 for r in t.split('\n'):
  for m in re.finditer(r'(.)]',r):d[m[1]]=d.get(m[1],[])+[(n,m.start())]
  n+=1
 for k,j in enumerate(next(R(4432676798719,[[sum(1<<(48-(r-v[0][0])*7-(c-v[0][1])//3)for r,c in v)>>i for i in range(48)]for k,v in d.items()]))):x=51-len(bin(j));print(f'HAUL {k+65:c} TO {x%7+65:c} {x//7+1}')

说明

基本思想是将船的甲板和板条箱表示为位图。通过使用位图,移动条板箱成为其位图的移位,并且检查板条箱之间的重叠情况将按位与并测试零。

取消程式码:

import re

def F(crate_string):                                                                 #  3
  coords = {} 
  row_no = 0 

  for row in crate_string.split('\n'):                                               #  7

    for match_obj in re.finditer('(.)]', row):                                       #  9

      crate_name = match_obj[1]                                                      # 11
      col_no = match_obj.start()                                                     # 12
      coords[crate_name] = coords.get(crate_name, []) + [(row_no, col_no)]           # 13

    row_no += 1

  normed = {k:[(r-v[0][0], (c-v[0][1])//3) for r,c in v] for k,v in coords.items()}  # 17
  bitmaps = [(k,sum(1<<(48 - r*7 - c) for r,c in v)) for k,v in normed.items()]      # 18

  R(4432676798719, bitmaps)                                                          # 20

def R(used, bitmaps):                                                                # 22
  if not bitmaps:                                                                    # 23
    return True                                                                      # 24
  shift = 0                                                                          # 25
  (crate_name, crate_bitmap),*bitmaps = bitmaps                                      # 26

  while crate_bitmap:                                                                # 28
    if not used & crate_bitmap:                                                      # 29
      if R(used | crate_bitmap, bitmaps):                                            # 30
        print(f'HAUL {crate_name.upper()} TO {shift%7 + 65:c} {shift//7 + 1}')       # 31
        return True                                                                  # 32

    shift += 1                                                                       # 34
    crate_bitmap >>= 1                                                               # 35

  return False                                                                       # 37

F()解析包装箱定义字符串并构建位图。正则表达式会在条板箱定义字符串的每一行中搜索(第9行)条板箱(一个字母后跟一个']')。找到匹配项后,会将相应的(row,col)添加到以字母为键的字典(第11-13行)。对于问题中给出的示例箱定义字符串:

coords = {'a': [(0, 5), (0, 8), (0, 11), (1, 5), (1, 8), (1, 11)], 
          'b': [(0, 29), (1, 29), (2, 29)], 
               ... }

每个板条箱的坐标都经过标准化(第17行),因此每个板条箱从(0,0)开始,每个块的宽度为一个单位(而不是3 a la'[a]')。

normed = {'a': [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)],
          'b': [(0, 0), (1, 0), (2, 0)],
               ... }

然后根据归一化的坐标为每个板条箱创建一个位图(第18行)。

甲板被视为7 x 7网格。“ G”列和第7行用于检测形状何时超出板面。如果包装箱将占据甲板上的相应正方形,则位图的值为1。位48至位42对应于正方形A1至A7,位41至35对应于正方形B1至B7,依此类推。

bitmaps = [('a', 0b1110000_1110000_0000000_0000000_0000000_0000000_0000000),
           ('b', 0b1000000_1000000_1000000_0000000_0000000_0000000_0000000),
           ...
           ]

R(used, bitmaps)然后使用位图递归搜索不会尝试将两个箱子放在同一正方形中的箱子放置。 used是一个位掩码,指示哪些正方形不能被使用,因为它们已经被板条箱占据了,或者因为它们不在板上(即G列和第7行)。 bitmaps是仍然需要放置的板条箱列表。

递归的基本情况是没有更多的板条箱可以放置时,即为bitmaps空(第23行)。在这种情况下,返回True表示已找到解决方案。

否则,将从名称列表中弹出一个包装箱名称及其位图(第26行)。当板条箱位图不为空时(第28行),检查由板条位图表示的当前板条箱放置是否与任何先前放置的板条箱冲突。在第29行,not used & crate_bitmap如果usedcrate_bitmap都在同一位上具有1 ,则为False ,表示发生冲突。如果没有冲突,R()则递归调用(第30行)以尝试放置剩余的板条箱。

如果递归调用R()返回True,则表示已找到解决方案,并且板条箱的当前位置是该解决方案的一部分。因此,将打印相应的移动包装箱的命令,并将True传播到递归调用中(第31-32行)。

当在中创建时F(),每个板条箱位图表示如果将板条箱放置在位置A1上,则板条箱将占据的甲板正方形。将位图向右移一位对应于将板条箱移动到位置A2。右移七位对应于将板条箱移至B1等。例如,以下位图表示板条箱“ a”在各个位置:

0b1110000_1110000_0000000_0000000_0000000_0000000_0000000  represent crates 'a' at A1
0b0111000_0111000_0000000_0000000_0000000_0000000_0000000  represent crates 'a' at A2
0b0011100_0011100_0000000_0000000_0000000_0000000_0000000  represent crates 'a' at A3
                                 ...
0b0000000_1110000_1110000_0000000_0000000_0000000_0000000  represent crates 'a' at B1
                                 ...

如果可能的箱子放置不起作用是因为它与先前放置的箱子冲突(第30行),或者是由于剩余箱子没有有效放置(第31行)。通过将位掩码右移一位,将条板箱移动到其他位置(第35行)。 Shift跟踪位图已移动了多少个位置,这对应于板条箱的当前位置。

如果位图为空(零),则表示已尝试所有可能的放置。返回False(第37行)以指示失败,因此R()对递归中较早位置的调用将尝试为其装箱尝试另一个放置。

为了确保板条箱不会从甲板的侧面伸出,将与G列和第7行相对应的位设置used为初始调用R()(第20行)。

4432676798719 是对应于的空甲板 0b0000001000000100000010000001000000100000011111111


干得好!我只是在其中一个测试用例上尝试过,它试图将一个条板箱拖到0行,但这不是有效行。只有1-6行。认为它只需要+1除法即可。:)
乔纳森·皮卡佐

@JMPicazo-修复它。
RootTwo

5

Python 2,864字节

  • 感谢斯蒂芬发现错误。
  • 字符串解析可能会被大量使用,因为输入格式比它可以处理的严格。
def V(C,S=0,D=-1,J=0,H=[],E=enumerate,R=range,r=str.replace,s=str.split,e="!"):
 if[]<C*0:
	J=0;N=[J]*26;K=[]
	for c in s(r(r(r(C,"[",""),"]",""),"   ","*"),2*"\n"):
	 c=[list(_)for _ in s(c,"\n")]
	 for x,_ in E(c[0]):
		if all(c[y][x]<">"for y,_ in E(c)):
		 for y,_ in E(c):c[y][x]=e
	 for j,y in E(c):
		y="".join(y)
		while"!!"in y:y=r(y,2*e,e)
		c[j]=s(y,e)
	 K+=[],[],[],[];J+=4
	 for y in c:
		while""in y:y.remove("")
		for j,x in E(y):K[j+J-4]+=x,
	for k in K:
	 if all(k)and k:N[ord(k[0][0])-97]=[[x>"*"for x in y]for y in k]
	while 0in N:N.remove(0)
	C=N
 if[]>S:S=[0]*36
 if-~D>0:
	Y=J/6;j=0
	for y in C[D]:
	 X=J%6
	 for x in y:
		if x:
		 if X>5or Y>5or S[X+Y*6]:return
		 S[X+Y*6]=x
		X+=1
	 Y+=1
 if~-len(C)==D:
	if 0in S:return
	for h in H[1:]+[J]:print"HAUL %c TO %c %d"%(65+j,65+h%6,h/6+1);j+=1
	j/0
 for j in R(36):V(C,S[:],-~D,j,H*(D>=0)+[J])

在线尝试!

说明

许多字节用于解析通过单个字符串输入的二维包装箱。板条箱表示为布尔值的嵌套列表。
解析板条箱后,该函数将考虑所有板条箱的所有可能位置。为此,它会反复调用自身。当发现不可能的位置时(如果将条板箱放置在甲板外部或另一条板条箱上方),它将杀死当前的递归树分支以提高性能。
当发现某种放置组合导致甲板完全被覆盖时,它将打印记录的板条放置历史,并通过进行无希望的划分来全局退出。打印的运输说明甚至按字母顺序排序。


Python 2,812字节

def f(C,M=[],d=0,R=range,E=enumerate,L=len):
 if C*0=="":
	N=[0]*26;K=[];J=0
	r=str.replace
	for c in r(r(r(C,"[",""),"]",""),"   ","*").split("\n\n"):
	 c=[list(_)for _ in c.split("\n")]
	 for x in R(L(c[0])):
		if all(c[y][x]=="*"for y in R(L(c))):
		 for y in R(L(c)):c[y][x]="!"
	 for j,y in E(c):
		y="".join(y)
		while"!!"in y:y=r(y,"!!","!")
		c[j]=y.split("!")
	 for _ in"_"*L(c):K+=[],
	 for y in c:
		for j,x in E(y):K[j+J]+=x,
	 J+=L(c)
	for k in K:
	 if all(k)and k:N[ord(k[0][0])-97]=[[x!="*"for x in y]for y in k]
	while 0in N:N.remove(0)
	C=N
 if d==L(C):
	j=0;S=[j]*36
	for c,k in E(C):
	 Y=M[c]/6
	 for y in k:
		X=M[c]%6
		for x in y:
		 if X<6>Y:S[X+Y*6]|=x
		 X+=1
		Y+=1
	if 0in S:return
	for m in M:print"HAUL %c TO %c %d"%(65+j,65+m%6,1+m/6);j+=1
	j/0
 for j in R(36):f(C,M*(d>=0)+[j],d+1)

在线尝试!

说明

解析条板箱字符串并将其转换为代表每个条板箱的列出的布尔嵌套。
迭代函数生成所有可能的长度列表,这些列表的长度等于给定的包含整数的板条箱数量0 <= x < 36(所有可能的船甲板位置)。每个列表都被解释为放置所有包装箱并进行测试的指令。如果经过测试的指令列表导致甲板上没有空白,则指令列表必须有效并被打印。
由于效率极低,我没有在提供的测试用例上测试它,尽管在板条箱较少的情况下(请参见TIO链接)。由于该算法会搜索所有可能的安排,因此会尝试查看36**10 = 3.656e15它们。但从理论上讲,它仍然应该起作用。


如果您可以使其与提供的输入用例一起使用,那么这将值得回答。:)否则,很好的工作,这是有用的信息!
乔纳森·皮卡佐

@JonathanMicaelPicazo在代码高尔夫球中的人喜欢编写答案,但答案要短几个字节,但可能在宇宙热死后终止……
Stephen

(不幸的是)您可能需要将H/ 的默认值M移出函数声明,因为将其包含在声明中会使函数无法重用。好的Python。
斯蒂芬,

1
@JonathanMicaelPicazo我希望修复我的字符串解析器并链接到您的新测试用例。三号板条箱在TIO上花费的时间太长,尽管如果[i]与号板条交换[b],它也可以工作。可以通过首先对包装箱进行排序来改进算法,以便对较大的包装箱进行测试,然后再对较小的包装箱进行测试。
乔纳森·弗雷奇

1
@JonathanFrech我明白了……好吧,您愿意付出更多努力并加以改进,以便将箱子从最大体积分类到最小体积吗?我一直在给它提供许多不同的测试用例,其中一些用例可以很快解决,而其他一些用例常常会超时或什至无法解决...我想知道您是否没有时间,但是我认为至少值得一问!
乔纳森·皮卡佐

2

JavaScript 366

k=>(x=y=0,C={},B=[...k].map((c,p)=>(c<' '?(x=0,++y):c<'a'?++x:(c=C[c=parseInt(c,36)]||(C[c]=[[],x,y]))[0].push((y-c[2])*7+(x++-c[1])/3),p<8|p>48|p%7<1)),S=[],R=i=>!C[i]||B.some((v,p)=>v?0:C[i][0].every(q=>B[q+=p]?0:B[q]=i)&&R(i+1,S[i-10]=p)||!C[i][0].map(q=>B[q+=p]==i?B[q]=0:0)),R(10),S.map((v,c)=>`HAUL ${(c+10).toString(36)} TO ${(v%7+9).toString(36)} ${v/7|0}`))

注意:此函数可以解析更紧凑的输入,因为它不关心间距为24个字符,并且允许在板条箱中插入孔。

我认为它可以打更多一点,但是现在它很短而且不太慢,所以我喜欢它

少打高尔夫球

k=>(
  // input parsing
  var x = 0, y = 0, // current position   
      C = []; // crates 
  [...k].forEach( c => 
  c < ' ' 
  ? (x = 0, ++y) // found a newline, increment y, reset x
  : c < 'a'
    ? ++x // not a letter, increment x
    : (  // found a letter, update the crate
        c = parseInt(c,36), // letter to number (10..35)
        c = C[c], // current crate in c
        c || (C[c]=[[], x, y]), // if new crate, initialize it setting base position
        c[0].push((y - c[2])*7 + (x-c[1])/3) // add current position
        ++x // increment x also
      )
  );
  var B = [...Array(7*8)] // empty board. in golfed code I reuse k to build B. k is big enough
  B = B.map( (_, p) => // set borders
     p < 8 | p > 48 | p%7<1
  )   
  var S = [] // output steps

  // recursive function to fill board
  var R = i => 
    ! C[i] // if crate at position i exists (else, we have found a solution and return true)
    ||
    B.some( (v,p) => // try to put crate at each position in B
      v // current cell is used already ?
      ? 0 // used, return false
      : C[i][0].every( q => // try this position, must place every part 
          B[q+=p] // current position in B is used ?
          ? 0 // used, stop, return false
          : B[q]=i // mark as used
        ) 
        && R(i+1,S[i-10]=p) // ok for current crate, try next, mark step
        || // else, fail for current crate, clear position marked
        !C[i][0].map(q => 
          B[q+=p]==i ? B[q]=0:0 // clear if it was set to 'i'
        )
    ),
  R(10) // start recursive fill at position 10 (that is 'a')
  // it returns true if ok, but we don't care as we are assured a solution exists
  // now just format output
  return S.map((v,c)=>`HAUL ${(c+10).toString(36)} TO ${(v%7+9).toString(36)} ${v/7|0}`)
)

测试用例很多

var F=
k=>(x=y=0,C={},B=[...k].map((c,p)=>(c<' '?(x=0,++y):c<'a'?++x:(c=C[c=parseInt(c,36)]||(C[c]=[[],x,y]))[0].push((y-c[2])*7+(x++-c[1])/3),p<8|p>48|p%7<1)),S=[],R=i=>!C[i]||B.some((v,p)=>v?0:C[i][0].every(q=>B[q+=p]?0:B[q]=i)&&R(i+1,S[i-10]=p)||!C[i][0].map(q=>B[q+=p]==i?B[q]=0:0)),R(10),
// Just for debug: return the fill in addition to the steps
[B.slice(7,50).map((c,i)=>i%7?c.toString(36):'\n'),
S.map((v,c)=>`HAUL ${(c+10).toString(36)} TO ${(v%7+9).toString(36)} ${v/7|0}`)])

var Test = [
 "[a][a][a]               [b]                     [c][c]\n      [a]               [b][b][b]                  [c]\n      [a]               [b][b]\n\n[d]                     [e]                     [f][f][f][f][f]\n[d][d]                  [e]\n[d][d]                  [e]\n                        [e]\n                        [e][e]\n\n[g]                     [h]                     [i]\n[g]                                             [i]\n                                                [i]"
,"[a][a][a]               [b]                     [c][c][c]\n   [a][a]               [b]\n   [a]                  [b][b]\n                        [b][b]\n\n[d]                     [e]                     [f]\n[d]                                             [f]\n[d]                                             [f]\n[d]\n[d]\n\n[g][g]                  [h]                     [i]\n                                                [i][i]\n                                                   [i]\n                                                   [i][i]\n\n[j][j][j]"
,"[a]                     [b][b][b]               [c]\n[a]                           [b]\n[d]                     [e]                     [f][f]\n[d]                     [e]\n[d][d][d]\n[g]                     [h]                     [i]\n[g]                     [h][h][h]               [i]\n                              [h]               [i][i]\n                              [h]                  [i]\n                                                   [i]\n[j]                     [k][k][k]\n[j]\n[j]"
,"[a][a][a][a]            [b][b][b]               [c]\n                              [b]               [c]\n                              [b]               [c][c]\n                                                   [c][c]\n[d]                     [e]                     [f]\n[d]                                             [f][f][f]\n[g]                     [h]                     [i][i]\n                        [h][h][h]               [i][i]\n                           [h][h]\n[j]\n[j]\n[j]"
,"[a]                     [b]                     [c][c]\n[a]                     [b]\n[a]\n[d][d]                  [e]                     [f][f][f]\n[d][d][d]\n[g]                     [h]                     [i]\n                        [h]\n                        [h]\n                        [h][h]\n                           [h]\n[j]                     [k][k][k]\n[j][j]                     [k][k]\n[j][j][j]                     [k]"
,"[a]                     [b][b][b]               [c]\n[a]                                             [c]\n                                                [c]\n[d][d]                  [e]                     [f]\n[d][d][d][d]            [e]                     [f]\n                        [e][e][e][e]            [f]\n[g]                     [h][h][h]               [i][i][i]\n                              [h]               [i][i][i]\n[j][j]"
,"[a]                     [b]                     [c][c][c]\n                        [b]\n[d]                     [e][e]                  [f][f]\n[d][d][d]                                       [f][f]\n[d][d]\n[g]                     [h][h][h]               [i]\n[g]                           [h]               [i][i]\n[g]                           [h]               [i][i]\n[g]\n[g]\n[j]\n[j]\n[j]"
,"[a][a]                  [b]                     [c]\n   [a][a]               [b][b]                  [c]\n                        [b][b][b]               [c]\n[d]                     [e][e][e]               [f][f][f]\n[d]                     [e][e][e]\n[g][g]                  [h]                     [i]\n                                                [i]\n                                                [i][i]\n[j][j]\n   [j]\n   [j]\n   [j]"
,"[a][a]                  [b]                     [c]\n[a][a]                  [b][b]                  [c]\n                        [b][b][b]\n[d][d]                  [e]                     [f][f][f]\n[g]                     [h]                     [i][i]\n[g]                     [h]                        [i]\n[g]                     [h]\n[g]\n[g][g]\n[j]\n[j]\n[j]\n[j][j]\n   [j]"
,"[a]                     [b]                     [c][c][c][c][c]\n                        [b]\n                        [b][b][b]\n                              [b]\n[d]                     [e]                     [f][f][f]\n                        [e]\n                        [e]\n                        [e][e][e]\n[g]                     [h]                     [i]\n[g]                     [h]\n[g]                     [h]\n                        [h]\n[j][j]                  [k]\n[j][j]                  [k]"
,"[a]                     [b]                     [c]\n                                                [c]\n                                                [c]\n[d][d][d]               [e]                     [f]\n                        [e][e][e]               [f]\n                                                [f][f][f]\n                                                   [f]\n[g][g][g]               [h][h]                  [i]\n[g][g][g]                                       [i][i]\n                                                [i][i]\n[j]                     [k]\n[j]                     [k]\n[j]"
,"[a][a]                  [b]                     [c]\n                        [b]                     [c][c][c]\n                        [b]                           [c]\n                        [b][b]                        [c]\n                           [b]\n[d]                     [e]                     [f]\n[d]\n[g]                     [h]                     [i]\n[g][g][g]               [h]                     [i]\n                        [h][h][h]               [i]\n                              [h]\n[j][j][j]               [k][k]"
,"[a][a]                  [b][b][b]               [c]\n                        [b][b][b]\n[d]                     [e]                     [f]\n[d]                     [e]                     [f]\n                        [e]                     [f]\n                        [e][e]\n                           [e]\n[g][g][g]               [h][h]                  [i]\n                        [h][h]                  [i]\n                        [h][h]                  [i][i]\n                                                   [i]\n                                                   [i]\n[j]"
,"[a][a][a]               [b][b]                  [c][c]\n                        [b][b]                  [c][c]\n                        [b][b]                  [c][c]\n[d][d]                  [e]                     [f][f]\n   [d]                  [e]\n                        [e]\n                        [e]\n                        [e]\n[g]                     [h]                     [i][i]\n[g]                                             [i][i]\n[g]\n[g]\n[g][g]"
,"[a][a][a]               [b]                     [c]\n      [a]                                       [c]\n      [a]\n[d]                     [e][e][e]               [f][f]\n[d]\n[g]                     [h][h]                  [i]\n[g][g][g]               [h][h]                  [i]\n   [g][g]                                       [i]\n[j]                     [k]\n[j]                     [k]\n[j][j]\n   [j]\n   [j]"
,"[a][a]                  [b]                     [c][c]\n                        [b][b]\n                        [b][b][b]\n[d]                     [e][e][e]               [f][f]\n                        [e][e][e]                  [f][f][f]\n[g]                     [h]                     [i][i]\n[g]                     [h]                     [i][i]\n[g]                                             [i][i]\n[j][j][j]"
,"[a][a]                  [b][b][b]               [c]\n   [a]                     [b][b]\n   [a][a][a]\n[d][d]                  [e]                     [f]\n[d][d]                  [e][e]                  [f][f][f]\n                        [e][e]\n                           [e]\n[g][g][g]               [h]                     [i]\n                                                [i]\n                                                [i]\n                                                [i]\n[j][j]"
,"[a]                     [b][b]                  [c]\n[a]                                             [c]\n[a]\n[a][a][a]\n[d]                     [e][e][e][e]            [f]\n[d]                                             [f]\n                                                [f]\n[g]                     [h]                     [i]\n[g]                     [h][h]\n[g]                     [h][h][h]\n[g]\n[g][g]\n[j]                     [k][k]\n                           [k]"
,"[a]                     [b][b]                  [c]\n[a]                     [b][b][b]               [c]\n[a][a][a][a]                                    [c]\n[d][d][d]               [e]                     [f]\n   [d][d]               [e]\n[g]                     [h]                     [i]\n                        [h]                     [i]\n                        [h]\n                        [h]\n                        [h][h]\n[j][j][j][j][j]"
,"[a][a]                  [b][b]                  [c]\n   [a][a][a]\n   [a]\n[d]                     [e][e][e]               [f][f]\n[d]\n[g]                     [h][h]                  [i]\n[g]                     [h][h]\n[g]                     [h][h]\n[g]\n[j]                     [k]\n[j][j]                  [k][k]\n                        [k][k]\n                           [k]"
,"[a][a][a]               [b]                     [c]\n                                                [c]\n                                                [c][c][c][c]\n[d]                     [e][e][e]               [f][f][f]\n[d]                     [e][e][e]               [f][f][f]\n[d]\n[g]                     [h][h]                  [i][i]\n[g]                                             [i][i]\n[j]\n[j]\n[j]"
,"[a]                     [b]                     [c][c]\n                        [b]                     [c][c]\n                        [b]\n[d][d][d]               [e]                     [f]\n      [d]                                       [f]\n                                                [f]\n[g]                     [h]                     [i]\n[g]                     [h][h][h]               [i][i]\n                        [h][h]                  [i][i][i]\n[j]                     [k]                     [l][l][l][l]"
,"[a]                     [b]                     [c]\n[a][a]                  [b]\n[a][a]\n[d]                     [e]                     [f]\n[d]                     [e]\n[d]                     [e][e][e]\n[d]                        [e]\n[g]                     [h][h][h]               [i][i]\n[g][g]\n[j][j][j]               [k]\n[j][j][j]               [k]\n                        [k]"
,"[a]                     [b]                     [c][c]\n[a][a][a]               [b]                     [c][c]\n   [a][a]               [b]\n                        [b]\n                        [b][b]\n[d]                     [e]                     [f]\n[d]                     [e]\n[d]\n[g]                     [h][h][h][h]            [i]\n[j][j]                  [k]\n                        [k]\n                        [k][k]\n                           [k]\n                           [k]"
,"[a]                     [b][b][b]               [c]\n[a]                     [b][b][b]               [c][c][c]\n[a]\n[d]                     [e]                     [f][f][f][f]\n                        [e]\n                        [e]\n                        [e]\n                        [e]\n[g]                     [h]                     [i]\n                        [h][h]                  [i]\n                        [h][h]                  [i][i][i]\n                                                   [i]\n[j]"
,"[a][a][a]               [b]                     [c]\n                        [b]                     [c]\n                        [b][b][b]\n                              [b]\n[d][d][d]               [e][e]                  [f]\n                        [e][e]                  [f]\n                                                [f]\n                                                [f][f][f]\n[g]                     [h]                     [i]\n[g]                                             [i]\n[g]                                             [i]\n                                                [i]\n                                                [i][i]\n[j][j]"
,"[a]                     [b]                     [c]\n[a]                     [b]\n[a][a]                  [b]\n[d]                     [e][e][e]               [f]\n[d]                           [e]               [f]\n                              [e]               [f]\n                              [e]               [f][f]\n                                                   [f]\n[g][g]                  [h]                     [i]\n                                                [i]\n[j][j][j]               [k]\n                        [k][k][k]\n                        [k][k]"
,"[a][a][a]               [b][b]                  [c]\n                           [b]                  [c]\n[d]                     [e][e]                  [f]\n[d]                                             [f]\n[d][d]\n   [d][d]\n[g]                     [h]                     [i]\n                        [h]\n                        [h]\n[j][j]                  [k]                     [l]\n[j][j][j]               [k]                     [l][l][l]\n      [j]               [k]"
,"[a][a]                  [b]                     [c][c][c]\n[d]                     [e][e]                  [f][f]\n[d]                     [e][e]                  [f][f]\n[d]\n[d]\n[g]                     [h][h][h]               [i]\n[g]                                             [i]\n[g]\n[g][g][g]\n[j]                     [k]\n[j]\n[j][j][j][j]"
,"[a][a][a]               [b][b]                  [c]\n[d]                     [e]                     [f]\n[d][d][d]                                       [f][f][f][f]\n[d][d]                                                   [f]\n[g][g]                  [h][h][h]               [i]\n                                                [i]\n                                                [i]\n[j]                     [k]                     [l]\n[j]                                             [l]\n                                                [l][l]\n                                                [l][l]"
,"[a][a][a]               [b]                     [c]\n                        [b]                     [c]\n                                                [c]\n[d][d]                  [e][e]                  [f]\n   [d]\n   [d]\n   [d]\n[g]                     [h]                     [i][i]\n[g][g]                  [h]                     [i][i][i]\n                        [h][h][h]                     [i]\n                              [h]\n[j][j]                  [k]\n[j][j]"
,"[a]                     [b][b][b]               [c]\n[a]                           [b]               [c]\n[a][a]                        [b]               [c]\n   [a][a]\n[d]                     [e][e][e]               [f][f]\n[d][d][d]                                       [f][f]\n   [d][d]\n[g]                     [h]                     [i][i]\n[j]                     [k]\n[j]                     [k][k]"
,"[a]                     [b]                     [c]\n                                                [c]\n                                                [c][c]\n                                                   [c][c]\n[d][d][d][d][d]         [e]                     [f][f]\n                                                [f][f]\n[g]                     [h]                     [i][i]\n[g]                     [h][h]                  [i][i]\n[g]                                             [i][i]\n[g]\n[g]\n[j][j]\n[j][j]"
,"[a]                     [b][b]                  [c][c]\n                           [b]                  [c][c]\n                           [b]\n[d][d]                  [e][e]                  [f]\n[d][d][d]               [e][e][e]\n[g]                     [h]                     [i]\n[g]                     [h]\n[g][g][g][g]            [h]\n                        [h]\n                        [h]\n[j][j][j][j]"
,"[a]                     [b][b][b]               [c][c][c]\n[a]                        [b][b]\n[a]\n[a][a]\n   [a]\n[d]                     [e]                     [f]\n[d]                                             [f]\n[d]                                             [f]\n[g]                     [h]                     [i][i]\n[g][g]                  [h]                     [i][i]\n[g][g][g]\n[j]                     [k][k]"
,"[a]                     [b][b]                  [c]\n[a]                     [b][b]\n                        [b][b]\n[d]                     [e]                     [f][f][f]\n[d][d][d]\n[d][d]\n[g]                     [h]                     [i][i]\n[g]                     [h]\n[g]\n[j][j][j]               [k]\n      [j]               [k]\n                        [k]\n                        [k][k]\n                           [k]"
,"[a][a][a]               [b]                     [c]\n   [a][a]\n[d][d][d]               [e]                     [f][f]\n                        [e]\n[g]                     [h]                     [i]\n[g][g]                  [h]                     [i]\n[g][g][g]               [h]                     [i]\n[j]                     [k][k]\n[j][j]                  [k][k][k]\n[j][j]"
,"[a][a][a]               [b]                     [c][c][c][c][c]\n   [a][a]               [b]\n      [a]               [b]\n                        [b]\n[d]                     [e]                     [f]\n[d][d]                                          [f]\n[d][d][d]                                       [f]\n[g]                     [h][h]                  [i][i][i]\n                        [h][h]                  [i][i][i]"
,"[a][a]                  [b]                     [c]\n                        [b]\n                        [b]\n[d][d][d]               [e]                     [f]\n                                                [f]\n                                                [f]\n                                                [f]\n[g][g][g]               [h][h]                  [i]\n[g][g][g]               [h][h]                  [i][i]\n                                                [i][i][i]\n[j][j][j]\n   [j][j]\n      [j]"
,"[a]                     [b]                     [c]\n[a]                                             [c]\n[a]                                             [c]\n[a]                                             [c][c][c]\n[a][a]\n[d]                     [e]                     [f]\n                        [e]\n                        [e]\n[g][g]                  [h][h]                  [i][i][i]\n[g][g]\n[g][g]\n[j]                     [k][k][k]\n[j]\n[j]\n[j]"
,"[a][a][a]               [b]                     [c]\n      [a][a]            [b][b]                  [c]\n      [a]               [b][b][b]               [c]\n                                                [c]\n[d]                     [e][e][e]               [f]\n[d][d][d]\n[d][d]\n[g]                     [h]                     [i][i]\n                                                [i][i]\n[j]                     [k][k]\n[j]"
,"[a]                     [b][b]                  [c]\n                                                [c]\n                                                [c][c]\n                                                [c][c]\n[d]                     [e][e][e]               [f][f]\n[d][d][d]                                          [f][f]\n                                                      [f]\n[g]                     [h]                     [i]\n                                                [i][i]\n                                                   [i][i]\n                                                      [i]\n[j]                     [k]                     [l][l]\n[j]\n[j]\n[j]"
,"[a]                     [b]                     [c][c][c]\n[a]                     [b]                        [c][c]\n[a]                     [b]\n[a]\n[a][a]\n[d]                     [e]                     [f][f]\n                        [e][e]\n                        [e][e]\n                           [e]\n[g]                     [h]                     [i][i]\n                                                [i][i]\n                                                [i][i]\n[j]                     [k][k][k]\n[j]"
,"[a][a][a]               [b]                     [c]\n                                                [c]\n                                                [c]\n                                                [c][c]\n                                                   [c]\n[d][d][d]               [e]                     [f]\n      [d]                                       [f]\n                                                [f]\n[g][g]                  [h]                     [i]\n                        [h]                     [i][i][i]\n                                                [i][i]\n[j][j]                  [k]\n[j][j]                  [k]\n[j][j]"
,"[a][a]                  [b][b]                  [c][c]\n                           [b][b]\n                              [b]\n[d]                     [e][e][e]               [f]\n[d]                     [e][e][e]               [f]\n[d][d]\n   [d][d]\n[g][g][g]               [h]                     [i]\n                        [h]                     [i][i]\n                        [h]\n[j]                     [k]\n                        [k]\n                        [k]"
,"[a][a][a]               [b][b]                  [c]\n      [a]                                       [c][c][c]\n                                                [c][c]\n[d]                     [e]                     [f]\n                                                [f]\n                                                [f]\n                                                [f]\n[g]                     [h][h]                  [i][i][i]\n[g]                     [h][h]\n[g]                     [h][h]\n[g][g][g]\n[j][j][j]"
,"[a][a]                  [b][b]                  [c][c][c][c][c]\n[a][a][a]                  [b]\n[d]                     [e][e][e]               [f]\n[d]                     [e][e][e]               [f]\n[d][d][d][d]                                    [f]\n                                                [f]\n                                                [f]\n[g]                     [h]\n                        [h]\n                        [h]\n                        [h]\n                        [h]"
,"[a]                     [b][b]                  [c]\n[a]                                             [c]\n[a]                                             [c]\n[a]                                             [c]\n[a]\n[d]                     [e]                     [f]\n[g]                     [h][h][h][h]            [i][i][i]\n[g]                                             [i][i][i]\n[g][g][g][g]\n[j][j]\n[j][j][j][j]"
,"[a]                     [b]                     [c]\n                        [b][b]\n                        [b][b][b]\n[d][d][d]               [e]                     [f][f]\n   [d][d]               [e]                     [f][f]\n      [d]               [e]\n                        [e]\n[g][g]                  [h]                     [i][i][i]\n                        [h]                     [i][i][i]\n                        [h]\n[j][j][j]"
,"[a][a]                  [b][b]                  [c]\n                                                [c]\n                                                [c]\n                                                [c]\n                                                [c][c]\n[d]                     [e]                     [f][f][f]\n                        [e]\n                        [e]\n                        [e][e][e]\n[g][g]                  [h]                     [i]\n                        [h][h][h]               [i]\n                        [h][h]                  [i]\n[j]                     [k]\n                        [k]\n                        [k]\n                        [k]"
,"[a]                     [b]                     [c][c][c][c][c]\n[a]\n[a][a][a][a]\n[d][d]                  [e]                     [f]\n[d][d]\n[g]                     [h][h]                  [i]\n[g]                     [h][h][h]               [i]\n[j]                     [k]\n[j]                     [k]\n[j]                     [k]\n                        [k][k]\n                           [k]"
,"[a]                     [b]                     [c]\n[a][a]                  [b]\n                        [b]\n                        [b][b]\n                           [b]\n[d]                     [e]                     [f][f][f]\n[d]                     [e]                     [f][f][f]\n                        [e]\n[g]                     [h]                     [i]\n                        [h]                     [i]\n                        [h]                     [i][i][i]\n                                                      [i]\n[j][j][j][j][j]"
,"[a]                     [b]                     [c][c]\n                        [b]                     [c][c]\n                        [b]\n                        [b]\n[d][d]                  [e][e][e]               [f][f]\n[d][d]\n[g]                     [h][h]                  [i][i]\n                        [h][h]                  [i][i]\n                        [h][h]\n[j]                     [k]\n                        [k]\n                        [k][k][k]\n                              [k]"
,"[a][a]                  [b][b]                  [c]\n   [a][a]                  [b]                  [c]\n      [a]                  [b]                  [c]\n                           [b]                  [c]\n[d]                     [e]                     [f]\n                                                [f][f]\n                                                [f][f][f]\n[g][g]                  [h][h][h]               [i]\n[j][j]                  [k][k]\n                        [k][k][k][k]"
,"[a]                     [b]                     [c]\n                                                [c]\n                                                [c]\n                                                [c][c]\n                                                   [c]\n[d]                     [e][e]                  [f][f]\n                        [e][e][e]\n                              [e]\n[g]                     [h]                     [i][i][i]\n                        [h]\n                        [h]\n                        [h]\n                        [h]\n[j][j]                  [k]                     [l]\n                        [k]                     [l]\n                                                [l][l]\n                                                   [l][l]"
,"[a][a]                  [b]                     [c]\n   [a]                                          [c][c]\n   [a]                                             [c]\n   [a]                                             [c]\n   [a]                                             [c]\n[d]                     [e]                     [f]\n[d]                                             [f]\n[d][d]                                          [f]\n   [d]                                          [f]\n   [d]\n[g][g][g]               [h][h]                  [i]\n                                                [i]\n                                                [i]\n                                                [i]\n                                                [i][i]\n[j]"
,"[a]                     [b]                     [c][c]\n                        [b]\n                        [b]\n[d]                     [e][e]                  [f]\n[d][d][d]                  [e]                  [f][f]\n[d][d]                                          [f][f][f]\n[g][g][g]               [h][h][h]               [i][i]\n                              [h][h]            [i][i]\n[j]                     [k]\n[j]"
,"[a][a][a]               [b][b]                  [c]\n                           [b]                  [c][c][c]\n                                                [c][c]\n[d]                     [e][e]                  [f][f]\n[d]                                             [f][f]\n[g]                     [h]                     [i][i][i][i]\n[g][g]                  [h]                           [i][i]\n[g][g][g]               [h]\n[j]"
,"[a][a][a]               [b]                     [c]\n                                                [c]\n                                                [c][c]\n                                                [c][c]\n[d]                     [e]                     [f]\n[d][d][d]               [e]                     [f]\n                                                [f][f]\n                                                   [f][f]\n[g]                     [h]                     [i][i]\n[g]                     [h]\n[g]                     [h]\n[j][j][j]\n[j][j]\n   [j]"
,"[a]                     [b]                     [c]\n                        [b]                     [c][c][c][c]\n                        [b]                           [c]\n[d][d]                  [e][e][e]               [f]\n[d][d][d][d]\n[g]                     [h]                     [i][i][i]\n[g]                     [h]\n[g]\n[j][j]                  [k]\n                        [k]\n                        [k][k][k]\n                              [k]"
,"[a]                     [b]                     [c]\n[a]                                             [c]\n[a]                                             [c]\n[a][a]\n   [a]\n[d]                     [e][e]                  [f][f]\n[g][g]                  [h][h][h]               [i]\n[g][g]                                          [i]\n   [g]\n[j]                     [k]                     [l]\n[j]                     [k]                     [l]\n[j][j]                  [k]\n   [j][j]"
,"[a]                     [b]                     [c][c]\n                        [b]                        [c][c]\n                        [b]                        [c][c]\n                        [b]\n                        [b][b]\n[d][d][d][d]            [e]                     [f]\n                        [e][e]\n                        [e][e]\n                           [e]\n[g]                     [h]                     [i]\n                        [h]\n                        [h]\n                        [h]\n[j]                     [k]                     [l][l]\n                                                [l][l]"
,"[a]                     [b][b][b]               [c]\n[a][a]                        [b]               [c]\n[a][a]                        [b]               [c]\n                                                [c][c][c]\n[d][d]                  [e]                     [f]\n                        [e]                     [f][f][f]\n                                                [f][f]\n[g]                     [h][h][h]               [i]\n[g]\n[g]\n[j][j][j]"
,"[a][a]                  [b][b][b]               [c]\n                              [b]               [c]\n[d]                     [e]                     [f][f][f][f]\n[d][d][d][d][d]\n[g]                     [h]                     [i]\n[g]                     [h][h][h]               [i]\n[g][g][g]                     [h][h]            [i]\n      [g]\n[j]                     [k]"
,"[a]                     [b][b][b][b]            [c]\n[a][a][a]                                       [c]\n   [a][a]                                       [c]\n[d]                     [e]                     [f]\n[d]                                             [f]\n[g][g][g]               [h]                     [i][i]\n      [g]                                       [i][i]\n[j]                     [k]\n[j]                     [k]\n[j][j]                  [k]\n   [j]\n   [j]"
,"[a][a][a]               [b]                     [c][c][c]\n   [a][a]               [b]                     [c][c][c]\n      [a]               [b]\n[d]                     [e][e][e][e]            [f]\n[d]\n[d]\n[d][d]\n   [d]\n[g]                     [h]                     [i]\n[g]\n[j]\n[j][j]\n[j][j][j]"
,"[a][a][a]               [b]                     [c]\n                        [b]\n                        [b]\n[d]                     [e]                     [f]\n[d]                     [e]                     [f][f]\n[d]\n[d][d][d]\n[g]                     [h]                     [i][i][i][i]\n[j]                     [k][k]\n[j][j]                     [k][k]\n[j][j][j]                     [k]\n                              [k]"
,"[a][a]                  [b][b][b]               [c]\n[a][a]                                          [c][c]\n                                                [c][c][c]\n[d]                     [e][e]                  [f]\n                                                [f]\n                                                [f]\n                                                [f]\n[g]                     [h]                     [i][i]\n[g][g]                  [h]                        [i]\n                        [h]\n[j][j]                  [k]\n   [j][j]\n      [j]\n      [j]"
,"[a]                     [b]                     [c][c][c][c][c]\n[a]                     [b]\n[a]\n[d][d][d]               [e]                     [f]\n[d][d][d]               [e]                     [f]\n                        [e][e]                  [f]\n                        [e][e]                  [f]\n                                                [f][f]\n[g]                     [h]                     [i][i]\n                                                [i][i]\n                                                [i][i]"
,"[a]                     [b]                     [c]\n[a]                     [b]\n[a]                     [b][b]\n[a]                        [b][b]\n[d][d][d][d]            [e]                     [f][f]\n                                                [f][f]\n[g][g]                  [h]                     [i][i]\n[g][g]                  [h][h][h]               [i][i]\n   [g][g]                                          [i]\n[j]"
,"[a]                     [b][b][b]               [c]\n[a][a][a]                     [b]\n[a][a]                        [b]\n[d][d][d]               [e]                     [f]\n                        [e][e][e]\n                        [e][e]\n[g][g]                  [h]                     [i]\n                        [h]                     [i]\n                        [h]\n[j]                     [k][k]\n[j]                     [k][k]\n[j]"
,"[a][a]                  [b][b][b][b]            [c]\n   [a][a]                                       [c]\n   [a][a]\n[d]                     [e]                     [f]\n[d]\n[d][d]\n   [d]\n   [d]\n[g][g]                  [h]                     [i]\n[g][g]                                          [i]\n[j]                     [k]\n[j]                     [k][k]\n[j]                        [k]\n                           [k]\n                           [k]"
,"[a][a]                  [b]                     [c]\n                        [b]                     [c]\n                        [b]\n[d][d][d]               [e]                     [f]\n[d][d][d]               [e]                     [f][f]\n                        [e]                     [f][f][f]\n[g]                     [h]                     [i]\n                        [h]                     [i]\n                                                [i][i]\n                                                   [i]\n                                                   [i]\n[j]                     [k]                     [l][l][l]"
,"[a]                     [b]                     [c]\n                                                [c]\n                                                [c]\n[d]                     [e][e][e]               [f]\n                                                [f]\n                                                [f]\n                                                [f][f][f]\n[g]                     [h][h][h][h]            [i]\n[g]                                             [i][i]\n                                                [i][i][i]\n[j][j]                  [k][k]\n[j][j]                     [k][k]\n                              [k]"
,"[a][a][a]               [b]                     [c]\n                        [b][b][b][b]            [c]\n                                 [b]            [c]\n[d]                     [e][e][e]               [f][f]\n[d]                     [e][e][e]\n[d][d][d][d]\n[g][g]                  [h]                     [i]\n[g][g]                  [h]\n[j][j][j]"
,"[a]                     [b][b][b]               [c]\n[a]                           [b]               [c]\n[a]                                             [c][c][c]\n                                                      [c]\n[d][d]                  [e][e][e][e]            [f]\n[d][d]\n[g]                     [h]                     [i]\n                        [h][h][h]               [i]\n                              [h][h]\n[j]                     [k][k]\n                        [k][k]"
,"[a][a][a]               [b]                     [c][c][c]\n                                                      [c]\n[d]                     [e]                     [f]\n[d]                                             [f][f][f]\n[d]                                             [f][f]\n[g]                     [h][h]                  [i]\n                        [h][h]                  [i]\n                                                [i]\n[j]                     [k]                     [l][l]\n[j]                     [k][k][k]\n                        [k][k]"
,"[a]                     [b]                     [c]\n[a]                     [b][b]\n[a]                     [b][b][b]\n[a]\n[d]                     [e]                     [f][f][f]\n[d][d]                  [e]                        [f][f]\n[d][d]                  [e]\n   [d]                  [e]\n[g][g]                  [h]                     [i]\n[j]                     [k][k][k]\n[j][j]"
,"[a][a][a][a][a]         [b]                     [c][c]\n                                                [c][c]\n[d][d][d]               [e]                     [f][f]\n[d][d][d]                                          [f]\n                                                   [f]\n[g]                     [h][h]                  [i]\n[g]                     [h][h][h]               [i]\n[g][g][g][g]                                    [i]\n                                                [i]"
,"[a][a]                  [b]                     [c][c][c]\n                        [b]\n                        [b]\n                        [b][b]\n                           [b]\n[d]                     [e][e]                  [f]\n[d]\n[d]\n[d]\n[g][g]                  [h]                     [i]\n   [g]                                          [i]\n   [g]                                          [i][i]\n                                                   [i]\n                                                   [i]\n[j]                     [k]\n                        [k][k]\n                           [k]\n                           [k][k]"
,"[a][a]                  [b]                     [c][c]\n[a][a][a]               [b][b]\n      [a]\n[d]                     [e]                     [f]\n[d]                     [e]                     [f]\n[d][d][d]               [e]\n   [d]\n[g]                     [h][h][h]               [i][i][i]\n                                                [i][i][i]\n[j][j]\n   [j]\n   [j]"
,"[a][a][a][a]            [b]                     [c]\n                                                [c][c]\n                                                [c][c][c]\n[d][d][d]               [e][e][e]               [f]\n                           [e][e]               [f]\n                                                [f]\n[g]                     [h]                     [i]\n[g]                     [h]                     [i]\n                        [h]                     [i]\n                        [h]                     [i][i][i]\n                        [h]\n[j]"
,"[a]                     [b]                     [c][c][c]\n[a]                     [b]\n[a][a]                  [b][b]\n                        [b][b]\n[d][d]                  [e]                     [f]\n   [d][d]               [e][e]\n      [d]                  [e]\n      [d]                  [e]\n                           [e]\n[g][g]                  [h]                     [i]\n                        [h]\n                        [h]\n                        [h]\n                        [h]\n[j][j]"
,"[a]                     [b][b][b][b]            [c]\n[a]\n[a][a][a][a]\n[d]                     [e]                     [f]\n[d]                     [e]                     [f]\n                        [e]                     [f]\n[g][g][g]               [h][h][h]               [i][i]\n[g][g][g]               [h][h][h]               [i][i]\n[j]"
,"[a]                     [b][b][b][b]            [c]\n[a][a]                        [b][b]\n[a][a][a]\n[d]                     [e][e]                  [f][f]\n[d]                     [e][e]                     [f]\n[d]\n[d]\n[g][g][g]               [h]                     [i]\n                        [h][h][h]\n                        [h][h]\n[j][j]"
,"[a][a]                  [b]                     [c][c][c][c][c]\n[a][a][a]\n[d][d][d]               [e]                     [f][f]\n      [d]\n      [d]\n[g]                     [h]                     [i]\n[g][g][g]               [h]                     [i]\n   [g][g]                                       [i]\n[j]\n[j]\n[j][j]\n[j][j]"
,"[a][a][a]               [b]                     [c]\n                        [b][b][b]               [c]\n                        [b][b]                  [c]\n                                                [c]\n                                                [c]\n[d][d]                  [e]                     [f][f]\n                                                [f][f]\n[g][g][g]               [h]                     [i]\n      [g]                                       [i][i]\n      [g][g]                                    [i][i][i]\n[j]\n[j]"
,"[a]                     [b][b]                  [c]\n[d]                     [e]                     [f]\n[d]\n[g][g]                  [h][h]                  [i]\n[g][g][g]                                       [i]\n      [g]                                       [i][i]\n                                                   [i][i]\n[j][j][j]               [k]                     [l]\n                        [k]                     [l]\n                        [k]                     [l]\n                                                [l][l]\n                                                   [l]\n[m]\n[m]"
,"[a]                     [b]                     [c]\n                        [b]                     [c]\n                        [b][b]\n                           [b][b]\n[d][d][d][d][d]         [e]                     [f][f][f]\n                                                [f][f][f]\n[g]                     [h]                     [i][i]\n[g]                     [h][h]                     [i][i]\n[g]                                                [i][i]\n[j]\n[j]\n[j]"
,"[a]                     [b][b][b]               [c]\n[a][a]                        [b]               [c]\n[a][a][a]                     [b][b]            [c]\n[d][d]                  [e]                     [f]\n                                                [f][f][f]\n                                                [f][f]\n[g][g][g]               [h]                     [i]\n                        [h]                     [i]\n[j][j]                  [k]\n[j][j]"
,"[a][a][a]               [b][b][b]               [c]\n      [a]               [b][b][b]               [c]\n      [a]\n[d]                     [e]                     [f]\n[d]                     [e][e][e]               [f]\n[d]                        [e][e]\n[g]                     [h]                     [i][i][i]\n[g]\n[g][g]\n   [g]\n   [g]\n[j][j]"
,"[a]                     [b]                     [c][c][c][c]\n[a][a]                  [b]\n   [a]                  [b]\n   [a][a]\n[d]                     [e]                     [f]\n                        [e]\n                        [e][e]\n                           [e]\n                           [e]\n[g][g]                  [h]                     [i]\n                        [h]                     [i]\n[j]                     [k]                     [l][l]\n                        [k]                        [l][l]\n                                                   [l][l]"
,"[a]                     [b]                     [c]\n[d]                     [e]                     [f]\n[d][d]                  [e]                     [f]\n   [d][d]               [e][e]                  [f]\n      [d]                  [e][e]\n[g]                     [h]                     [i][i][i][i]\n[g]                     [h]\n[j][j][j]               [k]\n   [j][j]               [k][k][k]\n      [j]"
,"[a]                     [b]                     [c]\n[a]\n[a]\n[a]\n[d]                     [e][e][e][e]            [f][f]\n                                                [f][f]\n[g][g][g]               [h]                     [i][i][i]\n                        [h]                     [i][i][i]\n                        [h][h][h][h]\n[j]\n[j]\n[j]\n[j][j][j]"
,"[a][a]                  [b]                     [c]\n[a][a]\n[d][d][d][d][d]         [e]                     [f]\n                        [e][e][e]               [f]\n                              [e][e]            [f]\n                                                [f]\n                                                [f]\n[g]                     [h]                     [i]\n[g]                     [h][h]\n[g][g]\n   [g][g]\n[j][j][j]\n      [j]"
,"[a]                     [b][b][b]               [c]\n[a]                           [b]               [c]\n[a][a][a]                     [b]               [c]\n                              [b]\n[d]                     [e][e]                  [f][f]\n                                                [f][f]\n[g]                     [h]                     [i]\n[g]                     [h][h][h]               [i]\n                        [h][h]                  [i]\n[j]                     [k][k][k]"
,"[a]                     [b]                     [c]\n                        [b]                     [c]\n                        [b][b]\n                        [b][b]\n[d]                     [e]                     [f]\n[d]                     [e]\n[d]                     [e]\n[d]\n[d][d]\n[g]                     [h]                     [i][i]\n[g][g]                  [h][h]                     [i]\n                           [h][h]\n                              [h]\n[j]                     [k][k][k][k]"
,"[a][a]                  [b]                     [c][c][c][c][c]\n                        [b]\n                        [b]\n[d]                     [e]                     [f][f][f]\n                        [e]                     [f][f][f]\n[g]                     [h][h]                  [i]\n                           [h]                  [i]\n                           [h]                  [i][i]\n                                                   [i][i]\n[j]\n[j]\n[j]\n[j]\n[j][j]"
,"[a][a][a]               [b][b]                  [c][c]\n                        [b][b]\n[d]                     [e]                     [f][f]\n[d]                     [e]                     [f][f]\n[d]\n[g]                     [h]                     [i]\n                        [h]                     [i][i]\n                        [h]                     [i][i][i]\n                        [h]\n                        [h]\n[j][j][j]\n   [j][j]\n      [j]"
,"[a][a]                  [b][b]                  [c]\n[a][a]                                          [c][c]\n[a][a]                                             [c]\n                                                   [c]\n                                                   [c]\n[d]                     [e][e][e]               [f]\n                                                [f]\n                                                [f]\n[g]                     [h][h][h]               [i]\n[g]                        [h][h]               [i]\n[j]\n[j]\n[j][j]\n   [j]\n   [j]"
,"[a][a]                  [b]                     [c]\n[a][a]                  [b]                     [c]\n                        [b][b][b]               [c]\n                              [b]               [c][c][c]\n[d]                     [e]                     [f][f]\n[d]\n[g][g][g]               [h][h][h]               [i]\n                                                [i]\n                                                [i]\n[j]\n[j]\n[j]\n[j]\n[j][j]"
]

to=0
function update() {
  var nt=+I.value
  var test = Test[nt-1]
  if (test) {
    O.textContent = test
    clearTimeout(to)
    to = setTimeout(_=>{
      I.disabled = true
      var t = + new Date()
      var [d,r]=F(test)
      O.textContent = 'Time '+(new Date-t)/1000+' sec'+d+r.join`\n`+'\n'+test
      I.disabled = false
    }, 800)
  }
}

update()
Test # <input id=I value=1 type=number oninput='update()' max=101 min=1> (1 to 101, be patient: some testcase is slow to solve)
<pre id=O></pre>


还有其他测试用例链接到“测试案例”文本。
乔纳森·皮卡佐

1
@JonathanMicaelPicazo添加了
edc65
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.