Problem 5 solved, but is much slow, i need improve it