-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCANDY3.cs
38 lines (36 loc) · 867 Bytes
/
CANDY3.cs
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
34
35
36
37
using System;
using System.Collections.Generic;
using System.Text;
namespace AlgoSolution
{
class CANDY3
{
public static void Main()
{
Run();
}
static void Run()
{
int t = int.Parse(Console.ReadLine());
while (t > 0)
{
Console.ReadLine();
long N = long.Parse(Console.ReadLine());
long sum = 0;
for (int i = 0; i < N; i++)
{
sum = (sum + long.Parse(Console.ReadLine())) % N;
}
if (sum % N == 0)
{
Console.WriteLine("YES");
}
else
{
Console.WriteLine("NO");
}
t--;
}
}
}
}