var
k,i,n:integer;
a:array[1..100] of integer;
sum:integer;
begin
write('n= ');readln(n);
write('k= ');readln(k);
for i:=1 to n do
write('a[',i,']= ');
readln(a[i]);
end;
if a[i] mod k = 0 then
sum:=sum+a[i];
writeln;
write('sum= ',sum);
readln;
end.
var
k,i,n:integer;
a:array[1..100] of integer;
sum:integer;
begin
write('n= ');readln(n);
write('k= ');readln(k);
for i:=1 to n do
begin
write('a[',i,']= ');
readln(a[i]);
end;
for i:=1 to n do
begin
if a[i] mod k = 0 then
sum:=sum+a[i];
end;
writeln;
write('sum= ',sum);
readln;
end.