-
Notifications
You must be signed in to change notification settings - Fork 0
/
self defence
34 lines (31 loc) · 1.07 KB
/
self defence
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Problem
After the phenomenal success of the 36th Chamber of Shaolin, San Te has decided to start 37th Chamber of Shaolin.
The aim this time is to equip women with shaolin self-defence techniques.
The only condition for a woman to be eligible for the special training is that she must be between 10 and 60 years of age, inclusive of both 10 and 60.
Given the ages of N women in his village, please help San Te find out how many of them are eligible for the special training.
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
int t;
Scanner sc = new Scanner(System.in);
t = sc.nextInt();
for(int i=1;i<=t;i++){
int count=0;
int n = sc.nextInt();
int[] a = new int[n];
for(int j=0;j<n;j++){
a[j] = sc.nextInt();
if(a[j]>=10&&a[j]<=60)
count++;
}
System.out.println(count);
}
}
}