Forever Young

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

Little Misha plays with infinite arrays which consist of nonnegative integers. Let us call such an array good if it is non-increasing.

In one step, Misha can increase or decrease one number in a good array by 11, if the array will remain good after this operation as well.

Initially, Misha had an array AA. Misha made kk steps and obtained an array BB. In how many ways he could have obtained it?

입력

The first line contains a single integer nn (0n600 \le n \le 60): the number of nonzero elements in AA. The second line contains nn integers separated by spaces: 60a_1a_2a_n>060 \ge a\_1 \ge a\_2 \ge \cdots \ge a\_n > 0, the elements themselves. All other elements of AA are zeroes.

The next two lines contain a description of BB in the same format.

Additionally, it is guaranteed that 0a_i600 \le \sum a\_i \le 60 and 0b_i600 \le \sum b\_i \le 60.

The last line contains the only integer kk (0k1060 \le k \le 10^6).

출력

Print the desired number of ways modulo prime number 998,244,353998\\,244\\,353.

힌트

In the first sample, the ways are: 3,2,14,2,13,2,1\\{3,2,1\\} \to \\{4,2,1\\} \to \\{3,2,1\\}, 3,2,13,3,13,2,1\\{3,2,1\\} \to \\{3,3,1\\} \to \\{3,2,1\\}, 3,2,13,2,23,2,1\\{3,2,1\\} \to \\{3,2,2\\} \to \\{3,2,1\\}, 3,2,13,2,1,13,2,1\\{3,2,1\\} \to \\{3,2,1,1\\} \to \\{3,2,1\\}, 3,2,12,2,13,2,1\\{3,2,1\\} \to \\{2,2,1\\} \to \\{3,2,1\\}, 3,2,13,1,13,2,1\\{3,2,1\\} \to \\{3,1,1\\} \to \\{3,2,1\\}, 3,2,13,23,2,1\\{3,2,1\\} \to \\{3,2\\} \to \\{3,2,1\\}.

In the second sample, it is impossible to obtain the second array from the first in 11111111 steps.