Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int k, n, a, sum = 0, otvet = 0;
- cin >> k >> n;
- for (int i = 0; i < n; i++)
- {
- cin >> a;
- sum += a;
- }
- if (sum < (k * n))
- {
- cout << 0;
- }
- else { otvet = sum % (k * n);
- cout << otvet;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement