当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
A full Steiner topology for a given point set P = {p1, p2, …, pn} is an undirected tree T = (V, E) where V = {v1, v2, …, vn, vn+1, …, v2n−2} is the set of vertices, and E is the set of edges. The n distinctly labeled leaves of T, v1, v2, …, vn, correspond to p1, p2, …, pn, respectively; the remaining n − 2 vertices, vn+1, vn+2, …, v2n−2, called the Steiner vertices, are mutually indistinguishable and each have a degree of three. Figure 2 shows the only full Steiner topology for P = {p1, p2, p3}. Figure 3 shows all three different full Steiner topologies for P = {p1, p2, p3, p4}.
Figure 2: Full Steiner topology for P = {p1, p2, p3}
Figure 3: Full Steiner topologies for P = {p1, p2, p3, p4}
Given n, the cardinality of P, compute the number of distinct full Steiner topologies.
The input contains multiple test cases. Each test case consists of a single integer n (3 ≤ n ≤ 107) on a separate line. The input ends where EOF is met.
For each test case, print the answer on a separate line. You shall print the answer rounded to four significant digits. Let m · 10e be the scientific form of the rounded answer, you shall print “mEe”, giving all four significant digits of m and stripping any leading zeroes before e.
3 30 300 3000 30000 300000 3000000
1.000E0 8.687E36 5.677E697 1.462E10024 1.983E130306 4.215E1603145 7.937E19031556
时间上限 | 内存上限 |
1000 | 131072 |