import std.algorithm, std.conv, std.range, std.stdio, std.string; import std.random; // random const auto iter = size_t(1_000_000); void main() { auto n = readln.chomp.to!size_t; auto k = readln.chomp.to!size_t; auto d1 = [1, 1, 1, 1, 1, 1]; auto d2 = [0, 0, 0, 1, 1, 1]; auto w = size_t(0); foreach (_; iter.iota) { auto taro = chain((n - k).iota.map!(_ => dice(d1)), k.iota.map!(_ => dice(d2))).sum; auto jiro = n.iota.map!(_ => dice(d1)).sum; if (taro > jiro) ++w; } writefln("%.5g", w.to!real / iter); }