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 <iomanip>
#include <string>
#include <algorithm>
#include <sstream>
#include <complex>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <limits>
#include <numeric>

using namespace std;
#define all(a) begin(a), end(a)

using ll = long long;
using ull = unsigned long long;
template <typename T>
using vec = vector<T>;
template <typename T>
using vec2 = vector<vec<T>>;

template <typename V, typename H>
void resize(vector<V> &vec, const H h)
{
    vec.resize(h);
}

template <typename V, typename H, typename... T>
void resize(vector<V> &vec, const H &h, const T... t)
{
    vec.resize(h);
    for (auto &v : vec)
    {
        resize(v, t...);
    }
}

template <typename V, typename T>
void fill(V &x, const T &val)
{
    x = val;
}

template <typename V, typename T>
void fill(vector<V> &vec, const T &val)
{
    for (auto &v : vec)
    {
        fill(v, val);
    }
}

struct pre_
{
    pre_()
    {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(6);
    }
} pre__;

int main(void)
{
    while (1)
    {

        int n, l, r;

        int answer = 0;

        cin >> n >> l >> r;
        vector<int> get_input(n);
        if (n == 0 && l == 0 && r == 0)
        {
            break;
        }
        for (int i = 0; i < n; i++)
        {
            cin >> get_input[i];
        }
        for (int x = l; x <= r; x++)
        {
            int tmp = -1;
            for (int i = 0; i < n; i++)
            {
                if (x % get_input[i] == 0)
                {
                    tmp = i;
                    break;
                }
            }
            if (tmp == -1)
            {
                if (n % 2 == 0)
                {
                    answer++;
                }
            }
            else
            {
                if ((tmp + 1) % 2 == 0)
                {
                }
                else
                {
                    answer++;
                }
            }
        }
        cout << answer << endl;
        
    }

    return 0;
}

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

#define int long long
signed  main(void)
{

    while(true){
        vector<int> A;
        int n, l, r;
        int con = 0;
        
        cin>>n>>l>>r;

        if(!n && !l && !r) break;

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

        for(int i = l; i <= r; i++){
            bool flag = !(n%2);
            for(int j = 0; j < n; j++){
                if(i%A[j] == 0){
                    if(j%2 == 0) flag = true;
                    else flag = false;
                    break;
                }
            }
            if(flag) con++;
        }

        cout<<con<<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int n, l, r;
    while(cin >> n >> l >> r, n){
        vector<int> v(n+1, 1);
        for (int i = 0; i < n; ++i) {
            scanf("%d", &v[i]);
        }
        int cnt = 0;
        for (int i = l; i <= r; ++i) {
            for (int j = 0; j <= n; ++j) {
                if(i%v[j] == 0) {
                    cnt += (j^1)&1;
                    break;
                }
            }
        }
        cout << cnt << "\n";
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define INF 1e18
#define int long long
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) Rep(i, 0, n)
#define all(a) (a).begin(), (a).end()
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int mod = 1000000007;
//const int mod = 998244353;

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    while (1)
    {
        int n, l, r;
        cin >> n >> l >> r;
        if (n == 0)
            break;
        vector<int> a(n);
        rep(i, n) cin >> a[i];
        int ans = 0;
        for (int y = l; y <= r; y++)
        {
            bool uruu = false, f = true;
            rep(i, n) if (y % a[i] == 0)
            {
                f = false;
                if (i % 2 == 0)
                    uruu = true;
                break;
            }
            if (f && n % 2 == 0)
                uruu = true;
            if (uruu)
                ans++;
        }
        cout << ans << endl;
    }
}