|
|||
Sonya Wants More Equal NumbersPussycat Sonya has an array A consisting of N integers. She can replace some adjacent elements Ai and Ai + 1 with their sum. Sonya can perform this operation any number of times she wants. What is the maximum number of equal elements Sonya can get, and what can be the possible values of these equal elements? Input SpecificationThe first line of the input contains one integer N, the number of elements in array A (1 ≤ N ≤ 100). The second line contains N space-separated positive integers, the elements of array A (1 ≤ Ai ≤ 1000). Output SpecificationIn the first line, print the maximum number of equal elements Sonya can get. In the second line, print all the possible values of these equal elements in ascending order, separated by a space. Sample Input
Output for Sample Input
Sample ExplanationIn this case, the maximum number of equal elements Sonya can get is 2. Now let's see the possible values of these equal elements:
|
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |