Want to solve this problem? Login now to get access to solve the problems

Problem

Submissions

Solution

Leaderboard

Coming soon

5

Difficulty: EASY

Avg. time to solve

22 min

Success Rate

80%

Problem Statement

Suggest Edit

```
The first line of input contains a single integer T, representing the number of test cases or queries to be run.
Then the T test cases follow.
The first line of each test case contains an integer N, where N is the size of the given array.
The second line contains 'N' single space-separated integers representing the elements of the array.
The third line contains two single space-separated integers K and M.
```

```
For each test case, print “True” or “False” in a single line.
```

```
You do not need to print anything. It has already been taken care of. Just implement the given function.
```

```
1 <= T <= 10
1 <= N <= 10^5
1 <= arr[i] <= 10^9
1 <= K <= 10^9
0 <= M < K
Time Limit: 1 sec
```

```
1
4
2 1 5 7
9 3
```

```
True
```

```
Pairs will be (2,1) and (5,7) whose sums are 3 and 12. Which will give remainder 3 when divided by 9.
```

```
1
5
6 6 3 0 0
9 3
```

```
False
```

```
As pairs would be {6, 6} and {3, 0}, but second 0 will not be able to make pair with any of the elements, thus it is not possible to make valid pairs.
```

Want to solve this problem? Login now to get access to solve the problems