#include #include #include #include #include #include #include using namespace std; using ll = long long; int dp[1<<14][15][15]; int main(){ int n,a,b; cin>>n>>a>>b; vector x(n),y(n),k(n); for(int i = 0;i>x[i]>>y[i]>>k[i]; for(int i = 0;i<1<>j&1) ni = j; for(int j = 0;j>m&1) continue; int nxt = i | 1<=2); bool ok = false; if(abs(k[l]-k[m])>=b) dp[nxt][l][m] = 1; if(cnt==2){ if(a<=abs(x[l]-x[m])+abs(y[l]-y[m])) dp[nxt][l][m] = 1; } if(cnt>=3){ if(a<=abs(x[l]-x[m])+abs(y[l]-y[m])+abs(x[j]-x[m])+abs(y[j]-y[m])) dp[nxt][l][m] = 1; } } } } } int ans = 0; for(int i = 0;i<1<