Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <map>
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define cy cout << "YES\n"
- #define cn cout << "NO\n"
- #define nl "\n"
- #define fi first
- #define se second
- #define MOD 1000000007
- #define all(v) v.begin(), v.end()
- #define sz(s) s.size()
- #define f0r(i, n) for (ll i = 0; i < n; i++)
- template <typename T = int>
- istream &operator>>(istream &in, vector<T> &v)
- {
- for (auto &x : v)
- in >> x;
- return in;
- }
- template <typename T = int>
- ostream &operator<<(ostream &out, const vector<T> &v)
- {
- for (const T &x : v)
- out << x << " ";
- return out;
- }
- void sherry()
- {
- ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- void solve()
- {
- ll n;
- cin >> n;
- ll sum =0,odd=LLONG_MAX;
- for(ll i=0;i<n;i++){
- ll num;
- cin>>num;
- sum+=num;
- if(num%2){
- odd=min(odd,num);
- }
- }
- if(odd<LLONG_MAX){
- if(sum%2){
- cout<<sum-odd<<" "<<sum;
- }else{
- cout << sum<<" "<<sum-odd;
- }
- }else
- cout<<sum<<" 0";
- }
- int main()
- {
- sherry();
- int t = 1;
- //cin >> t;
- while (t--)
- solve();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement