SPOJ CANDY3

From Algorithmist
Jump to: navigation, search

Contents

[edit] Problem Number - Problem Name

[edit] Summary

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.

[edit] Explanation

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

[edit] Gotchas

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

[edit] Notes

[edit] Implementations

[edit] Optimizations

[edit] Input

2

5
5
2
7
3
8

6
7
11
2
7
3
4

[edit] Output

YES
NO

[edit] References

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox