We consider sequences formed from the addition of terms of a given
sequence. Let
,
, be an arbitrary
sequence of integer numbers;
a positive integer. We construct
another sequence
,
, by defining
as consisting of
occurrences of the term
:
For example, if
, and
, then the resulting sequence
is:
Problem
Given
and
we want to obtain the corresponding
th
integer in the sequence
. For example,
with
and
we have 3 for
;
we have 4 for
. With
and
,
we have 2 for
; we have 3 for
.
Input
The input consists of three lines:
- The first line represents
-
a polynomial in
of degree
with non-negative integer coefficients in increasing
order of the power:
where
,
.
This polynomial
is codified by its degree
followed by the coefficients
,
.
All the numbers are separated by a single space.
- The second line is the positive integer
.
- The third line is the positive integer
.
It is assumed that the polynomial
is a polynomial of degree less or equal than 20 (
)
with non-negative integer coefficients less or equal than 10000
(
,
);
;
.
Output
The output is the
th integer in the sequence
.
This value is less or equal than
.
Sample Input
4 3 0 0 0 23
25
100
Sample Output
1866