#include <iostream>
#include <vector>
using namespace std;
int fibo(int n, int &cnt){
cnt++;
if(n == 1 || n == 2)
return 1;
return fibo(n-1,cnt) + fibo(n-2,cnt);
}
void solve1(){
int k = 5;
while(k--){
int n,ans = 0;
cin >> n;
cout << fibo(n,ans) << " " << ans << "\n";
void solve2(){
const int INF = 1e9 + 7;
int n, mx1 = -INF, mx2 = -INF;
vector<int> a(n);
for(auto &i : a) cin >> i;
for(auto &i : a){
if(i > mx1){
mx2 = mx1;
mx1 = i;
else if(i > mx2)
mx2 = i;
cout << mx2 << " " << mx1;
#include <iostream>
#include <vector>
using namespace std;
int fibo(int n, int &cnt){
cnt++;
if(n == 1 || n == 2)
return 1;
return fibo(n-1,cnt) + fibo(n-2,cnt);
}
void solve1(){
int k = 5;
while(k--){
int n,ans = 0;
cin >> n;
cout << fibo(n,ans) << " " << ans << "\n";
}
}
void solve2(){
const int INF = 1e9 + 7;
int n, mx1 = -INF, mx2 = -INF;
cin >> n;
vector<int> a(n);
for(auto &i : a) cin >> i;
for(auto &i : a){
if(i > mx1){
mx2 = mx1;
mx1 = i;
}
else if(i > mx2)
mx2 = i;
}
cout << mx2 << " " << mx1;
}