4 2 3 2
5 5 4 2 In this input, $N=4,K=2$. Here, the dictionary $s$ is $((1,2),(1,3),(1,4),(2,1),(2,3),(2,4),(3,1),(3,2),(3,4),(4,1),(4,2),(4,3))$. Among the sequences in the dictionary $s$ that are lexicographically less than or equal to $(3,2)$, * five sequences contain $1$: $(1,2),(1,3),(1,4),(2,1),(3,1)$, * five sequences contain $2$: $(1,2),(2,1),(2,3),(2,4),(3,2)$, * four sequences contain $3$: $(1,3),(2,3),(3,1),(3,2)$, * two sequences contain $4$: $(1,4),(2,4)$.
18 13 5 13 11 2 18 1 10 15 17 4 12 7 3
925879409 905921009 665544804 665544719 783035803 349952762 349952758 349952757 349952757 349921178 212092637 710350150 378895603 129113201 129111892 129098081 129096772 110181652
{
"problem": {
"name": "Existence Counting",
"description": {
"content": "You are given integers $N$ and $K$. Consider a sequence $a=(a_1,a_2,\\dots,a_K)$ of length $K$ that satisfies all of the following conditions: * $a_i$ is an integer such that $1 \\le a_i \\le N$. * ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 4000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc174_e"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given integers $N$ and $K$. Consider a sequence $a=(a_1,a_2,\\dots,a_K)$ of length $K$ that satisfies all of the following conditions:\n\n* $a_i$ is an integer such that $1 \\le a_i \\le N$.\n* ...",
"is_translate": false,
"language": "English"
}
]
}