Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //122945BV
- #include <iostream>
- #include <string>
- #include <vector>
- #include <stdio.h>
- #include <algorithm>
- #define sz(a) (int)a.size()
- using namespace std;
- const int SIZE = 1000;
- const int INF = 1000 * 1000 * 1000;
- void prepare(string s) {
- #ifdef _DEBUG
- freopen("input.txt", "r", stdin);
- #else
- if (sz(s) != 0) {
- freopen((s + ".in").c_str(),"r",stdin);
- freopen((s + ".out").c_str(),"w",stdout);
- }
- #endif
- }
- vector <int> a;
- int n;
- int main() {
- prepare("");
- int tmp;
- //freopen("input.txt", "r", stdin);
- prepare("");
- cin >> n;
- for (int i = 0; i < n; i++) {
- cin >> tmp;
- a.push_back(tmp);
- }
- sort(a.begin(), a.end());
- cout << a[n - 1] + a[n - 2] + a[n - 3] << " " << n - 2 << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement