Galaxy, October 1974.
This is a classic 'problem' sf story - and as is proper in this genre-within-a-genre the solution is inherent in the problem!
Terry Jenkins
Argosy, September 1967.