# Test case 1 - single node
{a}
{b}
2
{
1
}
# Test case 1a - single node
{a}
{b}
1
{
1
}
# Test case 2 - two equal paths
{a{b{c{d}}}}
{a{b{c{d}}}}
1
{
0@--
@0@-
-@0@
--@0
}
# Test case 3 - two small standard trees
{a{b}{c{d{e}{f}}}}
{a{b}{d{c{e}}{f}}}
2
{
0@@---
@01@--
@@@0@-
-@@@1@
--@@2@
---@@2
}
# Test case 3a - two small standard trees - k<TED
{a{b}{c{d{e}{f}}}}
{a{b}{d{c{e}}{f}}}
1
{
0@----
@0@---
-@@@--
--@@@-
---@@@
----@@
}
# Test case 4 - standard tree
{a{b{c}{d{e}}}{f{g}{h{i{j}{k}}}}{l{m}}}
{a{b{c}{d{e}}}{x{g}{h{i{j}{k}}}}{l{m}}}
2
{
0@@----------
@01@---------
@10@@--------
-@@0@@-------
--@@0@@------
---@@0@@-----
----@@0@@----
-----@@01@---
------@10@@--
-------@@1@@-
--------@@01@
---------@10@
----------@@1
}
# Test case 4a - standard tree + one node in destination
{a{b{c}{d{e}}}{f{g}{h{i{j}{k}}}}{l{m}}}
{a{b{c}{d{x}{e}}}{f{g}{h{i{j}{k}}}}{l{m}}}
1
{
0@------------
@@0-----------
-@@1----------
--@@1---------
---@@0--------
----@@0-------
-----@@0------
------@@0-----
-------@@0----
--------@@0---
---------@@0--
----------@@0-
-----------@@1
}
# Test case 5a; TED=3; k=4>TED
{a{x}{c{e}{f}}{d}}
{a{b}{c}{d}}
4
{
1@@@
11@@
111@
@2@@
@@0@
-@@3
}
# Test case 5b; TED=3; k=3=TED
{a{x}{c{e}{f}}{d}}
{a{b}{c}{d}}
3
{
1@@@
11@@
111@
@2@@
-@0@
--@3
}
# Test case 5c; TED=3; k=2<TED
{a{x}{c{e}{f}}{d}}
{a{b}{c}{d}}
2
{
@@@-
@@@@
@@@@
-2@@
--0@
---@
}
# Test case 6; TED=1; k=1=TED
{a{b}{c{d{e}{f}}}}
{a{b}{c{e}{f}}}
1
{
0@---
@0@--
-@0@-
--@@@
---1@
----1
}
