Uber OA | Good Question
Anonymous User
3921

Given 3 positive integers K, L ,N where K <= L <= N
A integer set T of size L is called good if all integers in T are dstinct and lie in range [1, N]
Let S be the set of all such possible sets T of given length L.

Let A be the uniformly and randomly chosen set from S. J(A) be the Kth smallest integer in this set A. Find sum of J(A) modulo 998244353 over all such good sets A.

Solve this for Q such query.
Input is given in form of 3 arrays Ks, Ls, Ns each size of Q.
ith query consists of K = ks[i], L = ls[i], N = ns[i].

Constraints:

  • 1 <= Q <= 10^3
  • 1 <= K <= L <= N <= 10^6

Sample Input:
ks: [2, 1, 2, 3]
ls: [2, 1, 2, 3]
ns: [3, 1, 2, 3]

Output:
[5, 1, 2, 3]

  • I was struggling to understand what the question is asking me to do.
Comments (3)