Teaching LLM to Reason: Reinforcement Learning from Algorithmic Problems without Code