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>
using namespace std;

// region template
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) begin(x), end(x)
#define sz(x) (ll)(x).size()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

ll gcd(ll a, ll b) { return __gcd(a, b); }

ll euclid(ll a, ll b, ll &x, ll &y) {
    if (b) {
        ll d = euclid(b, a % b, y, x);
        return y -= a / b * x, d;
    }
    return x = 1, y = 0, a;
}

typedef unsigned long long ull;
typedef long double ld;
ull mod_mul(ull a, ull b, ull M) {
    ll ret = a * b - M * ull(ld(a) * ld(b) / ld(M));
    return ret + M * (ret < 0) - M * (ret >= (ll)M);
}
ull mod_pow(ull b, ull e, ull mod) {
    ull ans = 1;
    for (; e; b = mod_mul(b, b, mod), e /= 2)
        if (e & 1)
            ans = mod_mul(ans, b, mod);
    return ans;
}

const ll mod = 1000000007;
struct Mod {
    ll x;
    Mod(ll xx) : x(xx) {}
    Mod operator+(Mod b) { return Mod((x + b.x) % mod); }
    Mod operator-(Mod b) { return Mod((x - b.x) % mod); }
    Mod operator*(Mod b) { return Mod((x * b.x) % mod); }
    Mod operator/(Mod b) { return *this * invert(b); }
    Mod invert(Mod a) {
        ll x, y, g = euclid(a.x, mod, x, y);
        assert(g == 1);
        return Mod((x + mod) % mod);
    }
    Mod operator^(ll e) {
        if (!e)
            return Mod(1);
        Mod r = *this ^ (e / 2);
        r = r * r;
        return e & 1 ? *this * r : r;
    }
};
// endregion

int main() {
    cin.sync_with_stdio(0);
    cin.tie(0);
    cin.exceptions(cin.failbit);

    for (;;) {
        int n, l, r;
        cin >> n >> l >> r;
        if (!n)
            break;

        vector<int> v(n);
        rep(i, 0, n) cin >> v[i];

        int ans = 0;
        for (int i = l; i <= r; i++) {
            for (int j = 0; j < n; j++) {
                if (i % v[j] == 0) {
                    if (~j & 1) ans++;
                    goto nxt;
                }
            }
            if (~n & 1) ans++;
            nxt: void(0);
        }
        cout << ans << endl;
    }
}

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

char s[500005];
ll y,m,d;
ll ans;
ll x[500005];
ll l,r;
ll n;

bool solve(){
	cin >> n >> l >> r;
	if(n == 0)return false;
	for(int i=0;i<n;i++){
		cin >> x[i];
	}
	ans = 0;
	for(int i=l;i<=r;i++){
		//check i
		bool used = false;
		for(int j=0;j<n;j++){
			if(i % x[j] == 0){
				if(j % 2 == 0){
					used = true;
					ans++;
					break;
				}else{
					used = true;
					break;
				}
			}
		}
		if(!used){
			if(n % 2 == 0){
				ans++;
			}
		}
	}
	cout << ans << endl;
	return true;

}




int main(){
	while(solve()){}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main() {
	int n, l, r;
	while (cin >> n >> l >> r, n) {
		int ans = 0, a[60];
		for (int i = 0; i < n; i++)cin >> a[i];
		for (int y = l; y <= r; y++) {
			int i;
			for (i = 0; i < n; i++) {
				if (y%a[i] == 0)goto a;
			}
			ans += (n % 2 + 1) % 2; goto b;
		a:ans += (i % 2 + 1) % 2;
		b:;
		}
		cout << ans << endl;
	}
}

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

int main(){
	int n,l,r;
	//while(scanf("%d%d%d",&n,&l,&r),n){
	cin>>n>>l>>r;
	while(n!=0){
	int A[1000];
	//scanf("%d%d%d",&A[0],&A[1],&A[2]);
	for(int i=0;i<n;i++) cin>>A[i];
	int Unum=0;
	for(int i=l;i<=r;i++){
		int count=0;
		for(int k=0;k<n;k++){
			if(i%A[k]==0){
				count++;
				if(k%2==0){
					Unum++;
				}
				break;
			}
		}
		if(count==0&&n%2==0){
				Unum++;
			}
	}
	//printf("%d\n",Unum);
	cout<<Unum<<endl;
	cin>>n>>l>>r;
	}

	return 0;
}

C++: #include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;



int main() {
    while(true) {
        int n, l, r;
        cin>>n>>l>>r;
        if(n+l+r==0)break;
        vector<int> a(n);
        rep(i,n){
            cin>>a[i];
        }
        int ans=0;
        for(int ye=l;ye<=r;ye++){
            bool t1=true;
            rep(i,n){
                if(ye%a[i]==0){
                    if((i+1)%2){ans++;}
                    t1=false;
                    break;
                }
            }
            if(t1){
                if(n%2==0){
                    ans++;
                }
            }

        }
        cout<<ans<<endl;
    }


    return 0;
}

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

int main() {
    int n, l, r;
    while (cin >> n >> l >> r, n | l | r) {
        int ans = 0;
        int a[n];
        for (int i = 0; i < n; i++) cin >> a[i];
        for (int x = l; x <= r; x++) {
            int f = 1;
            for (int i = 0; i < n; i++) {
                if (x % a[i] == 0) {
                    f = 0;
                    if (i % 2 == 0) ans++;
                    break;
                }
            }
            if (f && n % 2 == 0) ans++;
        }
        cout << ans << endl;
    }
    return 0;
}