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;
#define SZ(x) (int)(x.size())
#define REP(i, n) for(int i=0;i<(n);++i)
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(int)(n)-1;i>=0;--i)
#define RFOR(i, a, b) for(int i=(int)(b)-1;i>=(a);--i)
#define ALL(a) a.begin(),a.end()
#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;
const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;
template <typename T1, typename T2>
bool chmax(T1 &a, const T2 &b) {
    if (a < b) { a = b; return true; }
    return false;
}
template <typename T1, typename T2>
bool chmin(T1 &a, const T2 &b) {
    if (a > b) { a = b; return true; }
    return false;
}
template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    os << "[";
    REP(i, SZ(v)) {
        if (i) os << ", ";
        os << v[i];
    }
    return os << "]";
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const map<T1, T2> &mp) {
    os << "{";
    int a = 0;
    for (auto &tp : mp) {
        if (a) os << ", "; a = 1;
        os << tp;
    }
    return os << "}";
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
    os << p.first << ":" << p.second;
    return os;
}


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    for (;;) {
        int N, L, R; cin >> N >> L >> R;
        if (N == 0) break;
        vi A(N);
        REP(i, N) cin >> A[i];
        A.push_back(1);
        int ans = 0;
        FOR(x, L, R+1) {
            int idx = -1;
            REP(i, N+1) {
                if (x % A[i] == 0) {
                    idx = i;
                    break;
                }
            }
            ans += idx % 2 == 0;
        }
        cout << ans << endl;
    }

    return 0;
}

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

int n, l, r;

int solve(int year, vector<int> v) {
    for (int i = 0; i < v.size(); i++) {
        if (year % v[i] == 0) {
            return i + 1;
        }
    }
    return -v.size();
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    while (1) {
        cin >> n >> l >> r;
        if (!n & !l & !r) break;
        vector<int> furui;
        int t;
        for (int i = 0; i < n; i++) {
            cin >> t;
            furui.push_back(t);
        }
        int ans = 0, res;
        for (int i = l; i <= r; i++) {
            res = solve(i, furui);
            if (res < 0) {
                if ((-res) % 2 == 0) ans++;
            } else {
                if (res % 2 == 1) ans++;
            }
        }
        cout << ans << endl;
    }
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int n,r,l,a[50];
main()
{
	while(cin>>n>>l>>r,n)
	{
		for(int i=0;i<n;i++)cin>>a[i];
		int cnt=0;
		for(int i=l;i<=r;i++)
		{
			bool flag=n%2;
			for(int j=0;j<n;j++)
			{
				if(i%a[j]<1)
				{
					flag=j%2;
					break;
				}
			}
			cnt+=!flag;
		}
		cout<<cnt<<endl;
	}
}

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

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

void solve(int n, int l, int r) {
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    int ans = 0;
    for (int now_a = l; now_a <= r; now_a++) {
        bool is_ok = true;
        bool is_continue = true;
        for (int i = 0; i < n; i++) {
            if (now_a % a[i] == 0 && i % 2) {
                is_ok = false;
                break;
            }
            else if (now_a % a[i] == 0 && i % 2 == 0) {
                is_continue = false;
                break;
            }
        }
        if (!is_ok) continue;
        if (!is_continue) {
            ans++;
            continue;
        }
        if (n % 2 == 0) ans++;
    }
    cout << ans << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, L, R;
    while (true) {
        cin >> N >> L >> R;
        if (N == 0 && L == 0 && R == 0) break;
        solve(N, L, R);
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
using ll = long long;
int main() {
    ll n, l, r;
    while(cin >> n >> l >> r, n) {
        vector<ll> A(n);
        for(auto &x:A) cin >> x;
        auto uruu = [&]() {
            ll ctr = 0;
            for(int i = l; i <= r; i++) {
                int j = 0;
                while(j < n && i % A[j] != 0) j++;
                ctr += (j % 2 == 0);
            }
            return ctr;
        };
        cout << uruu() << endl;
    }
}

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

const int MAX_N=51;

int n,l,r,ans,ok;
vector<int> A(MAX_N);

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(cin >> n >> l >> r,n){
        for (int i=0;i<n;++i) cin >> A[i];
        ans=0;
        for (int x=l;x<=r;++x){
            ok=-1;
            for (int i=0;i<n;++i){
                if (x%A[i]==0){ok=i+1; break;}
            }
            if (ok<0&&!(n&1)) ++ans;
            if (ok>=0&&(ok&1)) ++ans;
        }
        cout << ans << '\n';
    }
}