//201612-1
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;scanf("%d", &n);
int arr[n];
for (int i = 0; i < n; i++)scanf("%d", &arr[i]);sort(arr, arr + n);
int mid = (n - 1) / 2;
int countMore = 0, countLess = 0;
for (int i = 0; i < n; i++)
if (arr[mid] < arr[i])
countMore++;
else if (arr[mid] > arr[i])
countLess++;printf("%d\n", countMore == countLess ? arr[mid] : -1);
return 0;}
//201612-1
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int n;scanf("%d", &n);
int arr[n];
for (int i = 0; i < n; i++)scanf("%d", &arr[i]);
int countMore, countLess;
for (int i = 0; i < n; i++){
countMore = 0, countLess = 0;
for (int j = 0; j < n; j++){
if (arr[i] > arr[j])
countMore++;
if (arr[i] < arr[j])
countLess++;}if (countMore == countLess){printf("%d\n", arr[i]);
break;}if (i == n - 1){printf("-1\n");}}
return 0;}
//201612-1
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n;scanf("%d", &n);
vector<int> A(n);
for (int i = 0; i < n; ++i)scanf("%d", &A[i]);sort(A.begin(), A.end());
auto i = equal_range(A.begin(), A.end(), A[A.size() / 2]);
if (i.first - A.begin() == A.end() - i.second)printf("%d", A[A.size() / 2]);
else
printf("-1");
return 0;}
//201612-1
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;scanf("%d", &n);
map<int, int> m;
for (int i = 0; i < n; i++){
int num;scanf("%d", &num);
m[num]++;}
int less = 0;
int res = -1;
for (auto it:m){
if (n - it.second - less == less)
res = it.first;
less += it.second;}printf("%d\n", res);
return 0;}
//201612-2
#include <bits/stdc++.h>
using namespace std;
int main(){
int t;scanf("%d", &t);
int sal = 200000;
vector<pair<int, int>> table{{0, 1500},{1500, 4500},{4500, 9000},{9000, 35000},{35000, 55000},{55000, 80000},{80000, 200000}};
vector<int> interest{3, 10, 20, 25, 30, 35, 45};
while (sal >= 100){
int a = sal - 3500;
int del = 0;
for (int i = 0; i < table.size(); i++)
if (a >= table[i].second)
del += (table[i].second - table[i].first) * interest[i] / 100;
else if (a >= table[i].first){
del += (a - table[i].first) * interest[i] / 100;
break;}if (sal - del == t){printf("%d\n", sal);
break;}
sal -= 100;}
return 0;}
//201612-1#include <iostream>#include <cstdio>using namespace std;int main() { int n; scanf("%d", &n); int arr[n]; for (int i = 0; i < n; i++) scanf("%...