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=1; i<=n; i++)
using namespace std;
int main(){
  int n,l,r;
  while(cin >> n >> l >> r,n){
    int count=0;
    int a[51];
    a[0] = 0;
    rep(i,n) cin >> a[i];
    for(int x=l; x<=r; x++){
      bool flag=false;
      rep(i,n){
        if(x%a[i] == 0){
          flag = true;
          if(i%2 != 0) {
            count++;
          }
          break;
        }
      }
      if(flag == false && n%2 == 0) count++;
    }
    cout << count << endl;
  }
  return 0;
}

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

#define int long long

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

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

    int ans = 0;
    for ( int i = l; i <= r; i++ ) {
      int j;
      for ( j = 0; j < n; j++ ) {
	if ( i%A[j] == 0 ) break;	
      }
      if ( j%2 == 0 ) ans++;      
    }

    cout << ans << endl;    
  }
  
  return 0;
}

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

int main(){
  while(true){
    int n, l, r, count = 0, A[60];
    cin>>n>>l>>r;
    if(!n&&!l&&!r) break;

    for(int i = 1; i <= n; i++){
      cin>>A[i];
    }
    
    for(int i = l; i <= r; i++){
      int flag = !(n%2);
      for(int j = 1; j <= n; j++){
	if(i%A[j] == 0){
	  if(j%2==1){
	    flag = true;
	    break;
	  }else{
	    flag = false;
	    break;
	  }
	}
      }
      if(flag)count++;
    }
    cout<<count<<endl;
  }
  return 0;
}

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;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
int n,l,r;
int a[60];
bool uru(int x){
    for(int i=0;i<n;i++){
        if((i)%2!=0 && x%a[i]==0){
            return false;
        }
        if((i)%2==0 && x%a[i]==0){
            return true;
        }
    }
    if(n%2==0) return true;
    else return false;
}
int main(){
    while(1){
        cin>>n>>l>>r;
        int cnt=0;
        if(n==0 && l==0 && r==0) break;
        for(int j = 0;j < n; j++){
            cin>>a[j];
        }
        for(int i = l;i <=r ; i++){
            if(uru(i)) {
                //cout<<i<<endl;
                cnt++;
            }
        }
        cout<<cnt<<endl;
    }
    return 0;
}

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

int main(){
    while(1){
        int N,L,R;
        cin>>N>>L>>R;
        if(N == 0 && L == 0 && R == 0) break;
        vector<int> A(N);
        for(int i=0; i<N; i++) cin>>A[i];

        int cnt = 0;

        for(int x=L; x<=R; x++){
        
            bool flag = false;
            bool exist = false;

            for(int i=0; i<N; i++){
                if(x % A[i] == 0){
                    if((i+1) % 2 != 0) flag = true;
                    exist = true;
                    break;
                }
            }
 
            if(!exist && N % 2 == 0) flag = true;
            if(flag) cnt++;
        }

        cout<<cnt<<endl;
    }

    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
using namespace std;



int main() {
    const long long int mod = 1000000007,INF=99999999999999;
	map<long long int, long long int>mp;
    string str[2005],tmp;
	cout << fixed << setprecision(10);
    bool f[505][505] = {};
    
    while(1){
        long long int n,l,r,a[105],res=0;
        cin>>n>>l>>r;
        if(n==0){return 0;}
        for(int i=0;i<n;i++){
            cin>>a[i];
        }
        a[n]=1;
        for(int i=l;i<=r;i++){
            for(int j=0;j<=n;j++){
                if(i%a[j]==0&&j%2==0){
                    res++;
                    break;
                }else if(i%a[j]==0){
                    break;
                }
            }
        }
        cout<<res<<endl;
    }
}

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

int main(){
    while(1){
        int n,l,r;
        cin >> n >> l >> r;
        if(n==0) break;

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

        int ans = 0;
        for(int i=l; i<=r; i++){
            int minj = n;
            for(int j=0; j<n; j++){
                if(i%a[j] == 0){
                    minj = j;
                    break;
                }
            }
            if(minj%2==0) ans++;
        }
        cout << ans << endl;
    }
    return 0;
}