#include using namespace std; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a void drop(const T &x){cout< > G; vector used,indeg,ps; TopologicalSort(){} TopologicalSort(int n):G(n),used(n,0),indeg(n,0){} void add_edge(int s,int t){ G[s].emplace(t); indeg[t]++; } void bfs(int s){ queue que; que.emplace(s); used[s]=1; while(!que.empty()){ int v=que.front();que.pop(); ps.emplace_back(v); for(int u:G[v]){ indeg[u]--; if(indeg[u]==0&&!used[u]){ used[u]=1; que.emplace(u); } } } } vector build(){ int n=G.size(); for(int i=0;i>n>>k; if(n*(n-1) vs(n,-1); vs[n-(x+1)]=n-1; for(int i=0,j=0;i vs){ int n=vs.size(); vector rs(n); for(int i=0;i ord(n); iota(ord.begin(),ord.end(),0); while(k){ for(int i=0;i+1