MARINE: Theoretical Optimization and Design for Multi-Agent Recursive IN-context Enhancement