Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/massiv-k-karrali-elementlar

Count and sum of multiples of K

Easy 1000 ms 128 MB 22%
Share

A positive integer $n$, an array of $n$ integers and a positive integer $k$ are given. Find the number of array elements divisible by $k$ without remainder and their sum.

The count and the sum of the elements that are multiples of a given number

Input

The first line contains two positive integers: $n$ and $k$. The second line contains $n$ positive integers separated by spaces.

Output

One line with two integers separated by a space: the count and the sum.

Note

$1 \le n \le 1000$
$1 \le k \le 10^{4}$
$1 \le a_{i} \le 10^{6}$

Examples

Input #1
6 3
9 4 12 7 15 2
Output #1
3 36
Input #2
4 5
2 3 7 8
Output #2
0 0

Sign in to submit a solution

Signing up is free and takes a minute.