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<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9+7;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
int main(){
    cout << fixed << setprecision(10);
    while(1){
        int n,l,r;
        cin >> n >> l >> r;
        if(n==0 && l==0 && r==0) break;
        vector<int> v(n);
        rep(i,n) cin >> v[i];
        int cnt = 0;
        for(int i=l; i<=r; i++){
            bool ok = 0;
            for(int j=0;j < n;j++){
                if(i%v[j] == 0){
                    ok = 1;
                    if((j+1) % 2 != 0){
                        cnt++;
                    } 
                    break;
                }
            }
            if(ok == 0 && n%2 == 0) cnt++;
        }
        cout << cnt << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	int n,l,r,a[100000];
	while(cin>>n>>l>>r,n){
		int ans=0;
		for(int i=0;i<n;i++)cin>>a[i];
		for(int i=l;i<=r;i++){
			int flag=0;
			for(int j=0;j<n;j++){
				if(i%a[j]==0){
					if(j%2==0)ans++;
					flag++;
					goto L;
				}
			}
			L:;
			if(!flag){
				if(n%2==0)ans++;
			}
		}
		cout<<ans<<endl;
	}
}

C++: #include <bits/stdc++.h>

using namespace std;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000
#define MOD 1000000007

typedef long long ll;
typedef pair<ll,ll> P;

int main(){
	
	int n,l,r;
	while(cin >> n >> l >> r,n+l+r){
		
		vector<pair<ll,ll>> v;
		REP(i,n){
			int tmp;cin >> tmp;
			v.PB(MP(tmp,i+1));
		}
		
		
		ll ans = 0;
		
		for(int i = l;i <= r;i++){
			bool flag = false;
			
			for(int j = 0;j < n;j++){
				if(i % v[j].FI == 0){
					flag = true;
					if(v[j].SE % 2 != 0)ans++;
					break;
				}
			}
			
			if(!flag && n % 2 == 0)ans++;
		}
		
		cout << ans << endl;
		
	}
	
	return 0;
}

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

int solve(int n, int l, int r) {
    vector<int> A(n);
    int ans = 0;
    for (int i = 0; i < n; i++) {
        cin >> A[i];
    }

    for (int year = l; year <= r; year++) {
        bool flag = false;
        for (int i = 0; i < n; i++) {
            if (year % A[i] == 0) {
                if (i % 2 == 0) ans++;
                flag = true;
                break;
            }
        }
        if (!flag && n % 2 == 0) ans++;
    }
    return ans;
}

int main(void) {
    int n, l, r;
    vector<int> ans;
    while (1) {
        cin >> n >> l >> r;
        if (!n && !l && !r) break;
        ans.push_back(solve(n, l, r));
    }
    for (int i : ans) cout << i << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))

int main(){
    int n,l,r;
    while(cin >>n >>l >>r,n){
        vector<int> a(n);
        rep(i,n) cin >>a[i];

        auto is_uruu = [&](int x){
            rep(i,n)if(x%a[i]==0) return !(i%2);
            return !(n%2);
        };

        int ans = 0;
        for(int i=l; i<=r; ++i) ans += is_uruu(i);
        cout << ans << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = int_fast64_t;
const int mod = 1e9 + 7;
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
#define fast() ios::sync_with_stdio(false), cin.tie(nullptr)
#define digit(N) cout << fixed << setprecision((N))
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

bool is_uruu(vector<int> &a, int x)
{
    int index = -1, n = a.size();

    for (int i = 0; i < n; i++)
    {
        if (x % a[i] == 0)
        {
            return (i + 1) % 2 == 1;
        }
    }

    return index == -1 && n % 2 == 0;
}

int main()
{
    int N, l, r;
    while (cin >> N >> l >> r)
    {
        if (N == 0)
            return 0;
        vector<int> a(N);

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

        int ans = 0;

        for (int i = l; i <= r; i++)
        {
            ans += is_uruu(a, i);
        }

        cout << ans << "\n";
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
#define INF (1LL<<30)
#define DEKAI 1000000007
#define lp(i,n) for(int i=0;i<n;i++)
#define int long long

signed main(){
	while(1){
		int n,l,r;
		cin>>n>>l>>r;
		if(n==0&&l==0&&r==0)break;
		int a[50];
		lp(i,n){
			cin>>a[i];
		}
		int ans=0;
		for(int i=l;i<=r;i++){
			int now=i;
			lp(j,n){
				if(now%a[j]==0){
					if(j%2==0)ans++;
					break;
				}
				if(j==n-1){
					if(n%2==0)ans++;
				}
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}