#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include using namespace std; typedef bitset<1030301> B; int main(){ int n, m; cin >> n >> m; vector a(n), b(n), c(n); vector x(m), y(m), z(m); for (int i=0; i> a[i] >> b[i] >> c[i]; } for (int i=0; i> x[i] >> y[i] >> z[i]; } B moto; for (int i=0; i= 0){ ans = max(ans, (int)(moto | (moto << t)).count()); }else{ ans = max(ans, (int)(moto | (moto >> -t)).count()); } } cout << ans << '\n'; }