描述
Given a sequence, you’re asked whether there exists a consecutive subsequence whose sum is divisible by m. output YES, otherwise output NO
输入
The first line of the input has an integer T (1≤T≤10), which represents the number of test cases.
For each test case, there are two lines:
1.The first line contains two positive integers n, m (1≤n≤100000, 1≤m≤5000).
2.The second line contains n positive integers x (1≤x≤100) according to the sequence.
输出
Output T lines, each line print a YES or NO.
样例输入
2
3 3
1 2 3
5 7
6 6 6 6 6
样例输出
YES
NO
题意
给你n个数字,再给你数字m问这n个数字中有没有一段连续的数字之和能被m整除,输出YES或者NO
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[100005];
inline int read()
{
int xx=0,ff=1;
char ch;
ch=getchar();