UVa 100 - The 3n + 1 problem

100 - The 3n + 1 problem

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

Summary
Follow the instructions, there is nothing to it. Bruteforce will do.

Explanation
A "follow the instruction" problem.

Even with no optimizations, one can past with more than enough time. The relatively low acceptance rate comes from that it's usually the first problem people attempt - people who are unfamiliar with the system. The Gotcha is a good one - it tells you to never make assumptions on judges and programming contests.

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