Pagini recente » Cod sursa (job #2267711) | Cod sursa (job #2090514) | Cod sursa (job #2549900) | Cod sursa (job #2366876) | Cod sursa (job #67167)
Cod sursa(job #67167)
program loto;
var f,g:text;
n,i,s,max:integer;
a:array [1..100] of longint;
st:boolean;
begin
assign(f,'loto.in'); assign(g,'loto.out');
reset(f); rewrite(g);
read (f,n,s);
max:=0;
for i:=1 to n do
begin
read(f,a[i]);
if a[i]>max then max:=a[i];
end;
if s>6*max then writeln(g,'-1')
else
begin
st:=false;
for i:=1 to n do
if s=6*a[i] then begin writeln(g,a[i],' ',a[i],' ',a[i],' ',a[i],' ',a[i],' ',a[i]); st:=true; end;
if not st then writeln(g,'-1');
end;
close(f); close(g);
end.