{"raw_statement":[{"iden":"problem statement","content":"There are apple trees lined up on a number line, and $N$ apples fall from the trees.  \nSpecifically, for each $1\\leq i\\leq N$, an apple falls at coordinate $X_i$ at time $T_i$.\nTakahashi has a basket with durability $D$ and length $W$, and he can take the following action **exactly once**.\n\n> Choose positive integers $S$ and $L$. He sets up the basket to cover the range $L-0.5\\leq x\\leq L+W-0.5$ at time $S-0.5$, and retrieves it at time $S+D-0.5$. He gets all the apples that fell into the range covered by the basket between the time it was set up and the time it was retrieved.\n\nHe cannot move the basket once it has been set up, nor can he set it up again once it has been retrieved.  \nFind the maximum number of apples that he can get."},{"iden":"constraints","content":"*   $1 \\leq N\\leq 2\\times 10^5$\n*   $1 \\leq D\\leq 2\\times 10^5$\n*   $1 \\leq W\\leq 2\\times 10^5$\n*   $1 \\leq T_i\\leq 2\\times 10^5$\n*   $1 \\leq X_i\\leq 2\\times 10^5$\n*   All pairs $(T_i,X_i)$ are different.\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $D$ $W$\n$T_1$ $X_1$\n$T_2$ $X_2$\n$\\vdots$\n$T_N$ $X_N$"},{"iden":"sample input 1","content":"8 4 3\n1 1\n3 4\n6 4\n5 2\n4 2\n4 3\n5 5\n7 3"},{"iden":"sample output 1","content":"5\n\nIf Takahashi chooses $S=3$ and $L=2$, he will set up the basket to cover the range $1.5\\leq x\\leq 4.5$ from time $2.5$ to $6.5$. Then, he gets the following five apples:\n\n*   The apple that falls at coordinate $X_2=4$ at time $T_2=3$\n*   The apple that falls at coordinate $X_3=4$ at time $T_3=6$\n*   The apple that falls at coordinate $X_4=2$ at time $T_4=5$\n*   The apple that falls at coordinate $X_5=2$ at time $T_5=4$\n*   The apple that falls at coordinate $X_6=3$ at time $T_6=4$\n\nThere is no way to get six or more apples, so print $5$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}