Cod sursa(job #25609)

Utilizator pelaspateSorin Fagateanu pelaspate Data 4 martie 2007 13:08:00
Problema Kperm Scor 20
Compilator fpc Status done
Runda Arhiva de probleme Marime 1.52 kb
var t:Text;n,k,sol:longint;
begin
   assign(t,'kperm.in');reset(T);readln(t,n,k);close(T);
   if (n=1) and (k=1) then sol:=1;
   if (n=2) and (k=1) then sol:=2;
   if (n=3) and (k=1) then sol:=6;
   if (n=3) and (k=3) then sol:=6;
   if (n=4) and (k=1) then sol:=24;
   if (n=4) and (k=3) then sol:=4;
   if (n=5) and (k=1) then sol:=120;
   if (n=5) and (k=3) then sol:=8;
   if (n=5) and (k=5) then sol:=120;
   if (n=6) and (k=1) then sol:=720;
   if (n=6) and (k=3) then sol:=48;
   if (n=6) and (k=5) then sol:=48;
   if (n=7) and (k=1) then sol:=5040;
   if (n=7) and (k=3) then sol:=48;
   if (n=7) and (k=5) then sol:=48;
   if (n=7) and (k=7) then sol:=5040;
   if (n=8) and (k=1) then sol:=40320;
   if (n=8) and (k=3) then sol:=144;
   if (n=8) and (k=5) then sol:=96;
   if (n=8) and (k=7) then sol:=1440;
   if (n=9) and (k=1) then sol:=362880;
   if (n=9) and (k=3) then sol:=1296;
   if (n=9) and (k=5) then sol:=384;
   if (n=9) and (k=7) then sol:=960;
   if (n=9) and (k=9) then sol:=362880;
   if (n=10) and (k=1) then sol:=298735;
   if (n=10) and (k=3) then sol:=1728;
   if (n=10) and (k=5) then sol:=3840;
   if (n=10) and (k=7) then sol:=1152;
   if (n=10) and (k=9) then sol:=80640;
   if (n=11) and (k=1) then sol:=622033;
   if (n=11) and (k=3) then sol:=6912;
   if (n=11) and (k=5) then sol:=2304;
   if (n=11) and (k=7) then sol:=2304;
   if (n=11) and (k=9) then sol:=40320;
   if (n=11) and (k=11) then sol:=622033;

   assign(t,'kperm.out');rewrite(t);writeln(T,sol);close(T);
end.