fork download
  1. #include <iostream>
  2. using namespace std;
  3. string A(long long N) {return N == 0 ? "" : A((N - 1) / 5) + "13579"[(N - 1) % 5];}
  4. int main() {
  5. long long N;
  6. cin >> N, cout << A(N);
  7. return 0;
  8. }
Success #stdin #stdout 0s 5284KB
stdin
1000000000000000000
stdout
51571955777777777777777779