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)
}

Python: while True:
    n, r, l = map(int, input().split())
    if n == 0:
        break
    else:
        a = []
        for i in range(n):
            a.append(int(input()))
        a.append(1)
        count = 0
        for i in range(r, l + 1):
            for j in range(n + 1):
                if i % a[j] == 0:
                    if j % 2 == 0:
                        count += 1
                    break
        print(count)

Python: while True:
    n, l, r = map(int, input().split())
    if n == 0: break
    A = [int(input()) for i in range(n)][::-1]
    y = [0]*(r+1)
    v = 2 - (n&1)   # v = 1 if n is odd
    for a in A:
        for i in range(a, r+1, a): y[i] = v
        v = 3-v
    ans = k = 0
    for i in range(l, r+1):
        if y[i] == 0: k += 1
        elif y[i] == 1: ans += 1
    if n & 1 == 0: ans += k
    print(ans)

Python: import math

while 1:
    n, l, r = map(int, input().split())
    if (n, l, r) == (0, 0, 0): break
    aa = [int(input()) for _ in range(n)]
    koho = set([i for i in range(l, r + 1)])
    baisu = set()
    uru = set()
    for i, a in enumerate(aa):
        start = math.ceil(l / a) * a
        for k in range(start, r + 1, a):
            baisu.add(k)
        # iが奇数の時＝うるう
        if not i % 2:
            uru |= koho & baisu
        koho -= baisu
    if not n % 2:
        uru |= koho
    print(len(uru))

C++: #include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a); i<ll(b); i++)
#define rer(i,a,b) for(ll i=ll(a)-1; i>=ll(b); i--)

using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    for(;;){
        int n,l,r;
        cin>>n>>l>>r;
        if(n==0) break;
        vector<int> a(n);
        rep(i,0,n) cin>>a[i];
        ll cnt=0;
        rep(x,l,r+1){
            rep(i,0,n){
                if(x%a[i]==0){
                    if(i%2==0){
                        cnt++;
                    }
                    break;
                }
                if(i==n-1&&n%2==0) cnt++;
            }
        }
        cout<<cnt<<"\n";
    }
}

C++: #include <iostream>

using namespace std;

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

  while(1){
    cin >> n >> l >> r;
    if(n == 0 ) break;
    
    int a[n];
    for(int i = 0; i < n; i++) cin >> a[i];

    int ansidx = -1, ans = 0;
    for(int x = l; x <= r; x++){
      for(int j = 0; j < n; j++){
        if( x % a[j] == 0 && x >= a[j]){
          ansidx = j;
          break;
        }
      }
      if(ansidx%2 == 0) ans++;
      if(ansidx == -1 && n % 2 == 0) ans++;
      ansidx = -1;
    }

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

C++: #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


#define NUM 4005

int N,L,R;
int table[NUM];

void func(){

	for(int i = 1; i <= N; i++){
		scanf("%d",&table[i]);
	}

	int ans = 0;
	int min_index;

	for(int x = L; x <= R; x++){

		min_index = BIG_NUM;

		for(int i = 1; i <= N; i++){
			if(x%table[i]== 0){
				min_index = i;
				break;
			}
		}

		if(min_index != BIG_NUM){

			if(min_index%2 == 1)ans++;

		}else{

			if(N%2 == 0)ans++;
		}
	}
	printf("%d\n",ans);
}

int main(){

	while(true){
		scanf("%d %d %d",&N,&L,&R);
		if(N == 0 && L == 0 && R == 0)break;

		func();
	}

	return 0;
}

C++: #include <bits/stdc++.h>

#define var auto
#define ll long long
//#define APPLY(a, f) f(a.begin(), a.end())
#define APPLY(a, f, ...) f(a.begin(), a.end(), __VA_ARGS__)
#define FUN1(x, f) [&](auto& x){return f;}
#define FUN2(x, y, f) [&](auto& x){return f;}
using namespace std;

int main() {
    while(true){
        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 res = 0;
        for (int y = l; y <= r; y++){
            for (int i = 0; i < n; i++){
                if (y % a[i] != 0) continue;
                if (i % 2 == 0) res++;
                goto end;
            }
            if (n % 2 == 0) res++;
            end:;
        }
        cout << res << endl;
    }
}

C++: #include <iostream>
using namespace std;
int main(void){
  for(;;){
    int n, l, r;
    cin >> n >> l >> r;
    if(n == 0 && l == 0 && r == 0){return 0;}
    int A[n];
    for(int i = 0 ; i < n ; i++){
      cin >> A[i];
    }
    int cnt = 0;
    for(int year = l ; year <= r ; year++){
      bool find = false;
      for(int i = 0 ; i < n && find == false ; i++){
	if(year % A[i] == 0){
	  // cout << "rules for " << A[i] << endl;
	  find = true;
	  if(i % 2 == 0){cnt++;}
	}
      }
      if(find == false){
	if(n % 2 == 0){cnt++;} 
      }
    }
    cout << cnt << endl;
  }
}