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>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>
#include<random>
using namespace std;

int findI(vector<int>& A, int x)
{
	int ans = INT_MAX;
	for (int i = 1; i <= A.size(); ++i) if (x % A[i - 1] == 0) ans = min(i, ans);
	if (ans == INT_MAX) ans = -1;
	return ans;
}
int main()
{
	vector<int> AN;
	while (1)
	{
		int n, l, r;
		cin >> n >> l >> r;
		if (n == 0) break;
		vector<int> A(n);
		int ans = 0;
		for (int i = 0; i < n; ++i) cin >> A[i];
		for (int x = l; x <= r; ++x)
		{
			int i = findI(A, x);
			if (i != -1 && (i % 2 == 1)) ++ans;
			if (i == -1 && (n % 2 == 0)) ++ans;
		}
		AN.push_back(ans);
	}
	for (const auto& a : AN)
		cout << a << endl;
	return 0;
}

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

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

int main (void){
	int n, l, r;
	while(cin>>n>>l>>r, n+l+r){
		int ans = 0;
		vector<int> a(n+1);
		for(int i = 1; i <= n; ++i){
			cin >> a[i];
		}
		for(int y = l; y <= r; ++y){
			int i = 1;
			while(i <= n && y % a[i] != 0) i++;
			if(i==n+1){
				if(n%2==0){
					ans++;
				}
			}else{
				if(i%2==1){
					ans++;
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}

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

#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define ALL( a )        (a).begin(), (a).end()             

int main(void){
    int n, l, r;
    
    while( 1 ){
        cin >> n >> l >> r;
        if( n == 0 && l == 0 && r == 0 ) break;
        vector<int> a(n);
        REP( i, n ) cin >> a[i];
        
        int cnt = 0;
        FOR( i, l, r + 1 ){
            REP( j, n ){
                if( i % a[j] == 0 && ( ( j + 1 ) % 2 ) == 1 ){
                    cnt++;
                    break;
                }
                if( i % a[j] == 0 && ( ( j + 1 ) % 2 ) == 0 ){
                    break;
                }
                
                if( ( j == n - 1 ) && n % 2 == 0 ){
                    cnt++;
                } 
            }
        }
        
        cout << cnt << endl;
        
    }
    


}

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

C++: #include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<P,int> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-11;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int main(){;
	while(1){
		int n,l,r;
		cin>>n>>l>>r;
		if(n==0) break;
		vi a(n);
		for(auto &i:a) cin>>i;
		int res=0;
		for(int i=l;i<=r;i++){
			bool B=0;
			for(int j=0;j<n;j++) if(i%a[j]==0){
				if(j%2==0) res++;
				B=1;
				break;
			}
			if(B==0&&n%2==0) res++;
		}
		cout<<res<<endl;
	}
}