<|instruction|>
Solve the below problem. The solution should start with an abridged problem statement. Then key observations. Then full solution based on the observations. Then C++ and Python implementations with comments.

152. Making round
time limit per test: 0.25 sec.
memory limit per test: 4096 KB
input: standard input
output: standard output



Extraordinary things are around us! All citizens of democratic Berland provided election of president and nobody voted "against all candidates". All votes distributed between N candidates. You was charged to write a program to calculate the results of election. You must indicate a part of votes given to each of the candidates. You must write integer numbers, concidering two conditions:
- Total sum of parts must be exactly 100%
- Every part is an integer number and it must be equal to real part, rounded up or down.

Input
There is a natural number N (1<=N<=10000) written in the first line - amount of candidates. Second line contains sequence of non-negative integer numbers A1, A2,..., AN; Ai is amount of votes given to the i-th candidate (Ai<=10000). Numbers of sequence are separated by one or more spaces.

Output
Write sequence of sought parts. Separate numbers by a space. If solution does not exist, write "No solution". If there are several solutions write any of them.

Sample test(s)

Input
2
10 10

Output
50 50
Author:	Michael R. Mirzayanov
Resource:	Saratov Subregional School Team Contest, 2002
Date:	Spring, 2002

<|response|>
1. Abridged problem statement  
Given N candidates with vote counts A1…AN (non-negative integers) and total votes S = ∑Ai, compute integer percentages P1…PN such that:  
- ∑Pi = 100  
- For each i, Pi equals either ⌊Ai·100/S⌋ or ⌈Ai·100/S⌉  
If no such assignment exists, print “No solution”. Otherwise print any valid sequence P1…PN.

2. Key observations  
- If S = 0 (all Ai = 0), no meaningful percentages can be formed ⇒ “No solution”.  
- Let ri = Ai·100/S (the exact real percentage). Define fi = ⌊ri⌋. Then ∑fi ≤ ∑ri = 100, so F = ∑fi ≤ 100.  
- Let Ki = 1 if ri is not an integer (i.e., Ai·100 % S ≠ 0), otherwise Ki = 0. Then taking ci = fi + Ki gives ∑ci = F + ∑Ki. One can show F ≤ 100 ≤ F+∑Ki.  
- Define deficit D = 100 − F. Since D ≤ ∑Ki, we can choose exactly D candidates with Ki=1 and increase their fi by 1 to reach a total of 100.

3. Full solution approach  
1. Read N and the array A. Compute S = ∑Ai.  
2. If S = 0, print “No solution” and exit.  
3. Compute an array P of size N, where initially Pi = ⌊Ai·100/S⌋. Let F = ∑Pi.  
4. Compute D = 100 − F (the number of percentage points we still need).  
5. Scan the candidates; whenever Ai·100 % S ≠ 0 (meaning ri had a fractional part) and D > 0, do Pi++ and decrement D.  
6. After this pass, if D > 0, it means there were fewer fractional parts than needed ⇒ print “No solution”. Otherwise print the array P.

This runs in O(N) time and uses O(N) memory.

4. C++ implementation with detailed comments  
```cpp
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int N;
    if (!(cin >> N)) return 0;

    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

    // Total votes
    long long S = 0;
    for (int x : A) S += x;

    // If no votes were cast, no valid percentages
    if (S == 0) {
        cout << "No solution\n";
        return 0;
    }

    // Step 1: compute floors of exact percentages
    vector<int> P(N);
    long long sumP = 0;  // this will be F = sum of floors
    for (int i = 0; i < N; i++) {
        // floor of (A[i]*100)/S
        P[i] = int((A[i] * 100LL) / S);
        sumP += P[i];
    }

    // Step 2: how many percentage points remain to reach 100
    int D = int(100 - sumP);
    // Step 3: distribute these D points to those with fractional parts
    for (int i = 0; i < N && D > 0; i++) {
        // check if the exact percentage had a fractional part:
        // A[i]*100 % S != 0
        if ((A[i] * 100LL) % S != 0) {
            P[i]++;  // round up this candidate
            D--;
        }
    }

    // If we still have a deficit, no solution exists
    if (D != 0) {
        cout << "No solution\n";
        return 0;
    }

    // Otherwise print the resulting percentages
    for (int i = 0; i < N; i++) {
        if (i) cout << ' ';
        cout << P[i];
    }
    cout << '\n';
    return 0;
}
```

5. Python implementation with detailed comments  
```python
import sys

def main():
    data = sys.stdin.read().strip().split()
    if not data:
        return
    it = iter(data)
    n = int(next(it))
    A = [int(next(it)) for _ in range(n)]

    S = sum(A)
    # If total votes is zero, we cannot form valid percentages
    if S == 0:
        print("No solution")
        return

    # Step 1: compute floor percentages and running sum
    P = []
    sumP = 0
    for votes in A:
        val = (votes * 100) // S
        P.append(val)
        sumP += val

    # Step 2: compute how many points we need to add
    D = 100 - sumP

    # Step 3: find candidates whose exact percentage was non-integer
    # and round up as long as we need points
    for i, votes in enumerate(A):
        if D == 0:
            break
        if (votes * 100) % S != 0:
            P[i] += 1
            D -= 1

    # If after that we still need points, no solution
    if D != 0:
        print("No solution")
    else:
        # Otherwise output the percentages
        print(*P)

if __name__ == "__main__":
    main()
```

Explanation summary:  
- We first take the floor of each exact percentage and note the total F.  
- We need to distribute (100−F) extra points. Only candidates whose exact percentage was not an integer can gain +1 without violating the rounding requirement.  
- If there are enough such candidates, we succeed; otherwise, we report “No solution.”