98.5% (64/65)

44.5% (109/245)

# Description

Collatz conjecture, also known as 3n+1 problem, which is a conjecture in mathematics that is about a sequence defined as follows:
Let $S_1$ be a positive integer which is the start of the sequence, and

S_{n+1}= \begin{align} \begin{cases} S_n\ /\ 2&,\text{if }S_n\text{ is even} \\ 3\ S_n\ +\ 1&,\text{if }S_n\text{ is odd} \\ \end{cases} \end{align}

The conjecture is that for any given positive integer $S_1\ (<10^ 5)$, the sequence will reach $1$.
e.g. Given $S_1 = 22$,
the sequence will be: $22\ 11\ 34\ 17\ 52\ 26\ 13\ 40\ 20\ 10\ 5\ 16\ 8\ 4\ 2\ 1$

As students of NCKU, we are interested in this conjecture,
please write a program to help us do some research in this conjecture.

# Input Format

A positive integer $S_1\ (1 < S_1 < 10^ 5)$

# Output Format

Two integer $L\ M$ within a line, where $L$ represents the length of the sequence and $M$ is the maximum number of the sequence.

22

16 52

# Problem Source

No. Testdata Range Score
1 0~11 100

# Testdata and Limits

No. Time Limit (ms) Memory Limit (KiB) Output Limit (KiB) Subtasks
0 1000 65536 65536 1
1 1000 65536 65536 1
2 1000 65536 65536 1
3 1000 65536 65536 1
4 1000 65536 65536 1
5 1000 65536 65536 1
6 1000 65536 65536 1
7 1000 65536 65536 1
8 1000 65536 65536 1
9 1000 65536 65536 1
10 1000 65536 65536 1
11 1000 65536 65536 1