# Distinct Count

Problem:-

Given an array A of N integers, classify it as being Good Bad or Average. It is called Good, if it contains exactly X distinct integers, Bad if it contains less than X distinct integers and Average if it contains more than X distinct integers.

Input format:
First line consists of a single integer T denoting the number of test cases.
First line of each test case consists of two space separated integers denoting N and X.
Second line of each test case consists of N space separated integers denoting the array elements.

Output format:
Print the required answer for each test case on a new line.

Constraints:

$1\le T\le 50$

$1\le X,N\le 13000$

$1\le A\left[i\right]\le {10}^{9}$

Sample Input
`44 11 4 2 54 24 2 1 54 35 2 4 14 41 2 4 5`
Sample Output
`AverageAverageAverageGood`
Time Limit: 1
Memory Limit: 256
Source Limit:

Solution:-

#include<stdio.h>
int main()
{
int t,x,n;
scanf(“%d”,&t);
while(t–)
{
scanf(“%d%d”,&n,&x);
long long int a[n],k=0,j,element;
for(int i=0;i<n;i++)
{
scanf(“%lld”,&element);
for( j=0;j<k;j++)
{
if(element==a[j])
break;
}
if(j==k)
{
a[k]=element;
k++;
}
}
if(k==x)
printf(“Goodn”);
if(k>x)
printf(“Averagen”);
if(k<x)