#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c> n; ll cnt = 0; set ok; ll mx = n; bool f = true; ok.insert(n); if(n==1){ cnt = 0; f = false; } while(n!=1){ if(n%2==0) n/=2; else n = 3*n+1; mx = max(mx, n); if(ok.find(n)!=ok.end()) break; ok.insert(n); if(f) cnt++; if(n==1&&f) break; } std::cout << cnt << '\n'; std::cout << mx << '\n'; return 0; }