SPOJ CANDY3

From Algorithmist
Jump to navigation Jump to search

Problem Number - Problem Name[edit]

Summary[edit]

During a school trip, the teacher reacts to squabbling among students, asked all students to put their candies on the table before dividing them evenly amongst themselves. Some students wondered whether this was possible.

Explanation[edit]

A simple test - is a sum divisible by s certain number? If so, the candies can be divided.

Gotchas[edit]

  • The input data can overflow a 32-bit integer. Either use a BigNum or a 64-bit datatype.

Notes[edit]

Implementations[edit]

Optimizations[edit]

Input[edit]

2

5
5
2
7
3
8

6
7
11
2
7
3
4

Output[edit]

YES
NO

References[edit]