VACA, 297 291 bytes
MoOMoOMoOMoOMoOMoOMoOMoOMoOMoOmoOMoOmoOmoOoommOoMoOMOOmoOMMMmoOMMMmoOOOOMoOmOoMOOMOomoOmoO
MOOMOomOoMOomoOmoomOoMMMOOOMoOmoOMMMmOomOomoomoOmoOMOOMOomOomOomOoMOomoOmoOmoOmoomOomOomOo
mOomOoMMMmoOMMMMOOMOomoOOOMmOomOoMoOmoOmoomOomOoMoomoOmoOmoOMOOMOoMOomoOMoOmOomoomoOMMMOOO
mOoMMMMMMmOoMMMMOomoo
Pruébalo en línea!
El código imprime cada número en su propia línea y separa las iteraciones con una nueva línea adicional. También imprime la primera iteración por sí misma, seguida de una nueva línea. Por lo tanto, una entrada de 5 daría una salida que se parece 5 2 2
excepto con líneas nuevas en lugar de espacios. La salida de muestra para 50
se da a continuación.
Árbol de explicaciones:
MoOMoOMoOMoOMoOMoOMoOMoOMoOMoOmoOMoOmoOmoOoom ;Store 10 in [0], 1 in [1], and integer input in [3]
mOoMoO ;Store 1 in [2]
MOO ;Loop while [2] is non-zero
moOMMMmoOMMMmoOOOOMoOmOo ; Copy [3] to [4], clear contents of [5], and store 1 in [5]
MOO ; Loop while [4] is non-zero
MOomoOmoO ; Decrement 4 and move to 6
MOO ; Loop while [6] is non-zero
MOomOoMOomoO ; Decrement [5] and [6]
moo ; End loop once [6] is empty
mOoMMMOOOMoOmoOMMMmOomOo ; Copy [5] to [6], and reset [5] to 1, then move back to [4]
moo ; End loop now that [4] is empty. [6] now contains the parity of [3]
moOmoO ; Navigate to [6]
MOO ; Loop while [6] is non-empty
MOomOomOomOoMOomoOmoOmoO ; Decrememnt [3] and [6]
moo ; End loop now that [6] is empty. [3] now contains the largest even number less than the previous iteration.
mOomOomOomOomOoMMMmoOMMM ; Copy [1] to [2]
MOO ; Loop while [2] is non-empty
MOomoOOOMmOomOoMoOmoO ; Decrement [2], increment [1], and print the number in [3].
moo ; End loop now that [2] is empty
mOomOoMoo ; Print a new line
moOmoOmoO ; Navigate to [3]
MOO ; Loop while [3] is non-empty
MOoMOomoOMoOmOo ; Decrement [3] twice and increment [4] once
moo ; [4] now contains half of [3]
moOMMMOOOmOoMMM ; Copy [4] to [3] and clear [4]
MMMmOoMMMMOo ; Copy [3] to [2] and decrement once
moo ;End loop now that [2] is empty
Salida de muestra para la entrada 50:
50
24
24
12
12
12
12
6
6
6
6
6
6
6
6
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2