Logo
(追記) (追記ここまで)

22042번 - Need More T-shirts! 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB65201728.333%

문제

The Innopolis Open 2020 is coming. And this means that it’s time to order T-shirts for the participants of the Olympiad.

The organizers decided that it would be great to buy T-shirts of different colors so that you can easily see who is the organizer, jury or participant of the Olympiad.

For this task, two people were assigned, they decided how many T-shirts of each color should be ordered. However, they did not agree among themselves, and one of them wrote down the number of T-shirts of a certain color that needs to be ordered, and the other wrote the percentage of T-shirts of a certain color. As a result, they got a list of length $n,ドル where each element of the list $a_i$ is either the number of T-shirts of color $i$ or the percentage of T-shirts of color $i$ of the total number of T-shirts. Moreover, it is known that in the list at least one element $a_i$ is the number of T-shirts of the color $i$.

Now the organizers need to understand, what is the total of T-shirts they need to buy for the olympiad. Help them find all possible options for the total number of T-shirts for which such a list could be obtained.

입력

The first line contains a single integer $n,ドル the number of different colors (1ドル \le n \le 10^5$).

The second line contains $n$ integers $a_i,ドル either the number of T-shirts or the percentage of t-shirts for the color $i$ (1ドル \le a_i \le 10^9$).

출력

In the first line print the number of options for the total number of T-shirts for which such a list could be obtained.

In the second line print all possible options for the total number of T-shirts, in sorted order.

제한

서브태스크

번호배점제한
113

1ドル \le n \le 15,ドル 1ドル \le a_i \le 100$

221

1ドル \le n \le 100,ドル 1ドル \le a_i \le 100$

338

1ドル \le n \le 100,ドル 1ドル \le a_i \le 10^9$

428

1ドル \le n \le 10^5,ドル 1ドル \le a_i \le 10^9$

예제 입력 1

2
1 50

예제 출력 1

2
2 51

예제 입력 2

3
20 30 70

예제 출력 2

4
120 125 140 300

예제 입력 3

4
2 40 90 5

예제 출력 3

3
137 470 840

예제 입력 4

7
10 20 5 15 30 17 3

예제 출력 4

1
100

힌트

Explanation of the first example:

If the total number of T-shirts is 2ドル$: one of color 1ドル,ドル and one of color 2ドル,ドル we can obtain the given list if the first element (1ドル$) is the number of T-shirts of color 1ドル,ドル and the second element (50ドル$) is the percentage of T-shirts of color 2ドル$. 2ドル = 1 + 2 \cdot \frac{50}{100}$.

If the total number of T-shirts is 51ドル$: one of color 1ドル,ドル and 50ドル$ of color 2ドル,ドル we can obtain the given list, if both elements are the numbers of T-shirts of colors 1ドル$ and 2ドル$. 51ドル = 1 + 50$.

Explanation of the second example:

  • 120ドル = 20 + 30 + 70$
  • 125ドル = 125 \cdot \frac{20}{100} + 30 + 70$
  • 140ドル = 140 \cdot \frac{20}{100} + 140 \cdot \frac{30}{100} + 70$
  • 300ドル = 300 \cdot \frac{20}{100} + 30 + 300 \cdot \frac{70}{100}$

출처

Contest > Innopolis Open in Informatics > Innopolis Open 2019-2020 Finals B번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /