#include #include"testlib.h" using namespace std; using ll = long long; const ll Nmin = 1, Nmax = 200'000; const ll Mmin = 1, Mmax = 200'000; const ll ABCmin = 0, ABCmax = 100; const ll XYZmin = -100, XYZmax = 100; int main(){ registerValidation(); ll n = inf.readLong(Nmin,Nmax); inf.readSpace(); ll m = inf.readLong(Mmin,Mmax); inf.readEoln(); set> abc; for (ll i = 0; i < n; i++){ ll a = inf.readLong(ABCmin,ABCmax); inf.readSpace(); ll b = inf.readLong(ABCmin,ABCmax); inf.readSpace(); ll c = inf.readLong(ABCmin,ABCmax); inf.readEoln(); abc.insert(make_tuple(a,b,c)); } ensuref((ll)(abc.size()) == n, "(A,B,C) must be distinct"); set> xyz; for (ll i = 0; i < m; i++){ ll x = inf.readLong(XYZmin,XYZmax); inf.readSpace(); ll y = inf.readLong(XYZmin,XYZmax); inf.readSpace(); ll z = inf.readLong(XYZmin,XYZmax); inf.readEoln(); xyz.insert(make_tuple(x,y,z)); } ensuref((ll)(xyz.size()) == m, "(X,Y,Z) must be discinct"); for (auto [a, b, c] : abc) for (auto [x, y, z] : xyz){ ensure(ABCmin <= a+x && a+x <= ABCmax); ensure(ABCmin <= b+y && b+y <= ABCmax); ensure(ABCmin <= c+z && c+z <= ABCmax); } inf.readEof(); }