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; cin >> N; cout << A(N);
  6. return 0;
  7. }
Success #stdin #stdout 0.01s 5288KB
stdin
1000000000000000000
stdout
51571955777777777777777779