Whats wrong with my code to HARRY AND MAGICAL NUMBER?!
It even passed the sample case and some manual inputs which I tested it with so why am I getting WA.
Problem: CodeChef: Practical coding for everyone
Check my code (C): #include <stdio.h>
int main()
{
int t;
scanf(“%d”,&t);
while(t–)
{
int array[100], minimum, size, c,s;
scanf(“%d%d”,&size,&s);
for ( c = 0 ; c < size ; c++ )
{
scanf(“%d”, &array[c]);
}
minimum = array[0];
for ( c = 1 ; c < size ; c++ )
{
if ( array[c] < minimum )
{
minimum = array[c];
}
}
if((minimum*size)==s)
{
printf("%d\n",minimum);
}
else
{
printf("-1\n");
}
}
return 0;