Pagini recente » Cod sursa (job #270559) | Cod sursa (job #2366261) | Cod sursa (job #2909134) | Cod sursa (job #1043824) | Cod sursa (job #122673)
Cod sursa(job #122673)
program loto;
{$APPTYPE CONSOLE}
uses
SysUtils;
var fin,fout:text;
S,a,b,c,d,e,f,g,i,j,n,m:Longint;
v:array [1..100] of longint;
{*--------------MAIN--------*}
begin
assign(fin,'loto.in'); reset(fin);
assign(fout,'loto.out'); rewrite(fout);
readln(fin,n,s);
for i:=1 to n do read(fin,v[i]);
For a:=1 to n do
for b:=1 to n do
for c:=1 to n do
for d:=1 to n do
for e:=1 to n do
for f:=1 to n do
// for g:=1 to n do
if V[a]+v[b]+v[c]+v[d]+v[e]+v[f] = S then
Begin
Write(fout,v[a],' ',v[b],' ',v[c],' ',v[d],' ',v[e],' ',v[f]);
Close(fout);
Exit;
End;
close(fin);
Writeln(fout,-1);
close(fout);
end.