Before revision:  For any positive integer q>1 , our algorithm takes q^{ \Theta (n)} time and requires q ^{ \Theta(n /q ) } memory.
After revision:  For any positive integer 4\leq q\leq \sqrt{n , our algorithm takes q^{ \Theta (n)} time and requires q ^{ \Theta(n /q ) } memory.