-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathEcoClass.java
More file actions
33 lines (26 loc) · 750 Bytes
/
EcoClass.java
File metadata and controls
33 lines (26 loc) · 750 Bytes
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
package io.github.tahanima.codechef;
import java.util.Scanner;
/**
* @author tahanima
*/
public class EcoClass {
static final int MAX = 105;
static final int[] supply = new int[MAX];
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int cases = scanner.nextInt();
while (cases-- > 0) {
int n = scanner.nextInt();
int answer = 0;
for (int i = 0; i < n; i++) {
supply[i] = scanner.nextInt();
}
for (int i = 0; i < n; i++) {
if (supply[i] == scanner.nextInt()) {
answer++;
}
}
System.out.println(answer);
}
}
}