{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eA Bell number \u003cstrong\u003eB_n\u003c/strong\u003e is equal to the quantity of ways, in which a set of \u003cstrong\u003en\u003c/strong\u003e elements can be partitioned into disjoint non-empty subsets. For example, \u003cstrong\u003eB_3\u003c/strong\u003e \u003d 5, because we have 5 possible partitions of the set \\{\u003cstrong\u003ea\u003c/strong\u003e, \u003cstrong\u003eb\u003c/strong\u003e, \u003cstrong\u003ec\u003c/strong\u003e\\}: \\{\\{\u003cstrong\u003ea\u003c/strong\u003e\\}, \\{\u003cstrong\u003eb\u003c/strong\u003e\\}, \\{\u003cstrong\u003ec\u003c/strong\u003e\\}\\}, \\{\\{\u003cstrong\u003ea\u003c/strong\u003e, \u003cstrong\u003eb\u003c/strong\u003e\\}, \\{\u003cstrong\u003ec\u003c/strong\u003e\\}\\}, \\{\\{\u003cstrong\u003ea\u003c/strong\u003e, \u003cstrong\u003ec\u003c/strong\u003e\\}, \\{\u003cstrong\u003eb\u003c/strong\u003e\\}\\}, \\{\\{\u003cstrong\u003ea\u003c/strong\u003e\\}, \\{\u003cstrong\u003eb\u003c/strong\u003e, \u003cstrong\u003ec\u003c/strong\u003e\\}\\}, \\{\\{\u003cstrong\u003ea\u003c/strong\u003e, \u003cstrong\u003eb\u003c/strong\u003e, \u003cstrong\u003ec\u003c/strong\u003e\\}\\}.\u003c/p\u003e\n\n\u003cp\u003eAdditionally consider, that \u003cstrong\u003eB_0\u003c/strong\u003e \u003d 1.\u003c/p\u003e\n\n\u003cp\u003eRegard a determinant \u003cstrong\u003eD_n\u003c/strong\u003e, given on the figure.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src\u003d\"https://static.e-olymp.com/content/f0/f065d04a230f47e10a5d516ae0ba21134eea9b81.gif\" /\u003e\u003c/p\u003e\n\n\u003cp\u003eFor a given prime number \u003cstrong\u003ep\u003c/strong\u003e find the greatest integer \u003cstrong\u003ek\u003c/strong\u003e, for which \u003cstrong\u003eD_n\u003c/strong\u003e is divisible by \u003cstrong\u003ep^k\u003c/strong\u003e\u003c/p\u003e\n\n.\n\n\u003cp\u003e\u003ch2\u003eInput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003eEach line of input contains two integers \u003cstrong\u003en\u003c/strong\u003e and \u003cstrong\u003ep\u003c/strong\u003e (\u003cstrong\u003e0\u003c/strong\u003e ≤ \u003cstrong\u003en\u003c/strong\u003e, \u003cstrong\u003ep\u003c/strong\u003e ≤ \u003cstrong\u003e10000\u003c/strong\u003e). It is known, that \u003cstrong\u003ep\u003c/strong\u003e is prime.\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eOutput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003eFor each pair of input values \u003cstrong\u003en\u003c/strong\u003e and \u003cstrong\u003ep\u003c/strong\u003e on a separate line output the greatest integer \u003cstrong\u003ek\u003c/strong\u003e, for which \u003cstrong\u003eD_n\u003c/strong\u003e is divisible by \u003cstrong\u003ep^k\u003c/strong\u003e\u003c/p\u003e\n\n\n\n"}},{"title":"Example","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 5\n3 2\n4 2\n4 3\n10000 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n2\n5\n2\n24962375\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}