/* -*- coding: utf-8 -*- * * 428.cc: No.428 小数から逃げる夢 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const string D = "0.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991"; /* typedef */ typedef vector vi; /* global variables */ /* subroutines */ /* main */ int main() { vi d; for (int i = D.size() - 1; i >= 0 && D[i] >= '0' && D[i] <= '9'; i--) d.push_back(D[i] - '0'); int fp = d.size(); //printf("fp=%d\n", fp); int n; cin >> n; int co = 0; vi e; for (int i = 0; i < d.size(); i++) { int di = d[i] * n + co; co = di / 10; e.push_back(di % 10); } while (co > 0) { e.push_back(co % 10); co /= 10; } //printf("%lu\n", e.size()); if (fp >= e.size()) putchar('0'); else for (int i = e.size() - 1; i >= fp; i--) putchar(e[i] + '0'); putchar('.'); for (int i = fp - 1; i >= 0; i--) putchar(e[i] + '0'); putchar('\n'); return 0; }