Given an array of integers and a number k, write a function that returns true if given array can be divided into pairs such that sum of every pair is divisible by k.

**Input:**

The first line of input contains an integer T denoting the number of test cases. The T test cases follow. Each test case contains an integer n denoting the size of the array. The next line contains the n space separated integers forming the array. The last line contains the value of k.

**Output:**

Print "True" (without quotes) if given array can be divided into pairs such that sum of every pair is divisible by k or else "False" (without quotes).

**Constraints:**

1<=T<=100

2<=n<=10^5

1<=a[i]<=10^5

1<=k<=10^5

**Example:
Input:**

2

4

9 7 5 3

6

4

91 74 66 48

10

**Output:**

True

False

Author: Ayush Govil 1

lakshmi_pandey | 72 |

abbatta7 | 68 |

Ashish Kumar Vaishy | 62 |

aman19 | 58 |

Kumar Gaurav Singh | 58 |

saumitra13325 | 612 |

ashujack | 551 |

lakshmi_pandey | 544 |

aman19 | 538 |

piyushmittal25 | 514 |

blackshadows | 5249 |

akhayrutdinov | 5111 |

Ibrahim Nash | 5087 |

Quandray | 4354 |

sanjay05 | 3668 |

Login to report an issue on this page.