#P4241. 采摘毒瘤

采摘毒瘤

Description

There are nn different types of tumors by the roadside. For type ii, there are kik_i items available, and each item occupies did_i units of space. Salamander’s bag has a maximum total volume capacity of mm.

Salamander is very greedy, but he does not require taking as many items as possible or achieving the largest possible total volume. He only requires that the bag can no longer fit any tumor of any remaining type.

Formally, choose integers xix_i with 0xiki0 \le x_i \le k_i for each ii, such that ixidim\sum_i x_i d_i \le m, and if xi<kix_i < k_i then the remaining capacity mixidi<dim - \sum_i x_i d_i < d_i for every such ii.

Salamander wants to know how many different packing schemes there are. Two schemes are different if and only if the set of types taken is different, or there exists at least one type for which the taken quantity is different. Since the number of schemes can be large, output the answer modulo 1926081719260817.

Input Format

The first line contains two positive integers nn and mm, the number of tumor types and the bag’s capacity.

Each of the next nn lines contains two positive integers kik_i and did_i, describing one type of tumor.

Output Format

Output a single line with the number of different schemes, modulo 1926081719260817.

2 5
2 3
3 1
2

Hint

Sample explanation:

The two schemes are as follows:

  1. Take 1 item of type 1 and 2 items of type 2.
  2. Take 3 items of type 2.

 ~  ~

Constraints

  • For 10% of the testdata, 1n,ki,di101 \le n, k_i, d_i \le 10, 1m1001 \le m \le 100;
  • For 30% of the testdata, 1n,ki,di501 \le n, k_i, d_i \le 50, 1m50001 \le m \le 5000;
  • For another 20% of the testdata, ki=1k_i = 1;
  • For 100% of the testdata, 1n,ki,di5001 \le n, k_i, d_i \le 500, 1m1051 \le m \le 10^5.

Translated by ChatGPT 5