#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(int i=0;i> N; for(i=0;i> g[i][j]; } } int e=-1; for(i=0;i