/* validation */ #include #include "testlib.h" using ll = long long; const ll n_min = 1, n_max = 50; const ll k_min = 1, k_max = 5; const ll t_sum_min = 1, t_sum_max = 100'000; int main() { registerValidation(); int n = inf.readLong(n_min, n_max); inf.readSpace(); int k = inf.readLong(k_min, k_max); inf.readEoln(); int t_sum = 0; for(int i = 0; i < k; i++) { int t = inf.readLong(); ensure(1 <= t); inf.readEoln(); for(int j = 0; j < t; j++) { int a = inf.readLong(1ll, n); inf.readSpace(); int b = inf.readLong(1ll, n); ensure(a != b); inf.readEoln(); } t_sum += t; } ensure(t_sum_min <= t_sum && t_sum <= t_sum_max); inf.readEof(); return 0; }