Enjoy Arithmetic Progressions#1928

Enjoy Arithmetic Progressions

4 seconds
256 megabytes
Very hard

Young Andrew loves arithmetic progressions. His even younger sister Anya wrote a sequence of numbers on the blackboard. Now Andrew wants to split this sequence into several arithmetic progressions. For example, the sequence \textbf{1}\ \textbf{2}\ \textbf{5}\ \textbf{7}\ \textbf{9}\ \textbf{11}\ \textbf{3} can be split into three arithmetic progressions: , \textbf{5}\ \textbf{7}\ \textbf{9}\ \textbf{11}, and . There is another way to split it into three progressions (, , and ), but it is impossible to split it into two or fewer progressions.

Obviously, Andrew would like to split the sequence into as few progressions as possible. He is even willing to change some of the numbers to make the resulting number of progressions smaller. But it would be boring to just change all the numbers to \textbf{1}\ \textbf{2}\ \textbf{3}\ldots.

So Andrew decided to assign a score of to each change operation, and a score of to each resulting arithmetic progression. If he changes n_c numbers and splits the result into n_p progressions, his total score is c n_c + p n_p. He wants his total score to be as small as possible.

Input

The first line of the input file contains three integers , , and , where 1 \leq n \leq 3000 (the length of Anya's sequence), 1 \leq c, p \leq 10000.

The second line contains integers, each between and , inclusive — Anya's sequence.

Output

In the first line of the output file, print the minimal total score. On the second line, print the number of arithmetic progressions that Andrew will form. Then, print the progressions themselves, one per line. Each line should start with the number of numbers in the progression, followed by the numbers themselves. Each number must be written either as an integer between -10^9 and 10^9, inclusive, or as a rational number with a numerator between -10^9 and 10^9, inclusive, and a denominator between and 10^9, inclusive, where the greatest common divisor of the numerator and denominator is . Andrew never uses numbers that cannot be written under these restrictions.

Examples

Example 1

Loading
Loading