BestCoder 2nd Anniversary:
1001.Oracle
The oracle is an integer n n n without leading zeroes.
Help him to work out the maximum sum. It might be impossible to do that. If so, print Uncertain
.
数据比较大,用字符串输入,要处理进位
#include<stdio.h>
#include<string.h>
#include<string>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
using namespace std;
#define LL long long
#define M 100010
#define inf 0x7f7f7f7f
#define PI 3.1415926
#define mod 1000000007
int n,m;
int a[];
void dfs()
{ }
int main()
{
scanf("%d",&n);
while(n--)
{
int sum=,ave=;
scanf("%d",&m);
for(int i=;i<m;i++)
{
scanf("%d",&a[i]);
sum+=a[i];
}
ave=sum/;
sort(a,a+m);
if(sum%||ave<a[m-]||m<)
{
printf("no\n");
continue;
} }
}
(16/7/17)