aboutsummaryrefslogtreecommitdiff
path: root/store/works/life/algorithm-contest-3/code/1.cpp
blob: 2c8ea1a7bd5d2e475d0ad5e39010d830ff0fa1cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>

int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);

  long long n;
  std::cin >> n;

  while (n) {
    std::cout << n << ' ';
    n /= 3;
  }

  return 0;
}