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;

int main() {
    int n, l, r;

    while (cin >> n >> l >> r, n || l || r) {
	vector<int> a(n);
	for (auto& i : a) cin >> i;

	int count = 0;
	for (int x = l; x <= r; x++) {
	    int i;
	    for (i = 0; i < n; i++) {
		if (x % a[i] == 0)
		    break;
	    }

	    if ((i < n && i % 2 == 0) || (i >= n && n % 2 == 0))
		count++;
	}

	cout << count << 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) break;
        vector<int> a(n);
        for(int i = 0; i < n; i++) cin >> a[i];

        int ans = 0;
        for(int x = l; x <= r; x++){
            int i;
            for(i = 1; i <= n; i++){
                if(x % a[i - 1] == 0){
                    break;
                }
            }

            ans += (i % 2 == 1);

        }

        cout << ans << endl;
    }

    return 0;
}

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

int n, l, r, A[4000];

signed main(){
  
  while(1){
    
    cin>>n>>l>>r;
    if( !n && !l && !r ) break;
    
    for(int i=1;i<=n;i++) cin>>A[i];
    
    int ans = 0;
    
    for(int num=l;num<=r;num++){
      
      int idx = 0;
      
      for(int i=1;i<=n;i++){
	
	if( num % A[i] == 0 ){
	  idx = i;
	  break;
	}
	
      }
      
      if( idx ) ans += idx % 2;
      else ans += n % 2 == 0;
      
    }
    
    cout<<ans<<endl;
    
  }
  
  return 0;
}

C++: #include<bits/stdc++.h>
#define MAX 100
#define inf 1<<29
#define linf (1e16)
#define eps (1e-8)
#define Eps (1e-12)
#define mod 1000000007
#define pi acos(-1.0)
#define phi (1.0+sqrt(5.0))/2.0
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define pd(a) printf("%.10f\n",(double)(a))
#define pld(a) printf("%.10Lf\n",(ld)(a))
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(a)-1;(b)<=i;i--)
#define Unique(v) v.erase(unique(all(v)),v.end())
#define equals(a,b) (fabs((a)-(b))<eps)
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<int,double> pid;
typedef pair<double,int> pdi;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<pii> vpi;

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

C++: #include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;


int main(){
    while(1) {
    int n, l, r; cin >> n >> l >> r;
    if(n==0 && l==0 && r==0) return 0;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    int count=0;
    for(int i=l; i<=r; i++) {
        int res = -1;
        for(int j=0; j<n; j++) {
            if(i % a[j] == 0) {
                res = j;
                break;
            }
        }
        if(res % 2 == 0) count++;
        else if(n % 2 == 0 && res ==-1) count++; 
    }
    cout << count << endl;
    }
}

C++: #include <iostream>
#include <algorithm>
#include <vector>

using namespace std;


int main(){
  int n,l,r;
  while(cin >> n >> l >> r && n!=0 && l!=0 && r!=0){
    vector<int> a(n);
    for(int i=0;i<n;++i) cin >> a[i];

    int num=0;
    for(int i=l;i<=r;++i){
      int flag=0;
      for(int j=0;j<n;++j){
	if(i%a[j]==0) {
	  flag++;
	  if((j+1)%2==1) num++;
	  break;
	}
      }
      if(flag==0 && n%2==0) num++;
    }
    cout << num << endl;
  }

  
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define pb push_back
int l,r,n,a[55];
int main(){
	while(1){
		cin>>n>>l>>r;if(n==0) return 0;
		rep(i,n) cin>>a[i];
		int ans = 0;
		for(int x=l;x<=r;x++){
			rep(i,n){
				if(x%a[i] == 0){
					if(i%2 == 0) ans++;
					goto nxt;
				}
			}
			if(n%2 == 0) ans++;
		nxt:;
		}
		cout << ans << endl;
	}
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
using namespace std;
using llong = long long;

llong n, l, r;
llong a[55];

bool is_u(llong x) {
    for (int i = 0; i < n; i++) {
        if (x % a[i] == 0) {
            return i % 2 == 0; 
        }
    }

    return n % 2 == 0;
}

int main() {
    cin >> n >> l >> r;

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

        llong cnt = 0;
        for (int i = l; i <= r; i++) {
            if (is_u(i)) cnt++;
        }

        cout << cnt << '\n';

        cin >> n >> l >> r;
    }
    

    return 0;
}