/* 入力 validation。WA になれば OK。 */ #include "testlib.h" #include using namespace std; const int MIN_T = 0; const int MAX_T = 1; const int MIN_N = 1; const int MAX_N = 2000; const int MIN_M = 0; const int MAX_M = 2000; const int MIN_W = 1; const int MAX_W = 1000000000; int U[3000]; int V[3000]; int W[3000]; int main(){ registerValidation(); int T = inf.readInt(MIN_T, MAX_T, "T"); inf.readEoln(); int N = inf.readInt(MIN_N, MAX_N, "N"); inf.readSpace(); int M = inf.readInt(MIN_M, MAX_M, "M"); inf.ensuref(M <= N * (N-1) / 2, "M is too large"); inf.readEoln(); for(int i=0;i