Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	io := NewIo()
	defer io.Flush()
	for {
		n, l, r := io.NextInt(), io.NextInt(), io.NextInt()
		if n == 0 {
			break;
		}
		A := make([]int, n)
		for i := 0; i < n; i++ {
			A[i] = io.NextInt()
		}
		cnt := 0
		for x := l; x <= r; x++ {
			for i := 0; i < n; i++ {
				if x%A[i] == 0 {
					if i%2 == 0 {
						cnt++
					}
					goto SKIP
				}
			}
			if n%2 == 0 {
				cnt++
			}
		SKIP:
		}
		io.Println(cnt)
	}
}

// I/O template
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buff []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buff = append(buff, line...)
		if !isPrefix {
			break
		}
	}
	return string(buff)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	s := io.tokens[io.nextToken]
	io.nextToken++
	return s
}

func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *Io) PrintIntSlice(a []int) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func (io *Io) PrintStringSlice(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func Log(name string, value interface{}) {
	fmt.Fprintf(os.Stderr, "%s=%+v\n", name, value)
}

func ExampleIo() {
	io := NewIo()
	defer io.Flush()
	a := make([]int, 0, 3)
	a[0], a[1], a[2] = io.NextInt(), io.NextInt(), io.NextInt()
	io.Println(a)
	io.PrintIntSlice(a)
	Log("io", a)
}

C++: #include<iostream>
using namespace std;

int main(){
    int n,l,r;

    while(1){
        int ans=0;

        cin>>n>>l>>r;
        if(n==0&&l==0&&r==0)break;

        int a[n];
        for(int i=0;i<n;i++){
            cin>>a[i];
        }

        for(int x=l;x<=r;x++){
            bool is=0;
            for(int i=0;i<n;i++){
                if(x%a[i]==0){
                    if(i%2==0)is =1;
                }else{
                    if(n%2==0)is =1;
                }
            }
            if(is ==1)ans++;
        }

        cout<<ans<<endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll f(vector<ll> a, ll r) {
  vector<int> c(r + 1);
  int n = a.size();
  for (int i = 0; i <= r; i++)
    c[i] = n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j * a[i] <= r; j++) {
      c[j * a[i]] = min(c[j * a[i]], i);
    }
  }
  ll ret = 0;
  for (int i = 0; i <= r; i++) {
    if (c[i] == n) {
      if (n % 2 == 0)
        ret++;
    } else {
      if (c[i] % 2 == 0)
        ret++;
    }
  }
  return ret;
}

int main() {
  while (true) {
    ll n, l, r;
    cin >> n >> l >> r;
    if (n == 0)
      break;
    vector<ll> a(n);
    for (int i = 0; i < n; i++)
      cin >> a[i];
    cout << f(a, r) - f(a, l - 1) << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  while (1){
    int n, l, r;
    cin >> n >> l >> r;
    if (n == 0 && l == 0 && r == 0){
      break;
    }
    vector<int> A(n);
    for (int i = 0; i < n; i++){
      cin >> A[i];
    }
    int ans = 0;
    for (int i = l; i <= r; i++){
      int m = n;
      for (int j = 0; j < n; j++){
        if (i % A[j] == 0){
          m = j;
          break;
        }
      }
      if (m % 2 == 0){
        ans++;
      }
    }
    cout << ans << endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //ai>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //ai>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define REV(x) (reverse(x.begin(),x.end())) //reverse
#define TO(x,t,f) ((x)?(t):(f))
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define FILV(x,a) fill(x.begin(),x.end(),a)
#define FILA(ar,N,a) fill(ar,ar+N,a)
#define NEXTP(x) next_permutation(x.begin(),x.end())
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;else return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define pb push_back
#define pri(aa) cout<<(aa)<<endl
#define mp(x,y) make_pair(x,y)
#define fi first
#define se second
const ll INF=1e18+7;
const ll MOD=1e9+7;
const ll N = 1007;


int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n,l,r;
	while(1){
		ll ans = 0;
		cin>>n>>l>>r;
		if(n==0&&l==0&&r==0)break;
		vector<ll> a(n);
		FOR(i,0,n){
			cin>>a[i];
		}
		FOR(i,l,r+1){
			bool bl=true;
			FOR(j,0,n){
				if(i%a[j]==0){
					bl=false;
					if(j%2==0)ans++;
					break;
				}
			}
			if(bl&&n%2==0)ans++;
		}
		cout<<ans<<endl;
	}

}

C++: #include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define rep(i, j, k) for (auto i = j; i < k; i++)
#define rrep(i, j, k) for (auto i = j; i > k; i--)
using namespace std;

void solve(int &n, int &l, int &r) {
  int a[51];
  rep(i, 0, n) cin >> a[i];
  int ans = 0;
  rep(i, l, r + 1) {
    bool uruu = (n & 1 ? false : true);
    rep(j, 0, n) {
      if (i % a[j] == 0) {
        uruu = (j & 1 ? false : true);
        break;
      }
    }
    if(uruu) ans++;
  }
  cout << ans << endl;
}

int main() {
  int n, l, r;
  while (cin >> n >> l >> r, n) solve(n, l, r);
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define f(i,x,n) for(int i=x;i<(int)(n);++i)
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=200005,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    while(1){
        int N,L,R;cin>>N>>L>>R;
        if(N+L+R==0) break;
        
        vector<int> A(N);
        for(int i=0;i<N;i++) cin>>A[i];
        int ans=0;
        
        for(int i=L;i<=R;i++){
            for(int j=0;j<N;j++){
                if(i%A[j]==0){
                    if(j%2==0) ans++;
                    break;
                }
                if(j==N-1&&N%2==0) ans++;
            }
        }
        
        cout<<ans<<endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
  while (true) {
    int n, l, r;
    cin >> n >> l >> r;
    if (n + l + r == 0) return 0;
    
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a.at(i);
    
    int ans = 0;
    for (int i = l; i <= r; i++) {
      bool flag = false;
      for (int j = 0; j < n; j++) {
        if (i % a.at(j) == 0 && j % 2 == 0) {
          ans++;
          flag = true;
          break;
        }
        else if (i % a.at(j) == 0) {
          flag = true;
          break;
        }
      }
      if (!flag) {
        if (n % 2 == 0) ans++;
      }
    }
    
    cout << ans << '\n';
  }
}