CT668

The Divisible Tally at Glowtide

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

At the lantern reef of Glowtide, Kabir records each tickets in a worn leather ledger. The guild wants answers, not guesses. Task: Read n integers and a divisor d; print how many elements are divisible by d. Input format: First line: n and d. Second line: n space-separated integers. Output format: Print the count of elements divisible by d. Constraints: 1 <= n <= 52; -100 <= a[i] <= 10; 1 <= d <= 1000.

Example 1:

Input: 38 205 -73 -69 -25 -92 -18 -5 -68 -75 -3 2 -54 -35 -30 -77 -66 -70 -9 -4 -44 -50 9 -6 -6 8 -97 -94 -87 -51 -18 -12 -82 -28 -12 -42 -41 -78 -69 -95
Output: 0

Example 2:

Input: 50 952 -70 -74 -23 -83 -47 -76 -64 -49 5 -84 -21 -57 -13 -74 -84 -59 -88 -62 -99 -30 -47 -50 -76 -21 -52 -4 -64 -81 -8 -28 -50 -70 -58 -45 -43 -64 -38 -30 -70 8 -62 -41 -74 -32 -26 -26 -9 -79 -96 -74
Output: 0

Example 3:

Input: 18 131 -98 -43 -37 -21 -84 -54 -16 5 -68 6 -90 -25 -81 -27 -85 -96 -32 -28
Output: 0

Constraints:

1 <= n <= 52; -100 <= a[i] <= 10; 1 <= d <= 1000.

Loading...
Test Cases:No test cases
No test cases available.
The Divisible Tally at Glowtide - EASY Coding Problem | CodeTikki