QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 1024 MB Total points: 100

#17242. Clothes

Statistics

Bitaro the beaver is going to buy zero or more clothes at a clothing store. The store sells 100 types of clothes in total, and the types are numbered from 1 to 100. The store has a sufficient stock of each type of clothing, so no matter how many clothes Bitaro buys, they will not run out.

By wearing the clothes he has purchased, Bitaro can adjust his perceived temperature.
If the air temperature is $t$ degrees and Bitaro is wearing $k$ clothes of types $s_1, s_2, \ldots, s_k$, then his perceived temperature becomes
$t + s_1 + s_2 + \cdots + s_k$ degrees.

Bitaro may wear any number of clothes, including zero (if $k = 0$, then the perceived temperature is $t$).
He may also wear multiple clothes of the same type at once; in that case, the perceived temperature increases by that type number for each such piece worn.

From the weather forecast, Bitaro knows that the temperatures for the next $N$ days will be $A_1, A_2, \ldots, A_N$ degrees, respectively. He wants to purchase clothes so that, on each of the next $N$ days, he can choose which of the purchased clothes to wear in order to make his perceived temperature exactly 23 degrees.

If such a purchase is possible, he wants to minimize the total number of clothes he buys.

Given the temperatures for the next $N$ days, determine whether it is possible for Bitaro to buy clothes so that he can make his perceived temperature 23 degrees on every day. If it is possible, output one example of a purchase that uses the minimum number of clothes.

Input

The input is given from standard input in the following format:

$N$

$A_1$ $A_2$ $\cdots$ $A_N$

Output

Print the result to standard output in the following format.

If it is impossible for Bitaro to buy clothes so that he can make his perceived temperature 23 degrees on every day, print:

No

If it is possible, print:

Yes

Let $k$ be the minimum number of clothes Bitaro buys, and let their types be $s_1, s_2, \ldots, s_k$. On the second line, print $k$. On the third line, print the $k$ integers $s_1, s_2, \ldots, s_k$ separated by spaces.

The $k$ integers may be printed in any order. If there are multiple valid purchases satisfying the conditions, any one of them may be printed.

Constraints

  • $1 \leq N \leq 81$.
  • $-40 \leq A_i \leq 40$ $(1 \leq i \leq N)$.
  • $A_i < A_{i+1}$ $(1 \leq i \leq N-1)$.
  • All input values are integers.

Scoring

  1. (6 points) $N = 1$.
  2. (14 points) $N \leq 3$.
  3. (15 points) $A_{i+1} = A_i + 1$ $(1 \leq i \leq N-1)$, and $A_N = 23$.
  4. (16 points) $A_i \geq 12$ $(1 \leq i \leq N)$.
  5. (9 points) $A_i \geq 4$ $(1 \leq i \leq N)$.
  6. (21 points) $A_i \geq -8$ $(1 \leq i \leq N)$.
  7. (19 points) No additional constraints.

Example 1

Input

3
17 20 23

Output

Yes
2
3 3

By purchasing two clothes of type 3, Bitaro can make his perceived temperature 23 degrees on each of the next 3 days. For example:

  • On day 1, he wears two clothes of type 3.
  • On day 2, he wears one clothes of type 3.
  • On day 3, he wears no clothes.

It is impossible to achieve this with at most one purchased clothes.

This input satisfies the constraints of Subtasks 2, 4, 5, 6, and 7.

Example 2

Input

1
24

Output

No

On a day when the temperature is 24 degrees, it is impossible to make the perceived temperature 23 degrees. Therefore, no matter how he purchases clothes, he cannot make the perceived temperature 23 degrees on that day.

This input satisfies the constraints of Subtasks 1, 2, 4, 5, 6, and 7.

Example 3

Input

5
-1 3 6 10 16

Output

Yes
3
4 7 13

This input satisfies the constraints of Subtasks 6 and 7.

Example 4

Input

3
21 22 23

Output

Yes
2
1 1

This input satisfies the constraints of Subtasks 2, 3, 4, 5, 6, and 7.

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
EditorialOpen Official EditorialQingyu- Download

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.