#P14809. [CCPC 2024 哈尔滨站] 一个全新的几何问题

[CCPC 2024 哈尔滨站] 一个全新的几何问题

Description

You are a magician in a high-dimensional space, and you have an initial nn-dimensional hypercube with edge lengths a1,a2,,ana_1, a_2, \dots, a_n. For a dd-dimensional hypercube, the edge length sum is defined as i=1dai\sum_{i=1}^d a_i, and its hypervolume is i=1dai\prod_{i=1}^d a_i.

You want to obtain a hypercube with edge length sum SS and hypervolume MM. To achieve this, you can perform both dimensional reduction and dimensional expansion operations on the current hypercube.

  • Dimensional Reduction: Remove a dimension.
  • Dimensional Expansion: Add a new dimension, with its edge length being any positive integer.

Both operations are very exhausting, so you want to determine the minimum number of operations required to obtain a hypercube with edge length sum SS and hypervolume MM.

Input Format

The first line contains three integers n,S,Mn, S, M (1n1051\le n \le 10^5, 1S,M10101 \le S, M \le 10^{10}).

The second line contains nn integers, representing the initial edge lengths aia_i of the hypercube (1ai10101 \le a_i \le 10^{10}).

Output Format

Output a single integer representing the minimum number of operations required. If it is impossible to obtain a hypercube that meets the conditions, output 1-1.

2 5 6
1 2
2
3 6 5
1 2 3
3
2 114514 735134400
114 514
20
2 4 7
1 3
-1

Hint

For the first sample, one possible approach: first delete the dimension with edge length 11, and then add a dimension with edge length 33.