{"problem":{"name":"Warp","description":{"content":"Takahashi is at the origin of a two-dimensional plane.   Takahashi will repeat teleporting $N$ times. In each teleportation, he makes one of the following moves: *   Move from the current coordinates","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":3000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc265_e"},"statements":[{"statement_type":"Markdown","content":"Takahashi is at the origin of a two-dimensional plane.  \nTakahashi will repeat teleporting $N$ times. In each teleportation, he makes one of the following moves:\n\n*   Move from the current coordinates $(x,y)$ to $(x+A,y+B)$\n*   Move from the current coordinates $(x,y)$ to $(x+C,y+D)$\n*   Move from the current coordinates $(x,y)$ to $(x+E,y+F)$\n\nThere are obstacles on $M$ points $(X_1,Y_1),\\ldots,(X_M,Y_M)$ on the plane; he cannot teleport to these coordinates.\nHow many paths are there resulting from the $N$ teleportations? Find the count modulo $998244353$.\n\n## Constraints\n\n*   $1 \\leq N \\leq 300$\n*   $0 \\leq M \\leq 10^5$\n*   $-10^9 \\leq A,B,C,D,E,F \\leq 10^9$\n*   $(A,B)$, $(C,D)$, and $(E,F)$ are distinct.\n*   $-10^9 \\leq X_i,Y_i \\leq 10^9$\n*   $(X_i,Y_i)\\neq(0,0)$\n*   $(X_i,Y_i)$ are distinct.\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $M$\n$A$ $B$ $C$ $D$ $E$ $F$\n$X_1$ $Y_1$\n$X_2$ $Y_2$\n$\\vdots$\n$X_M$ $Y_M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc265_e","tags":[],"sample_group":[["2 2\n1 1 1 2 1 3\n1 2\n2 2","5\n\nThe following $5$ paths are possible:\n\n*   $(0,0)\\to(1,1)\\to(2,3)$\n*   $(0,0)\\to(1,1)\\to(2,4)$\n*   $(0,0)\\to(1,3)\\to(2,4)$\n*   $(0,0)\\to(1,3)\\to(2,5)$\n*   $(0,0)\\to(1,3)\\to(2,6)$"],["10 3\n-1000000000 -1000000000 1000000000 1000000000 -1000000000 1000000000\n-1000000000 -1000000000\n1000000000 1000000000\n-1000000000 1000000000","0"],["300 0\n0 0 1 0 0 1","292172978"]],"created_at":"2026-03-03 11:01:14"}}