#include "testlib.h" #include using namespace std; constexpr int MIN_T = 0; constexpr int MAX_T = 1; constexpr int MIN_N = 1; constexpr int MAX_N = 2000; constexpr int MIN_M = 0; constexpr int MAX_M = 2000; constexpr int MIN_W = 1; constexpr int MAX_W = 1000000000; int main(int argc, char *argv[]) { registerValidation(argc, argv); 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.readEoln(); vector u(M),v(M),w(M); set> st; for(int i = 0; i < M; ++i) { u[i] = inf.readInt(1, N, format("u_%d", i+1)); inf.readSpace(); v[i] = inf.readInt(1, N, format("v_%d", i+1)); inf.readSpace(); w[i] = inf.readInt(MIN_W, MAX_W, format("w_%d", i+1)); inf.readEoln(); ensure(u[i]!=v[i]); ensure(st.count({u[i],v[i]})==0); ensure(st.count({v[i],u[i]})==0); st.insert({u[i],v[i]}); st.insert({v[i],u[i]}); } inf.readEof(); return 0; }