using static System.Math; using System; public class Hello { static void Main() { var n0 = int.Parse(Console.ReadLine().Trim()); getAns(n0); } static void getAns(int n0) { var p = 0; var nmax = n0; if (n0 == 1) { Console.WriteLine("0\n1"); return; } var i1 = 1000; while (p++ < 400) { if (n0 % 2 == 0) { n0 /= 2; if (n0 == 1) { i1 = Min(i1, p); Console.WriteLine("{0}\n{1}",i1,nmax); return; } } else { n0 = 3 * n0 + 1; nmax = Max(nmax, n0); } } Console.WriteLine("{0}\n{1}", i1, nmax); } }