<|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
- 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. Compute an array P of size N, where initially Pi = ⌊Ai·100/S⌋. Let F = ∑Pi; the deficit is sum_p = 100 − F.
3. Scan the candidates; whenever the share is not already an integer (checked exactly via Pi·S ≠ Ai·100) and sum_p > 0, do Pi++ and decrement sum_p.
4. Print the array P.

The construction relies on the guarantee that at least D candidates have a non-integer share, so the deficit is always exactly absorbed. This runs in O(N) time and O(N) memory.

4. C++ implementation
```cpp
#include <bits/stdc++.h>

using namespace std;

template<typename T1, typename T2>
ostream& operator<<(ostream& out, const pair<T1, T2>& x) {
    return out << x.first << ' ' << x.second;
}

template<typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& x) {
    return in >> x.first >> x.second;
}

template<typename T>
istream& operator>>(istream& in, vector<T>& a) {
    for(auto& x: a) {
        in >> x;
    }
    return in;
};

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& a) {
    for(auto x: a) {
        out << x << ' ';
    }
    return out;
};

int n;
vector<int> a;

void read() {
    cin >> n;
    a.resize(n);
    cin >> a;
}

void solve() {
    // Each candidate's real share is a[i]*100/sum percent. We first floor
    // every share, which leaves a remainder sum_p = 100 - sum of floors to
    // distribute (it never exceeds the number of candidates with a fractional
    // part). We then walk the list and round up exactly the candidates whose
    // share was not already an integer, one each, until sum_p is exhausted.
    // Every printed part stays within one of its real value and the total is
    // exactly 100.

    int sum = 0;
    for(int x: a) {
        sum += x;
    }

    vector<int> p(n);
    int sum_p = 100;
    for(int i = 0; i < n; i++) {
        p[i] = (a[i] * 100) / sum;
        sum_p -= p[i];
    }

    for(int i = 0; i < n; i++) {
        if(p[i] * 1ll * sum != a[i] * 100ll && sum_p) {
            p[i]++;
            sum_p--;
        }
    }

    cout << p << endl;
}

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

    int T = 1;
    // cin >> T;
    for(int test = 1; test <= T; test++) {
        read();
        // cout << "Case #" << test << ": ";
        solve();
    }

    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".
