UVa 100 - The 3n + 1 problem

100 - The 3n + 1 problem

 * http://acm.uva.es/p/v1/100.html

Summary
A simple "follow the instruction" problem.

Explanation
Follow the instructions, there is nothing to it. Brute force will do.

Gotcha's

 * j can be smaller than i.

Input
1 10 100 200 201 210 900 1000 1000 900

Output
1 10 20 100 200 125 201 210 89 900 1000 174 1000 900 174