Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <String>
- using namespace std;
- int main()
- {
- long n, k;
- cin >> n >> k;
- const long max = 10000;
- long long mas[max];
- long count = n*k;
- int bombi=0;
- for (int x = 0; x < n; x++) {
- cin >> mas[x];
- }
- for (int x = 0; x < n; x++) {
- if (mas[x] <= k) {
- count = count - mas[x];
- }
- else {
- count = count - k;
- }
- }
- for (int x = 0; x < n; x++) {
- if (mas[x] > k) {
- bombi = bombi + (mas[x] - k);
- }
- }
- cout << bombi << " " << count;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement