#include #include #include using namespace std; int main() { string sum = "142857"; int n = 0; cin >> n; string ans = "0."; if (n == 0) { cout << "0" << endl; } else if (n == 6) { ans += sum; cout << ans << endl; } else if (n < 6) { ans += sum.substr(0, n); cout << ans << endl; } else { int div = n / 6; int amari = n % 6; for (int i = 1;i <= div;i++) { ans += sum; } if (amari != 0) { string str = sum.substr(0, amari); ans += str; } cout << ans << endl; } return 0; }