比赛 20101118 评测结果 AAWWWWWWWW
题目名称 最终得分 20
用户昵称 maxiem 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2010-11-18 10:40:51
显示代码纯文本
program eight;
var
  num:array [1..15] of integer;
  t,x,y,n,nx,ny,a,b,tmp,i,sum:longint;
procedure print;
begin
  writeln(0);
  close (output);
  halt;
end;
begin
  assign (input,'eight.in');
  reset (input);
  assign (output,'eight.out');
  rewrite (output);
  readln (n);
  for i:=1 to n do begin
    read (num[i]);
	if (num[i]=1) or (num[i]=2) or (num[i]=4) or (num[i]=8) then print;
  end;
  readln (X,Y);
  sum:=(y div 8)-(x div 8);
  for i:=1 to n do if num[i] mod 8<>0 then begin
    a:=num[i];b:=8;
    if a<b then begin
      tmp:=a;
      a:=b;
      b:=tmp;
    end;
    while b>0 do begin
      tmp:=a mod b;
      a:=b;
      b:=tmp;
    end;
    t:=num[i]*8 div a;
	nx:=x div t+1;
	ny:=y div t;
	sum:=sum-(ny-nx+1);
  end;
  close (input);
  writeln (sum);
  close (output);
end.