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;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

void solve(int n,int l,int r){
	vl v(n);
	vb b(r+1,(n%2==0));
	rep(i,n)cin>>v[i];
	rrep(i,n){
		range(j,l,r+1){
			if(j%v[i]==0){
				b[j]=(i%2==0);
			}
		}
	}
	int cnt=0;
	range(i,l,r+1)if(b[i])cnt++;
	cout<<cnt<<endl;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,l,r;
	while(cin>>n>>l>>r,n)solve(n,l,r);
}

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

using i64 = int64_t;

int main(){
    int n, l, r;
    while(cin >> n >> l >> r, n != 0){
        vector<int> v;
        for(int i=0;i<n;++i){
            int tmp;
            cin >> tmp;
            v.push_back(tmp);
        }
        int ans = 0;
        for(int i=l;i<=r;++i){
            bool is_leap = false, exist = false;
            for(int j=0;j<v.size();++j){
                if(i%v[j] != 0)continue;
                if((j+1)%2 != 0)is_leap = true;
                else is_leap = false;
                exist = true;
                break;
            }
            if(!exist){
                if(n%2)is_leap = false;
                else is_leap = true;
            }
            if(is_leap)ans++;
        }
        cout << ans << endl;
    }

    return 0;
}

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

int n, l, r, a[50];

int main() {
	int i, j;
	
	while(cin >> n >> l >> r) {
		if (!n) break;
		for (i = 0; i < n; i++) cin >> a[i];
		
		int cnt = 0;
		for (i = l; i <= r; i++) {
			for (j = 0; j < n; j++) if (i % a[j] == 0) break;
			if (j % 2 == 0) { cnt++; }
		}
		cout << cnt << endl;
	}
	return 0;
}

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

bool judgeLeapYear( int* a, int x, int n )
{
    for( int i = 0; i < n; i++ )
        if( x % a[i] == 0 )
        {
            if( ( i + 1 ) % 2 != 0 )
                return true;
            else
                return false;
        }
    if( n % 2 == 0 )
        return true;
    else
        return false;
}

int main()
{
    int a[50], n, x, y;

    while( cin >> n >> x >> y )
    {
        if( n + x + y == 0 )
            break;

        for( int i = 0; i < n; i++ )
            cin >> a[i];

        int cnt = 0;
        for( int i = x; i <= y; i++ )
            if( judgeLeapYear( a, i, n ) )
                cnt++;

        cout << cnt << endl;

    }
    return 0;
}

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

int main(){

    for(int N, L, R; cin >> N >> L >> R;){
        if(N == 0)break;
        vector<int>A(N + 1);
        for(int i = 1; i <= N; i++)cin >> A[i];
        int ans = 0;
        for(int x = L; x <= R; x++){
            int flg = -1;
            for(int i = 1; i <= N; i++){
                if(x % A[i] == 0){
                    if(i & 1)flg = 1;
                    else flg = 0;
                    break;
                }
            }
            if(flg < 0){
                if(N & 1)flg = 0;
                else flg = 1;
            }
            if(flg)ans++;
        }
        cout << ans << endl;
    }

    return 0;
}