{"problem":{"name":"Distance Sequence","description":{"content":"How many integer sequences $A=(A_1,\\ldots,A_N)$ of length $N$ satisfy all the conditions below? *   $1\\le A_i \\le M$ $(1 \\le i \\le N)$      *   $|A_i - A_{i+1}| \\geq K$ $(1 \\le i \\le N - 1)$      Si","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc253_e"},"statements":[{"statement_type":"Markdown","content":"How many integer sequences $A=(A_1,\\ldots,A_N)$ of length $N$ satisfy all the conditions below?\n\n*   $1\\le A_i \\le M$ $(1 \\le i \\le N)$\n    \n*   $|A_i - A_{i+1}| \\geq K$ $(1 \\le i \\le N - 1)$\n    \n\nSince the count can be enormous, find it modulo $998244353$.\n\n## Constraints\n\n*   $2 \\leq N \\leq 1000$\n*   $1 \\leq M \\leq 5000$\n*   $0 \\leq K \\leq M-1$\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$ $K$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc253_e","tags":[],"sample_group":[["2 3 1","6\n\nThe following $6$ sequences satisfy the conditions.\n\n*   $(1,2)$\n*   $(1,3)$\n*   $(2,1)$\n*   $(2,3)$\n*   $(3,1)$\n*   $(3,2)$"],["3 3 2","2\n\nThe following $2$ sequences satisfy the conditions.\n\n*   $(1,3,1)$\n*   $(3,1,3)$"],["100 1000 500","657064711\n\nPrint the count modulo $998244353$."]],"created_at":"2026-03-03 11:01:14"}}