CT1414

Quill's Ledger of barrels

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

It is audit day at the mining town of Ironvein. Quill spreads the barrels records across the table and picks up a sharp pencil. 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 <= 91; -1000000 <= a[i] <= 1000000; 1 <= d <= 1000.

Example 1:

Input: 90 530 759404 403655 659551 709437 -996246 485376 398620 -615726 897908 -345342 -939025 -849337 278628 563091 -956840 -241335 391461 700958 -292948 738015 -921392 -489076 507401 930149 -132691 198426 261672 731811 -383113 -735423 613830 -673613 -833815 835203 239448 -326404 892379 543076 580580 558757 170280 694240 91680 -216082 409047 357508 850309 972764 -235620 -789082 833355 -536028 -360110 -72299 625917 -875385 790458 564724 -287191 983060 -702730 813274 293059 -792987 710029 722129 -314867 -695487 371016 53207 970178 815402 -395630 -329360 77975 362064 863502 484933 293541 -101566 -855470 427454 -59177 -848638 662458 298499 485040 769731 768940 246765
Output: 0

Example 2:

Input: 57 172 -710799 -966836 -456449 -785092 171379 258072 -652174 482145 747621 -216788 -918769 453729 -226252 -337802 483932 729539 -192279 266261 -996984 -914351 -185001 14410 149372 -598698 -866853 274729 -449598 269949 341215 -236595 -360671 789847 -36435 -226991 574221 841371 878660 98703 -880580 526986 122381 -555925 99193 -838889 254825 -696480 81098 -371196 343337 -652483 -176404 -176362 -792458 -454189 -496056 -534904 364570
Output: 0

Example 3:

Input: 53 521 888593 515601 -646428 -625440 730030 334764 816370 392555 416037 813774 -413798 -144825 216319 884880 -356150 -822264 -914218 493133 -202983 -655813 -667457 287830 688812 517640 -400364 -588216 184402 -362 439997 321732 -851944 150333 -448531 164967 -87493 365976 -477428 391443 44319 -840655 170185 -62369 499675 95357 -416945 986544 -523807 -331712 928200 342521 -90807 359374 -947828
Output: 0

Constraints:

1 <= n <= 91; -1000000 <= a[i] <= 1000000; 1 <= d <= 1000.

Loading...
Test Cases:No test cases
No test cases available.
Quill's Ledger of barrels - EASY Coding Problem | CodeTikki