Remainders
Time limit1sMemory limit128 MB
Read ten nonnegative integers, compute each mod 42, and print how many distinct remainder values occur.
- Level
Easy1 of 10
- Topics
- Hash map, Implementation
- Solved
- No attempts yet
Problem
For an integer A and a positive integer B, A % B is the remainder after dividing A by B. For example, the remainders of 7, 14, 27, and 38 divided by 3 are 1, 2, 0, and 2.
Given ten numbers, compute each number's remainder after division by 42. Then determine how many distinct remainder values appear.
Input
Ten lines are given. Each line contains one integer. Every integer is nonnegative and at most 1,000.
Output
Print the number of distinct remainders that appear when the ten input numbers are divided by 42.