Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _USE_MATH_DEFINES
- #include <iostream>
- #include <conio.h>
- #include <string>
- #include <set>
- #include <map>
- #include <algorithm>
- #include <string>
- #include <math.h>
- #include <vector>
- #include <cmath>
- #include <sstream>
- using namespace std;
- int main()
- {
- long long prom, n, people, sum=0;
- cin >> people >> n;
- for (int i = 1; i <= n; i++)
- {
- cin >> prom;
- sum += prom;
- }
- cout << max(sum - people*(n - 1), (long long)0);
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment