Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define int long long
- using namespace std;
- int32_t main() {
- ios_base::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- vector<int> prices{1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000};
- int sum = 0;
- for(int i = 0; i < 15; ++i) {
- int x;
- cin >> x;
- sum += x * prices[i];
- }
- vector<int> sol(15);
- int p = 14;
- while(p >= 0) {
- sol[p] = sum / prices[p];
- sum %= prices[p];
- --p;
- }
- for(int x : sol)
- cout << x << ' ';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement