## UTS Open '21 P2 - Prime Array

View as PDF

Points: 7
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

Edward is learning about prime numbers in math class today. Having just learnt what arrays are the day before, he decided to invent what he now calls a prime array. Specifically, he calls an array prime if the greatest common divisor of all its elements is . For example, and are prime but and are not. Having caught him dozing off in class, Mr. Brown challenges Edward to find an array which has exactly prime non-empty subarrays. Since Mr. Brown is not looking forward to spending more than a few hours reading over the array, he specifies that the array must contain no more than elements, and that all the elements of the array must be integers in the range . Now on the spot, Edward is asking you to help him solve this problem. Please help him find an array satisfying Mr. Brown's requirements.

#### Constraints

For this problem, you MUST pass the sample case in order to receive points.

It can be proven that an array satisfying the requirements always exists under the given constraints.

#### Input Specification

The first and only line of input contains an integer , as described in the problem statement.

#### Output Specification

First, output one line containing , the length of the array you have found.

Then output space separated integers , representing the elements of the array .

#### Sample Input

6

#### Sample Output

5
5 8 2 6 3

#### Explanation

The prime subarrays are: .

• commented on Feb. 8, 2021, 8:22 p.m. edit 4

This comment is hidden due to too much negative feedback. Click here to view it.

• commented on Feb. 9, 2021, 6:13 p.m.

As a CMO qualifier myself I can assure you that there is nothing wrong with this problem and it's perfectly fine the way it is

• commented on Feb. 9, 2021, 8:47 a.m. edited

.

• commented on Feb. 8, 2021, 11:31 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• commented on Feb. 8, 2021, 10:40 p.m. edited

Just solve the problem lol

• commented on Feb. 8, 2021, 8:31 p.m.

Sub arrays of length one are valid as shown in the problem statement:

For example, and are prime but and are not