CodechefMay 16, 2025

Self Defence Training

Hazrat Ali

Codechef

The only condition for a woman to be eligible for the special training is that she must be between 1010 and 6060 years of age, inclusive of both 1010 and 6060.

Given the ages of NN women in his village, please help San Te find out how many of them are eligible for the special training.

Input Format

  • The first line of input contains a single integer TT, denoting the number of test cases. The description of TT test cases follows.
  • The first line of each test case contains a single integer NN, the number of women.
  • The second line of each test case contains NN space-separated integers A1,A2,...,ANA1,A2,...,AN, the ages of the women.

Output Format

For each test case, output in a single line the number of women eligible for self-defence training.

Constraints

  • 1≤T≤20
  • 1≤N≤100
  • 1≤Ai≤100

Sample 1:

Input
 
3
3
15 23 65
3
15 62 16
2
35 9
 
Output
 
2
2
1

Solution
#include <stdio.h>
 
int main(void) {
 
int m,i;
scanf("%d",&m);
while(m--){
    int n,count=0;
    scanf("%d",&n);
    for ( i =0; i<n; i++){
        int x;
        scanf("%d",&x);
        if(x >= 10 && x <= 60)
            count++;
    }
    printf("%d\n",count);
}
return 0;
}

 



Comments