比赛 20101118 评测结果 AAATTTTTTT
题目名称 最终得分 30
用户昵称 ybh 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2010-11-18 09:43:06
显示代码纯文本
{八 NOIP模拟2010-11-18
 Author: yangbohua
 Time: 2010-11-18}

program eight;
var
  a:array[0..20] of longint;
  n,i,j,s,t,temp,ans:longint;
  bool:boolean;

begin
  assign(input,'eight.in');
  reset(input);
  assign(output,'eight.out');
  rewrite(output);
  readln(n);
  for i:=1 to n do
  begin
    read(a[i]);
    if (a[i]=1) or (a[i]=2) or (a[i]=4) or (a[i]=8) then
    begin
      writeln(0);
      close(input);
      close(output);
      halt;
    end;
  end;
  readln(s,t);
  temp:=(s div 8)*8;
  if temp<s
    then s:=temp+8;
  t:=(t div 8)*8;
  i:=s;
  ans:=0;
  while i<=t do
  begin
    bool:=true;
    for j:=1 to n do
      if (i>=a[j]) and (i mod a[j]=0) then
      begin
        bool:=false;
        break;
      end;
    if bool then ans:=ans+1;
    i:=i+8;
  end;
  writeln(ans);
  close(input);
  close(output)
end.