fork download
  1. #include <bits/stdc++.h>
  2. #define ull unsigned long long
  3. #define ll long long
  4. #define el endl
  5. #define nl '\n'
  6. #define all(v) v.begin(), v.end()
  7. using namespace std;
  8.  
  9. void input()
  10. {
  11. if (fopen("in.txt", "r"))
  12. {
  13. freopen("in.txt", "r", stdin);
  14. freopen("out.txt", "w", stdout);
  15. }
  16. }
  17.  
  18. void init()
  19. {
  20. ios_base::sync_with_stdio(false);
  21. cin.tie(nullptr);
  22. }
  23. int main()
  24. {
  25. Fast:
  26. input();
  27. init();
  28. //---------------------------------------------------------------------------------------------------------------
  29. int n, sum = 0;
  30. cin >> n;
  31. int ar[n];
  32. for (int i = 0; i < n; i++)
  33. {
  34. cin >> ar[i];
  35. sum += ar[i];
  36. }
  37.  
  38. int avg = sum / n;
  39. cout << avg << nl;
  40.  
  41. int ctr = 0;
  42. for (int i = 0; i < n; i++)
  43. {
  44. if (ar[i] > avg)
  45. ctr++;
  46. }
  47. cout << ctr << nl;
  48.  
  49. return 0;
  50. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
-15417
32701