Thuật toán mới rất tốt. Cảm ơn @nikitabier