CT959

Wheelwright's Divisible Tally Ledger

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Caravans arrive at the cinnabar mines of Vermilion with crates of tickets, and Wheelwright the paymaster must account for every last one. 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 <= 99; 0 <= a[i] <= 1000; 1 <= d <= 1000.

Example 1:

Input: 85 333 194 139 120 277 220 320 327 1000 443 840 320 59 675 78 521 441 958 797 10 825 237 453 693 733 515 367 877 241 676 682 26 254 813 165 236 544 683 557 942 942 95 62 989 123 102 372 754 709 827 28 1 237 407 22 686 633 675 773 342 453 350 807 538 535 888 634 772 140 31 63 150 965 348 869 362 108 519 59 901 766 946 416 656 658 521
Output: 0

Example 2:

Input: 97 582 846 545 312 745 454 760 488 396 913 980 24 496 36 10 863 470 268 825 608 824 605 162 561 607 387 119 27 321 334 292 822 938 494 819 422 184 639 187 712 462 579 159 964 950 961 137 363 934 435 694 607 147 615 649 341 630 34 389 35 615 922 80 453 448 586 154 101 620 607 816 325 858 969 413 133 118 668 36 458 825 966 654 948 150 898 651 746 173 385 238 53 152 466 376 921 485 980
Output: 0

Example 3:

Input: 55 34 636 975 471 930 710 379 343 715 668 736 188 654 303 139 37 512 916 646 772 277 972 786 6 488 347 977 731 417 201 962 286 858 103 672 178 777 410 606 103 771 550 556 578 13 444 275 416 169 320 218 443 931 335 795 126
Output: 2

Constraints:

1 <= n <= 99; 0 <= a[i] <= 1000; 1 <= d <= 1000.

Loading...
Test Cases:No test cases
No test cases available.