Computer Science, asked by akashtyagi3990, 4 hours ago

Jazzy is good with bowling but is not good with studies. His mom wants him to focus on studies too and for this she has found an interesting way. She has brought N packets of balls which may or may not have the same number of balls in them. The balls in a packet are arranged in a linear manner and Jazzy wants to play with the balls.


She will give the balls to Jazzy only if he can tell the maximum number of moves required in which he can get to play with all the balls. There are few conditions though:

In one move, Jazzy can divide the number of balls in the packet into an equal number of groups only.
Example: Suppose there are 6 balls in the packet.
Jazzy can divide this packet in 3 ways.

1. Two groups of 3 balls each. (3, 3)
2. Three groups of 2 balls each (2, 2, 2)
3. Six groups of 1 ball each.


Note: Dividing a single group into multiple groups of equal number is considered one move only.


Jazzy can get to play with the balls when they are present as a single unit only and not in any group of size greater than 1. Also, getting to play with a ball is considered a move.

Example: In a group there are 2 balls, then Jazzy cannot play with them until he further divides them into single-single units.


The length of all the packets/groups should always be an integer.

Answers

Answered by udhaiindrajith
0

Answer:

Explanationcan I ask u something

is this created by u or is this given to u to solve

if this is created by u

it's really awesome and creative

u can continue to do it more and more

thank you

Explanation:

it looks like u have only answered it:

Answered by arshaarunsl
0

Answer:

The response is 10.

Explanation

Jazzy only wants to play with the balls, so she needs your assistance in figuring out the most moves possible. Can you aid this man?

Type of Input

N packets are listed on the first line of the input.

The second line of input contains N integers separated by spaces, where N is the length of the packet and represents the number of balls in the packet.

Typical Test Case 1

Input

2

6 1

Output

11

1(6)+3(2)+6(1)=1+3+6=10

#SPJ2

Similar questions