{"problem":{"name":"≥ K","description":{"content":"You are given a sequence of length $N$, $A = (A_1, ..., A_N)$, and an integer $K$.   How many permutations of $A$ are there such that no two adjacent elements sum to less than $K$? Find the count modu","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc148_e"},"statements":[{"statement_type":"Markdown","content":"You are given a sequence of length $N$, $A = (A_1, ..., A_N)$, and an integer $K$.  \nHow many permutations of $A$ are there such that no two adjacent elements sum to less than $K$? Find the count modulo $998244353$.\n\n## Constraints\n\n*   $2 \\leq N \\leq 2 \\times 10^5$\n*   $0 \\leq K \\leq 10^9$\n*   $0 \\leq A_i \\leq 10^9$\n*   All values in the input are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $K$\n$A_1$ $A_2$ $\\dots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc148_e","tags":[],"sample_group":[["4 5\n1 2 3 4","4\n\nThe following four permutations satisfy the condition:\n\n*   $(1, 4, 2, 3)$\n*   $(1, 4, 3, 2)$\n*   $(2, 3, 4, 1)$\n*   $(3, 2, 4, 1)$"],["4 3\n1 2 3 3","12\n\nThere are $12$ permutations of $A$, all of which satisfy the condition."],["10 7\n3 1 4 1 5 9 2 6 5 3","108"]],"created_at":"2026-03-03 11:01:14"}}