#include <iostream>
#include <string.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
#define MAXN 1000000 + 10
int num[MAXN];
int main()
{
int n;
int x1, x2;
while(scanf("%d",&n) != EOF)
{
bool nu = false;
for( int i = 0; i < n; i++)
scanf("%d",&num[i]);
sort(num, num + n);
if(n%2)
{
x1 = num[n/2];
x2 = x1;
}
else
{
x1 = num[(n-1)/2];
x2 = num[n/2];
}
int cnt = 0;
for( int i = 0; i < n; i++)
{
if(num[i] >= x1 && num[i] <= x2)
cnt++;
if(num[i]> x2)
break;
}
printf("%d %d %d\n",x1, cnt ,x2 - x1 + 1);
}
}
UVA 10057
最新推荐文章于 2017-04-04 20:28:37 发布