program ex ; var v:array [1..20] of integer ; s,t,p,a,i,b,k :integer ; n:real; begin write ('a='); readln(a); write ('b='); readln (b); write ('k='); readln(k); for i:=1 to p do begin write ('v[',i,']='); readln (v[i]); end; s:=0; for i:=1 to p do if ( v[i]>=a ) and (v[i]<=b) and (v[i] mod k =0) then begin s:=s+v[i]; t:=t+1; end; if t=0 then writeln ('media nu se poate calcula') else begin n:=s/t; writeln ('media este ',n:5:2); end; readln; end.