import std.algorithm, std.array, std.container, std.range, std.bitmanip; import std.numeric, std.math, std.bigint, std.random, core.bitop; import std.string, std.regex, std.conv, std.stdio, std.typecons; void main() { auto k = readln.chomp.to!int; real calc(real pseudo) { auto pi = new real[](k + 6); pi[k] = 0; pi[k + 1..k + 6] = pseudo; foreach_reverse (i; 0..k) pi[i] = (pi[i + 1..i + 7].sum) / 6 + 1; return pi[0]; } auto p = 0.001; while (calc(p) > p) p *= 2; auto r = iota(p / 2, p, 0.001).assumeSorted!((a, _) => calc(a) >= a).lowerBound(0); writefln("%.3f", r.back); }