//区间要求长度 >= 1
include [HTML_REMOVED]
using namespace std;
const int N = 100010;
typedef long long LL;
LL s[N];
int cnt[N];
int main()
{
int n, k;
scanf(“%d%d”, &n, &k);
for (int i = 1; i <= n; i ++ )
{
scanf(“%lld”, &s[i]);
s[i] += s[i - 1];
}
LL res = 0;
cnt[0] = 1; //当后面出现cnt[s[i] % k] == 0,表示任意前缀和(前缀和自身)模k余0要作数
//但当cnt[s[i] % k] != 0, 它本身才能当做第一个数
for (int i = 1; i <= n; i ++ )
{
res += cnt[s[i] % k];
cnt[s[i] % k] ++ ;
}
printf("%lld", res);
return 0;
}