According to the conclusions prufer sequence:
An unrooted trees corresponding to only one prufer sequence, a sequence also corresponds to a unique prufer unrooted trees.
Number of occurrences of a point sequence are prufer $ deg_ {i} $ times.
$ $ N-number of points spanning complete graph is $ n ^ {(n-2)} $ a.
code:
#include <cstdio> #include <algorithm> #define ll long long #define setIO(s) freopen(s".in","r",stdin) using namespace std; const ll mod=9999991; int main() { // setIO("input"); int i,j,n; scanf("%d",&n); ll ans=1; for(i=1;i<=n-2;++i) ans=1ll*n*ans%mod; for(i=n-1;i>=1;--i) ans=1ll*i*ans%mod; printf("%lld\n",ans); return 0; }