CT347

The Divisible Tally Beneath Firefly Mere

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Legend says the vault under the lantern lake of Firefly Mere opens only for a perfect tally of ingots. Minstrel means to find out. 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; -1000000 <= a[i] <= 1000; 1 <= d <= 1000.

Example 1:

Input: 41 459 -437036 -986131 -12623 -464806 -188161 -771551 -388025 -427391 -484150 -630085 -937989 -979724 -117016 -691282 -114157 -652658 -538666 -251461 -157303 -233639 -695907 -824905 -840427 -763883 -514468 -453561 -459186 -899542 -979119 -607276 -888485 -638019 -138743 -22482 -780122 -859049 -642776 -255853 -750419 -680560 -584781
Output: 0

Example 2:

Input: 46 941 -133080 -174923 -833358 -294651 -447063 -947077 -765539 -656121 -930223 -722681 -249208 -763600 -395340 -783725 -472393 -374390 -148508 -120591 -219188 -697673 -92023 -630400 -589456 -167701 -592415 -568817 -546948 -594223 -308062 -826658 -526801 -334411 -303890 -905690 -837539 -602719 -320668 -104223 -72958 -969442 -692832 -221472 -268753 -717208 -673038 -792153
Output: 0

Example 3:

Input: 50 78 -611345 -348774 -383084 -961931 -519763 -323051 -378433 -203142 -855242 -232913 -411078 -102727 -210103 -77471 -258972 -158614 -354592 -694734 -651382 -763960 -154057 -275771 -209730 -966839 -696993 -744765 -805795 -274873 -403122 -751942 -785977 -406455 -31961 -486899 -798853 -477974 -835574 -283266 -921262 -362867 -693640 -173630 -95818 -957696 -839727 -569529 -953495 -333630 -508720 -544074
Output: 0

Constraints:

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

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