GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Monday 5 December 2022

[Solution] File Copy II Codeforces Solution VK Cup



B2. File Copy II
test time limit
2 seconds
memory limit per test
512 megabytes
input
standard input
conclusion
standard output

In this version of the task, the sizes of copied files do not exceed1010byte.

You are copying from one server to anothernfiles sizea1,a2,,anbyte. The files are copied sequentially in the specified order.

When copying, you see two progress bars: the first shows the percentage of copied data in the current file, and the second shows the total percentage of copied data for allnfiles. Both percentages are displayed rounded down to a whole number. The values ​​on the progress bars are updated after each byte is copied.

Formally, after copying the byte numberxfrom file numberifirst progress bar shows100xaipercent, and the second100(a1+a2++ai1+x)a1+a2++anpercent. At the very beginning of copying, both progress bars show0percent.

Find all such integers from0to100inclusive, that there is a point in time at which both progress bars show this number at the same time. Print these numbers in ascending order.

Input data

The first line contains one integern (1n100) is the number of copied files.

The second line containsnintegersa1,a2,,an(1ai1010) — file sizes in bytes in the order in which they will be copied.

Output

Print in ascending order all numbers from0to100inclusive such that there is a moment in time at which this number is simultaneously shown on both progress bars.

No comments:

Post a Comment