#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 int main(){ int N,A,B; cin>>N>>A>>B; vector x(N),y(N),K(N); rep(i,N){ cin>>x[i]>>y[i]>>K[i]; } vector dp(1<(N,false))); rep(i,N){ dp[1<>l)&1)continue; bool f = false; if(abs(K[k]-K[l])>=B)f = true; int dist = abs(x[k]-x[l]) + abs(y[k]-y[l]); if(j!=k)dist += abs(x[l]-x[j]) + abs(y[l]-y[j]); if(dist >= A)f = true; if(f)dp[i|(1<