比赛 20101118 评测结果 AWWTTTTTTT
题目名称 最终得分 10
用户昵称 magic 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2010-11-18 11:08:35
显示代码纯文本
program gls;
var
k,i,j,n,a,b,max,lc:longint;
ss:array[1..15]of longint;

f,g:text;
       function gcd(a,b:int64):int64;
      var
      t:longint;
      begin
      while a mod b <> 0 do
       begin
       t:=a mod b;
       a:=b;
       b:=t;
       end;
       gcd:=b;
      end;
      function lcm(a,b:int64):int64;
       begin
       lcm:= a*b div gcd(a,b);
       end;
begin
      assign(f,'eight.in');
      reset(f);
      assign(g,'eight.out');
      rewrite(g);
      readln(f,n);
      for k:=1 to n do
      read(f,ss[k]);
      readln(f,a,b);
      max:=trunc(b/8)-trunc(a/8);
      lc:=1;
      for k:=1 to n do
      lc:=lcm(lc,ss[k]);
  for k:=a to b do
  if lc mod k=0 then dec(max);


  writeln(g,max);


close(f);close(g);
end.