Que algoritmo horrível! Nada bom na TL