Mai intai trebuie sa te autentifici.
Diferente pentru problema/occurences intre reviziile #4 si #1
Nu exista diferente intre titluri.
Diferente intre continut:
== include(page="template/taskheader" task_id="occurences") ==
You are given an integer $n$ and you have to do one operation at a time: $1.$ If $n$ is odd, you must multiple it by $3$ and add $1$ to the result. $2.$ If $n$ is even, you must divide it by $2$. What is the number with maximum occurrences if you do $10^100$ operations on the given number $n$?
Poveste şi cerinţă...
h2. Date de intrare
The first line of the file $occurences.in$ will contain $t$, the number of test cases. Each of the next $t$ lines will contain a single number $n$, .
Fişierul de intrare $occurences.in$ ...
h2. Date de ieşire
Oneach lineof theoutput file $occurences.out$we will print an integer, representing the answer to the problem.If there are multiple solutions, print the biggest one of them.
În fişierul de ieşire $occurences.out$ ...
h2. Restricţii
* $1 ≤ n ≤ 10^18$ * $1 ≤ t ≤ 10^5$ * For tests worth $50$ points, $1 ≤ n ≤ 1000$.
* $... ≤ ... ≤ ...$
h2. Exemplu table(example). |_. occurences.in |_. occurences.out |
| 3 2 18 1 | 2 4 1
| This is some text written on multiple lines. | This is another text written on multiple lines.
| h3. Explicaţie
For the first sample test case, the numbers printed will be $2$, $1$, $4$, $2$, $1$,..., and therefore $2$ and $1$ will show up one more time than the other numbers. Since we need to print the biggest integer, then we will print $2$.
...
== include(page="template/taskfooter" task_id="occurences") ==