#define _USE_MATH_DEFINES #include #include /* #include #include #include */ #include #include #include /* #include #include #include #include #include #include #include//assert(); */ //#include //xAOJ ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)< ///////// typedef long long LL; typedef long double LD; typedef unsigned long long ULL; ///////// using namespace::std; ///////// ///////// ULL popcount(ULL N){ ULL ret = N; ret = ((0xAAAAAAAAAAAAAAAA & ret)>> 1) + (0x5555555555555555 & ret); ret = ((0xCCCCCCCCCCCCCCCC & ret)>> 2) + (0x3333333333333333 & ret); ret = ((0xF0F0F0F0F0F0F0F0 & ret)>> 4) + (0x0F0F0F0F0F0F0F0F & ret); ret = ((0xFF00FF00FF00FF00 & ret)>> 8) + (0x00FF00FF00FF00FF & ret); ret = ((0xFFFF0000FFFF0000 & ret)>>16) + (0x0000FFFF0000FFFF & ret); ret = ((0xFFFFFFFF00000000 & ret)>>32) + (0x00000000FFFFFFFF & ret); return ret; } int to_num(ULL* ans, string str,const int keta){ int len = str.length(); string temp; ULL pow10 = 1; int pos = 0; ans[0] = 0; for(int i= 0;i=0;--i){ cout << num[i]; }cout << endl; } }; void solve(){ string str; cin >> str; vnum Num; Num.set(str); ULL count = 0; ULL test = 0; while(Num.len != Num.start){ count += Num.div(); //Num.view(); } cout << count%((ULL)1004535809) << endl; } int main(void){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed;// //cout << setprecision(16);// solve(); return 0; }