#include using namespace std; using namespace std::chrono; using ll = long long; using ull = unsigned long long; using vi = vector; using vl = vector; using vb = vector; using vd = vector; using vs = vector; using vii = vector>; using vll = vector>; #define ALL(x) (x).begin(), (x).end() #define coutY cout << "Yes" << "\n"; #define coutN cout << "No" << "\n"; #define arrIn(arr, start, N) for (ll i = (start); i < (N); ++i) cin >> arr[i]; #define arrOut(arr, start, N) for (ll i = (start); i < (N); ++i) { cout << arr[i] <<" "; } cout << "\n"; #define UNIQUE(A) sort(ALL(A)); A.erase(unique(ALL(A)),A.end()); #define mod9 998244353 #define mod1 1000000007 const int intM=1e9; const ll llM=1e18; void yn(bool tf) { cout << (tf ? "Yes\n" : "No\n"); } void YN(bool tf) { cout << (tf ? "YES\n" : "NO\n"); } string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string abc="abcdefghijklmnopqrstuvwxyz"; vi dx={0,-1,1,0}; vi dy={-1,0,0,1}; vi ddx={-1,0,1,-1,1,-1,0,1}; vi ddy={-1,-1,-1,0,0,1,1,1}; template using priority_queueR = priority_queue, greater>; //cout << fixed << setprecision(20) << void arrOut2(auto A){ for(auto x:A){ for(auto y:x){ cout << y << " "; } cout << "\n"; } } bool kaibun(string S){ string T=S; reverse(ALL(S)); return S==T; } int ketawa(int x){ string S=to_string(x); int sum=0; int len=S.size(); for(int i=0;in)return 0; ll bunshi=1; for(ll i=1;i<=n;i++)bunshi=(bunshi*i)%m; ll bunbo=1; for(ll i=1;i<=r;i++)bunbo=(bunbo*i)%m; for(ll i=1;i<=n-r;i++)bunbo=(bunbo*i)%m; return (bunshi*Power(bunbo,m-2,m))%m; } // auto start = high_resolution_clock::now(); // bool CheckTime(auto limit,auto eps){ // auto end = high_resolution_clock::now(); // return duration_cast(end - start).count()> now; ll count=0; while(now!=1){ if(now%2==0)now/=2; else if(now%2==1)now=3*now+1; count++; } cout << count << "\n"; return 0; }