{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"The rhyme scheme for a poem (or stanza of a longer poem) tells which lines of the poem rhyme with which other lines. For example, a limerick such as If computers that you build are quantum\r\u003cbr\u003eThen spies of all factions will want \u0027em\r\u003cbr\u003eOur codes will all fail\r\u003cbr\u003eAnd they\u0027ll read our email\r\u003cbr\u003e`Til we\u0027ve crypto that\u0027s quantum and daunt \u0027em\r\u003cbr\u003e\r\u003cbr\u003eJennifer and Peter Shor (http://www.research.att.com/~shor/notapoet.html)\r\u003cbr\u003e\r\u003cbr\u003eHas a rhyme scheme of aabba, indicating that the first, second and fifth lines rhyme and the third and fourth lines rhyme.\r\u003cbr\u003eFor a poem or stanza of four lines, there are 15 possible rhyme schemes:\r\u003cbr\u003eaaaa, aaab, aaba, aabb, aabc, abaa, abab, abac, abba, abbb, abbc, abca, a bcb, abcc, and abcd.\r\u003cbr\u003eWrite a program to compute the number of rhyme schemes for a poem or stanza of N lines where N is an input value."}},{"title":"Input","value":{"format":"HTML","content":"Input will consist of a sequence of integers N, one per line, ending with a 0 (zero) to indicate the end of the data. N is the number of lines in a poem."}},{"title":"Output","value":{"format":"HTML","content":"For each input integer N, your program should output the value of N, followed by a space, followed by the number of rhyme schemes for a poem with N lines as a decimal integer with at least 12 correct significant digits (use double precision floating point for your computations)."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n2\r\n3\r\n4\r\n20\r\n30\r\n10\r\n0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 1\r\n2 2\r\n3 5\r\n4 15\r\n20 51724158235372\r\n30 846749014511809120000000\r\n10 115975\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}