Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- const int INf = 10000000;
- int a, n, i, s = 0, cnt = 0, m = INf;
- void Solve() {
- }
- void fastio() {
- ios_base::sync_with_stdio(false);
- cin.tie(0);
- cout.tie(0);
- }
- signed main () {
- fastio();
- cin >> n;
- for (int i = 0; i < n; i++) {
- cin >> a;
- s += a;
- cnt++;
- if((a % 4 != 0) && (a < m)) m = a;
- }
- if((s % 4 == 0) && (m != INf)) {
- s -= m;
- cnt--;
- }
- if(s % 4 == 0) {
- cout << 0;
- }
- cout << cnt << " " << s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement