jiahuimbzuai/CoQuIR huggingface dataset:
//  [java]
import java.util.*;
class Main
{
    public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        if(a%2 == 0){
            a /= 2;
            a *= a;
        }
        else{
            a /= 2;
            a *= (a+1);
        }
        System.out.println(a);
    }
}
//  [cpp]
 #include <bits/stdc++.h>
 #include <math.h>
 using namespace std;
 
 int main(){
    int K;
    int a, b;
 
    cin >> K;
    a = K/2;
    b = K%2;
    cout << a*(a+b) << endl;
 }
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
	int input,odd=1,even=1;
	cin>>input;
	if (input%2==0)
	{
		even=input/2;
		odd=input-even;
	}
	else
		{
			odd=input/2 +1;
			even=input-odd;
		}
	cout<<odd*even;
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
 
  int k;
  cin>>k;
  int ans=(k/2)*((k+1)/2);
  cout(ans);
  return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

typedef long long ll;
typedef int keytype;

int gcd(int a, int b){ return (a % b) ? gcd(b, a % b) : b;}
int lcm(int a, int b){ return (a / gcd(a, b)) * b;}

void quicksort(keytype a[], int first, int last)
{
    int i, j;
    keytype x, t;

    x = a[(first + last) / 2];
    i = first;  j = last;
    for ( ; ; ) {
        while (a[i] < x) i++;
        while (x < a[j]) j--;
        if (i >= j) break;
        t = a[i];  a[i] = a[j];  a[j] = t;
        i++;  j--;
    }
    if (first  < i - 1) quicksort(a, first , i - 1);
    if (j + 1 < last) quicksort(a, j + 1, last);
}

int is_prime(int x){
    if(x <= 1) return 0;
    for(int i = 2; i * i <= x; i++){
        if(x % i == 0) return 0;
    }
    return 1;
}

int is_substr(char s[], char t[], int i){
    int flag = 1;

    if(s[i] == '\0') flag = 0;

    for(int j = 0; j < strlen(t); ++j, ++i){
        if(s[i] != t[j]){
            flag = 0;
            break;
        }
    }
    return flag;
}

// factor list, number of factors, natural number
void factorize(int ftr[], int *num, int n){
    int a = 2, cnt = 0;

    while(n >= a){
        if(n % a == 0){
            n = n / a;
            ftr[cnt++] = a;
        }else{
            a++;
        }
    }
    *num = cnt;
}

void comb(int size1, int size2, int v[size1][size2]){
  for(int i = 0; i < size1; i++){
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for(int k = 1; k < size1; k++){
    for(int j = 1; j < k; j++){
      v[k][j] = (v[k-1][j-1] + v[k-1][j]);
    }
  }
}

int abs_val(int a, int b){
    if(a > b) return a - b;
    else return b - a;
}

int main(){
    int k;
    scanf("%d", &k);

    int cnt = 0;
    for(int i = 1; i <= k - 1; ++i){
        for(int j = i + 1; j <= k; ++j){
            if(((i + j) % 2 == 1)) cnt++;
        }
    }

    printf("%d\n", cnt);

    return 0;
}
//  [c]
#include<stdio.h>
int main(void)
{
  int k;
  scanf("%d",&k);
  int even=0,odd=0;
  for(int i=1;i<=k;i++){
    if(i%2==0){
      even++;
    }else{
      odd++;
    }
  }

  printf("%d\n",even*odd);
  return 0;
}
//  [c]
#include<stdio.h>

int main(void){
  int a;
  scanf("%d",&a);
  printf("%d\n",(a/2)*((a+1)/2));
  return 0;
}
//  [javascript]
function main(input){
	var I = parseInt(input, 10);
	if(I % 2 === 0){
		var a = I / 2;
      	var Ans = a*a;
    }else{
		var a = Math.floor(I / 2);
      	var A = a+1;
      	var Ans = a * A;
    }
  	console.log(Ans);
}
 
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
// parameter "input" gets all data
function Main(input) {
	// the first line is assigned to input[0], the second line is assigned to input[1] similarly.
	var n = parseInt(input);
	if(n%2==1)
		console.log(parseInt((n-1)*(n+1)/4));
	else
		console.log(parseInt((n*n)/4));
}
// Don't edit this line!
//Main(require("fs").readFileSync(__dirname+'/in.txt', "utf8"));
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
'use strict';

const main = (input) => {
    const K = parseInt(input, 10);
    // K=2..100
    const oddCount = Math.floor(K / 2);
    const evenCount = Math.floor((K + 1) / 2);
    const result = oddCount * evenCount;
    console.log(result);
};

const isTest = false;

if (isTest) {
    main('3');
    main('6');
    main('11');
    main('50');
} else {
    main(require('fs').readFileSync('/dev/stdin', 'utf8'));
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var k int
	fmt.Scan(&k)

	oddCount := 0
	evenCount := 0

	for i := 1; i <= k; i++ {
		if i%2 == 0 {
			evenCount++
		} else {
			oddCount++
		}
	}
	fmt.Println(oddCount * evenCount)
}
//  [go]
package main

import "fmt"

func main() {
	var k int
	fmt.Scanf("%d", &k)
	gu := k / 2
	ki := 0
	if k%2 == 0 {
		ki = gu
	} else {
		ki = gu + 1
	}
	fmt.Println(ki * gu)

}
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {
	var k float64
	fmt.Scan(&k)
	a := math.Ceil(k / 2)
	b := math.Floor(k / 2)
	fmt.Println(a * b)
}
//  [ruby]
k = gets.chomp.to_i
gousuu = k / 2
kisuu = k - gousuu
puts gousuu * kisuu
//  [ruby]
k = gets.to_i
if k%2==0
  puts k**2/4
else
  puts (k**2-1)/4
end
//  [ruby]
K = gets.to_i

puts (1..K).count(&:even?) * (1..K).count(&:odd?)
//  [rust]
use std::io;
use std::str::FromStr;

fn input<T:FromStr>() -> T {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().parse().ok().unwrap()
}

fn main() {
    let n: u64 = input();
    println!("{}", (n / 2) * ((n + 1) / 2));
}
//  [rust]
#![allow(unused_imports)]

use proconio::{input, fastout};
use proconio::marker::*;

fn main() {
    input! {
    k: usize
    }
    let ans = (k / 2) * ((k + 1) / 2);
    println!("{}", ans);
}
//  [rust]
#![allow(non_snake_case)]
#![allow(unused_imports)]
use proconio::input;
use std::cmp::max;
use std::cmp::min;
use std::collections::HashMap;
use std::collections::VecDeque;

fn main() {
    input! {
        K: i64,
    }

    let ans = if K % 2 == 0 {
        (K / 2) * (K / 2)
    } else {
        (K - 1) / 2 * (K + 1) / 2
    };
    println!("{}", ans);
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const K = Number(input[0][0]);

  return K % 2 === 0 ? (K / 2) ** 2 : ((K - 1) / 2) ** 2 + (K - 1) / 2;
};

console.log(main(read()));
//  [typescript]
'use strict';

const receive = () => require('fs').readFileSync('/dev/stdin', 'utf8').split(/\s/);

const main = input => {
  const K = Number(input[0]);
  const ans = K % 2 == 0 ? (K / 2) ** 2 : (K - 1) / 2 * ((K - 1) / 2 + 1)
  console.log(ans);
};

main(receive());
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const _k = stdin.split('\n')[0]
const k = Number(_k)

const arr = []
for(let i = 1; i < k; i++){
  arr.push(i)
}

arr.push(k)

let res = 0
arr.forEach((e, i) => {
  if(e % 2 === 0){
    const sliced = arr.slice(i+1)
    res += sliced.filter(e => e%2 !== 0).length
  } else {
    const sliced = arr.slice(i+1)
    res += sliced.filter(e => e%2 === 0).length
  }
})

console.log(res)
//  [python]
import sys
input = lambda: sys.stdin.readline().rstrip() 

def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    print(1/sum([1/i for i in A]))

if __name__ == '__main__':
    resolve()
//  [python]
n=int(input())
a=map(int,input().split())
print("{:.16g}".format(1/sum(1/x for x in a)))
//  [python]
num=int(input())
array = list(map(int, input().strip().split()))

wa=0
for i in range(num):
    wa=wa+(1/array[i])
print(1/wa)
//  [python]
import numpy as np

N = int(input())
A_array = np.array([int(x) for x in input().split()])

a_array = np.sum(1/A_array)
print(1/a_array)
//  [python]
import numpy as np
n=int(input())
a=np.sum(1/np.array([int(i) for i in input().split(" ")]))
print(1/a)
//  [python]
import numpy as np
import math
import sys
sys.setrecursionlimit(10000000)

def main():
    N = int(input())
    A = [int(c) for c in input().split()]
    num = 0
    for i in range(N):
        num += 1 / A[i]
    print(1/num)


if __name__ == '__main__':
    main()
//  [java]
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        double sum = 0.0d;
        for(int i=0; i<n; i++){
            int tmp = sc.nextInt();
            sum += 1.d / (double)tmp;
        }
        System.out.println(1.d / sum);
    }



    private static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;

        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }

        private int readByte() {
            if (hasNextByte())
                return buffer[ptr++];
            else
                return -1;
        }

        private static boolean isPrintableChar(int c) {
            return 33 <= c && c <= 126;
        }

        public boolean hasNext() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr]))
                ptr++;
            return hasNextByte();
        }

        public String next() {
            if (!hasNext())
                throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        public long nextLong() {
            if (!hasNext())
                throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while (true) {
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if (b == -1 || !isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }

        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
                throw new NumberFormatException();
            return (int) nl;
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

}
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {

		FastScanner sc = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int N=sc.nextInt();
		int[] As=sc.nextIntsN(N);
		double[] Bs=new double[N];
		double total=0.0;
		for(int i=0;i<As.length;i++) {
			Bs[i]=1.0/As[i];
			total+=Bs[i];
		}
		out.println(1.0/total);
		out.flush();
	}

}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntsN(int N) {
		int[] ints = new int[N];
		for (int i = 0; i < N; i++) {
			ints[i] = nextInt();
		}
		return ints;
	}
	
	public long[] nextLongsN(int N) {
		long[] longs = new long[N];
		for (int i = 0; i < N; i++) {
			longs[i] = nextLong();
		}
		return longs;
	}
	
	public char[] nextCharsN(int N) {
		char[] chars = new char[N];
		String msg=next();
		for (int i = 0; i < N; i++) {
			chars[i] = msg.charAt(i);
		}
		return chars;
	}

	public char[][] nextCharsHW(int H, int W) {
		char[][] chars = new char[H][W];
		for (int i = 0; i < H; i++) {
			String str = next();
			for (int j = 0; j < W; j++) {
				chars[i][j] = str.charAt(j);
			}
		}
		return chars;
	}

	public int[][] nextIntsNM(int N, int M) {
		int[][] ints = new int[N][M];
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < M; j++) {
				ints[i][j] = nextInt();
			}
		}
		return ints;
	}
}
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {
		long n = sc.nextLong();
		double[] ia = new double[(int) n];
		double sum = 0.0d;
		for (int i = 0; i < n; i++) {
			sum += (double) 1 / (double) sc.nextLong();
		}

		pw.println((1 / sum));
		pw.flush();
	}

	static final FastScanner sc = new FastScanner();
	static final PrintWriter pw = new PrintWriter(System.out);

	static class FastScanner {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;

		private boolean hasNextByte() {
			if (ptr < buflen) {
				return true;
			} else {
				ptr = 0;
				try {
					buflen = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (buflen <= 0) {
					return false;
				}
			}
			return true;
		}

		private int readByte() {
			if (hasNextByte())
				return buffer[ptr++];
			else
				return -1;
		}

		static boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}

		private void skipUnprintable() {
			while (hasNextByte() && !isPrintableChar(buffer[ptr]))
				ptr++;
		}

		public boolean hasNext() {
			skipUnprintable();
			return hasNextByte();
		}

		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (b < '0' || '9' < b) {
				throw new NumberFormatException();
			}
			while (true) {
				if ('0' <= b && b <= '9') {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) {
					return minus ? -n : n;
				} else {
					throw new NumberFormatException();
				}
				b = readByte();
			}
		}
	}
}
//  [java]
import java.util.*;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.stream.Stream;

public class Main {
	public static void main(String[] args)throws IOException{
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] intarray = new int[N];
        BigInteger[] bigIntArr = new BigInteger[N];
        for(int i = 0; i < N; i++){
            int a = sc.nextInt();
            intarray[i] = a;
            bigIntArr[i] = BigInteger.valueOf(a);
        }
        /*BigInteger[] bigIntArr = {
            BigInteger.valueOf(2),
            BigInteger.valueOf(12),
            BigInteger.valueOf(36),
            BigInteger.valueOf(18)
        };*/
        //System.out.println("最大公約数： " + gcd(bigIntArr));
        // 最小公倍数
        //System.out.println("最小公倍数： " + lcm(bigIntArr));
        int bunbo = 0;
        int sum = 0;
        for(int i = 0; i < N; i++){
            BigInteger kari = lcm(bigIntArr);
            sum+= kari.intValue()/intarray[i];
        }
        //System.out.println(sum);
        BigDecimal lcm2 = new BigDecimal(lcm(bigIntArr).intValue());
        BigDecimal sum2 = new BigDecimal(sum);
        BigDecimal result1 = lcm2.divide(sum2,7, BigDecimal.ROUND_HALF_UP);
        System.out.println(result1);
      }
     
      // 最小公倍数（対象のすべての整数）
      public static BigInteger lcm(BigInteger... arr) {
        return Stream.of(arr).reduce((x, y) -> createLcm(x, y)).orElse(BigInteger.ONE);
      }
    
        //最小公倍数（指定した2つの整数）
        public static BigInteger createLcm(BigInteger x, BigInteger y) {
            return x.multiply(y)
                .divide(Objects.nonNull(creategcd(x, y)) ? creategcd(x, y) : BigInteger.ONE);
          }
         
          // 最大公約数（指定した2つの整数）
          public static BigInteger creategcd(BigInteger x, BigInteger y) {
            return (Objects.nonNull(x) ? x : BigInteger.ONE).gcd(y);
        }
      // 最大公約数（対象のすべての整数）
      public static BigInteger gcd(BigInteger[] arr) {
        return Stream.of(arr)
            .reduce(BigInteger::gcd)
            .orElse(BigInteger.ZERO);
        }
}
//  [java]
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
	public static void main(String[] args) {
		try (Scanner scn = new Scanner(System.in)) {
			final int N = scn.nextInt();
			//final int[] A = IntStream.generate(scn::nextInt).limit(N).toArray();

			System.out.println(1 /
					IntStream.generate(scn::nextInt).limit(N)
							.mapToDouble(d -> 1.0 / d)
							.reduce((a, b) -> a + b)
							.getAsDouble());
		}
	}
}
//  [java]
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		List<Double> list = new ArrayList<Double>();
		for (int i = 0; i < N; i++) {
			list.add(sc.nextDouble());
		}

		double ans = list.stream().mapToDouble(s -> 1.0 / s).sum();

		ans = 1.0 / ans;
		
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	}

}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	float a[1005],b[1005];
	cin >> n;
	for(int i = 0;i < n;i++){
		cin >> a[i];
	}
	float sum = 0.0;
	for(int i = 0;i < n;i++){
		b[i] = 1/a[i];
	}
	float s = 0.0;
	for(int i = 0;i < n;i++){
		s = s + b[i];
	}
	cout << 1/s << endl;
}
//  [cpp]
#include <bits/stdc++.h>
#include <cstring>

using namespace std;

int main(){
    int a;
    cin >> a;
    float n[a];
    for (int i = 0; i < a; i++)
        cin >> n[i];
    float sum = 0;
    for (int i = 0; i < a; i++)
        sum += (1 / n[i]);
    float re = (1 / sum);
    cout << re << endl;
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<double> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  double S = 0;
  for (int i = 0; i < N; i++) {
    S += 1 / A.at(i);
  }
  cout << 1 / S << endl;
}
//  [cpp]
#include <cassert>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <numeric>
#include <string>
#include <map>
#include <set>
#include <tuple>

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);

  size_t N;
  std::cin >> N;
  assert(N <= 100);

  std::vector<double> A(N);
  for (auto& ai: A) std::cin >> ai;

  double res = 0;
  for (auto ai: A) res += 1.0 / ai;
  res = 1.0 / res;

  std::cout << std::fixed << std::setprecision(65200000) << res << std::endl;
}
//  [cpp]
#include <cassert>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <numeric>
#include <string>
#include <map>
#include <set>
#include <tuple>

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);

  size_t N;
  std::cin >> N;
  assert(N <= 100);

  std::vector<double> A(N);
  for (auto& ai: A) std::cin >> ai;

  double res = 0;
  for (auto ai: A) res += 1.0 / ai;
  res = 1.0 / res;

  std::cout << std::fixed << std::setprecision(60000000) << res << std::endl;
}
//  [cpp]
#include <cassert>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <numeric>
#include <string>
#include <map>
#include <set>
#include <tuple>

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);

  size_t N;
  std::cin >> N;
  assert(N <= 100);

  std::vector<double> A(N);
  for (auto& ai: A) std::cin >> ai;

  double res = 0;
  for (auto ai: A) res += 1.0 / ai;
  res = 1.0 / res;

  std::cout << std::fixed << std::setprecision(40000000) << res << std::endl;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

#define REP(i,n) for(i=0;i<n;i++)
#define ll long long
#define PI M_PI

int main(void){
    int i;
    int N; scanf("%d",&N);
    int A[N];
    REP(i,N) scanf("%d",&A[i]);

    i=0;
    double ans = 0;
    while(i<N){
        ans += (double)1/A[i];
        i++;
    }

    printf("%f",1/ans);
    
    
    return 0;
}
//  [c]
#include<stdio.h>
int main (void) {
  
  int N,A[100];
  double B[100];
  
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &A[i]);
  }
  
  double a = 0.0;
  for (int i = 0; i < N; i++) {
    B[i] = 1 / (double)A[i];
    a += B[i];
  }
  
  double b = 1 / a;
  
  printf("%f", b);
  
  return 0;
}
//  [c]
#include<string.h>
#include<stdlib.h>
#include<time.h>
#include<math.h>
#include<stdio.h>
int main(void){
    int n,i;
    scanf("%d",&n);
    double a[n],b[n],c=0,d;
    for(i=0;i<n;i++){
        scanf("%lf",&a[i]);
        b[i]=1/a[i];
    }
    for(i=0;i<n;i++){
        c+=b[i];
    }
    d=1/c;
    printf("%f\n",d);
    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>


int main(void){
	int n;
	scanf("%d", &n);
	int in;
	double ans = 0;
	for(int i = 0; i < n; i++){
		scanf("%d", &in);
		ans += 1.0 / in;
	}
	printf("%lf\n", 1.0 / ans);
	return 0;
}
//  [c]
#include<stdio.h>
int main()
{
	int n,a[100];
	double x=0;
	int i;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		x+=(double)1/a[i];
	}
	printf("%lf\n",1/x);
	return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

double Re(double a)
{ return 1/a;}

int main()
{
  int n,i;
  double sum=0,*a;

  scanf("%d",&n );
  a = calloc(n,sizeof(double));

  for(i=0; i<n; i++)
  {
    scanf("%lf",&a[i]);
    sum += Re(a[i]);
  }

  printf("%lf", Re(sum));

  free(a);
  return 0;
}
//  [javascript]
function main(input) {
    var n = input.split(/\n/)[0] / 1;
    var a = input.split(/\n/)[1];
    var as = a.split(/\s/);
    for (var i = 0; i <= n - 1; i++) {
        as[i] /= 1;
    }
    var result = 0;
    for (var j = 0; j <= n - 1; j++) {
        result += 1 / as[j];
    }
    result = 1 / result;
    console.log(result);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
const Main = (input) => {
  const dataArray = input.split("\n");
  const count = dataArray[0];
  const numberArray = dataArray[1].split(' ');
  var sumNumber = 0;
  for (var i = 0; i < numberArray.length; i ++){
  	sumNumber += (1 / numberArray[i]);
  }
  var answer = 1/sumNumber;
  
  console.log(answer);
  
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function bai(x,y) {
	var x1 = x, y1 = y;
	var temp;
	while (y1 != 0) {
		temp = y1;
		y1 = x1 % y1;
		x1 = temp;
	}
	return x*y/x1;
}
 
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	var count = input[0]-0;
	var values = input[1].split(" ");
	var numerator = 1;
	var denominator = values[0]-0;
	for(var i = 1; i < count; i++) {
		var newDenominator = bai(denominator, values[i]-0);
		numerator *= newDenominator/denominator;
		numerator += newDenominator/values[i]-0;
        denominator = newDenominator;
	}
	
	console.log(denominator/numerator);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
const main = (input) => {
  var a = input[0]-0;
  var ans = 0;
  var b = input[1].split(" ").forEach(v=>{
    ans += 1/v;
  });
  console.log(1/ans);
}

main(require('fs').readFileSync('/dev/stdin', 'UTF-8').trim().split("\n"));
//  [javascript]
function Main(input) {
	var list = input.split("\n")[1].split(" ");
   var output = 0;
  for(var i = 0; i < list.length; i++){
    output += 1 / parseInt(list[i]);
  }
  console.log(1 / output);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
  var n = o.a();
  var a = o.l();
  var ans = 0;
  for(var i = 0; i < n; i++){
    ans += 1/a[i];
  }
  return 1/ans;
}
//  [go]
package main

import "fmt"

func main() {
	var N int
	fmt.Scanf("%d", &N)
	A := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scanf("%d", &A[i])
	}
	bunsi := 1.0
	for _, a := range A {
		bunsi *= float64(a)
	}
	B := make([]float64, N)
	for i := 0; i < N; i++ {
		B[i] = 1
	}
	for i := 0; i < N; i++ {
		for j := 0; j < N; j++ {
			if i == j {
				continue
			}
			B[j] *= float64(A[i])
		}
	}
	bunbo := 0.0
	for i := 0; i < N; i++ {
		bunbo += B[i]
	}
	fmt.Println(bunsi / bunbo)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	num, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return num
}

func nextString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)

	n := nextInt()
	var total float64
	for i := 0; i < n; i++ {
		a := nextInt()
		total += 1 / float64(a)
	}

	ans := 1 / total
	fmt.Printf("%.6f\n", ans)
}
//  [go]
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	var sum float64
	for i := 0; i < n; i++ {
		var a float64
		fmt.Scan(&a)
		sum += 1/a
	}
	fmt.Println(1/sum)

}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	N := getStdinInt()
	A := getStdinIntArr()

	var ans float64 = 0
	for i := 0; i < N; i++ {
		ans += 1.0 / (float64)(A[i])
	}

	fmt.Printf("%f\n", 1.0/ans)
}

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)

func getStdin() string {
	return readLine()
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinInt2() (int, int) {
	list := getStdinIntArr()
	return list[0], list[1]
}
func getStdinInt3() (int, int, int) {
	list := getStdinIntArr()
	return list[0], list[1], list[2]
}
func getStdinInt64() int64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return rtn
}
func getStdinIntU64() uint64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return uint64(rtn)
}
func getStdinInt64_2() (int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1]
}
func getStdinInt64_3() (int64, int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1], list[2]
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}
func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}
func getStdinIntArrU64() []uint64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]uint64, len(list))
	for idx, val := range list {
		r, _ := strconv.ParseInt(val, 10, 64)
		rtn[idx] = uint64(r)
	}
	return rtn
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}
func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}
func abs64(n int64) int64 {
	if n < 0 {
		return -n
	}
	return n
}
func readLine() string {
	buf := make([]byte, 0, 0)
	for {
		l, p, _ := sc.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
//  [go]
package main

import (
	"fmt"
)

func main() {

	var N int
	fmt.Scanf("%d", &N)

	var A int
	var sum float64 = 0
	for i := 0; i < N; i++ {
		fmt.Scanf("%d", &A)
		sum += 1.0 / float64(A)
	}

	fmt.Println(1.0 / sum)
}
//  [ruby]
_ = gets
p 1.0/gets.split.map{|n| 1.0/n.to_i}.inject(:+)
//  [ruby]
n = gets.to_i
as = gets.split.map(&:to_f)

m = 0.0
as.each do |a|
  m += 1/a
end

puts 1.0/m
//  [ruby]
n = gets.to_i
as = gets.split.map(&:to_i)

total = 0
as.each do |a|
  total += (1.0 / a)
end

puts 1.0 / total
//  [ruby]
n,*a=`dd`.split.map &:to_f
p 1./a.inject(0){|a,b|a+1/b}
//  [ruby]
n = gets.to_i
puts 1/( gets.chomp.split(' ').map(&:to_f).map{|num| 1/num}.sum)
//  [ruby]
n = gets.chomp.to_i
arr = gets.chomp.split.map(&:to_i)
ngo = 0
arr.each do |a|
	ngo += 1.0 / a
end
puts 1 / ngo
//  [rust]
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n = read::<usize>();
    let mut sum: f64 = 0.0;
    for _i in 0..n {
        let a = read::<f64>();
        sum += 1.0 / a;
    }
    println!("{:.8}", 1.0 / sum);
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

use std::iter::Iterator;


fn main() {
    input!{
        n:i32,
        a:[f64;n],
    }

    let mut bunnbo:f64 = 0.0;

   for item in a {
    bunnbo = bunnbo + (1_f64/item);
   }

   println!("{}", 1_f64/bunnbo);
}
//  [rust]
fn main() {
    let n = read::<usize>();
    let a = read_vec::<f64>();

    let mut ret = 0.0;
    for i in 0..n {
        ret += 1.0 / a[i];
    }

    println!("{}", 1.0 / ret);
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}
//  [rust]
use proconio::{fastout, input};
#[allow(unused_mut)]
#[fastout]
fn main() {
    input! {
        n: usize,
        a: [f64; n]
    }
    let rev_sum: f64 = a.iter().map(|s| 1. / s).sum();
    let res = 1. / rev_sum;
    println!("{:.12}", res);
}
//  [rust]
use proconio::input;
use proconio::marker::Chars;
fn main() {
    input!{
        n:usize,
        a:[f64; n]
    };
    println!("{}",
        1f64 / a.iter().fold(0f64, |acc,x| acc+(1f64 / x)));
}
//  [swift]
let n=Int(readLine()!)!
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
let aa=readInts()
var ans0=0.0
for a in aa{
  ans0+=1/Double(a)
}
print(1/ans0)
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let n:Int=Int(readLine()!)!
let num=readInts()
var sum:Double=0

for i in 0..<n{sum+=1.0/Double(num[i])}

print(1/sum)
//  [swift]
import Foundation

let n = Int(readLine()!)!
let array = readLine()!.characters.split{$0 == " "}.map{ Double(String($0))! }

let result = 1.0 / array.reduce(0.0) { $0 + 1.0/$1 }

print(result)
//  [swift]
struct Fraction {
    var numerator: Int      // 分子
    var denominator: Int    // 分母
    // 分数形式の文字列で返す
    var asString: String {
        let hcf = findHCF()
        let str = "\(abs(numerator) / hcf) / \(abs(denominator) / hcf)"
        return numerator * denominator < 0 ? "- " + str : str
    }
    // 最大公約数を求める
    func findHCF() -> Int {
        for var i=max(numerator, denominator); i>=1; i-- {
            if numerator % i == 0 && denominator % i == 0 {
                return i
            }
        }
        return 1
    }
}

/* 分数の足し算　*/
func + (left: Fraction, right: Fraction) -> Fraction {
    let numerator = left.numerator * right.denominator + right.numerator * left.denominator
    let denomitor = left.denominator * right.denominator
    return Fraction(numerator: numerator, denominator: denomitor)
}


let n=Int(readLine()!)!
let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

var d : Double = 0
var i = 0
d = Double(1) / Double(arr[i] )
//print(f.asString)  
for i in 1..<n {
  d = d + Double(1) / Double(arr[i] )
	//f = f + Fraction(numerator: 1, denominator: arr[i])
  	//print( f.findHCF() )
	//print(f.asString)     // -> 2 / 5
}

print( Double(1) / d )
//  [typescript]
import * as fs from 'fs'

function solve() {
  const input = (require('fs').readFileSync('/dev/stdin', 'utf8') as string).split('\n');
  const N = +input[0]
  const A = input[1].split(' ').map((x: string):number => +x);
  let ans = 0;
  for (let a of A) {
    ans += 1 / a;
  }
  console.log(1 / ans)
}

solve();
//  [typescript]
const main = (lines: string) => {
  const data = lines.split("\n");
  const columns = data[1].split(" ").map(str => parseInt(str, 10));
  const maxValue = Math.max.apply(null, columns);
  let results = 0;

  columns.forEach(column => {
    let n = maxValue / column;
    results += maxValue / column;
  });

  console.log(maxValue / results);
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
'use strict'
function main(input: string) {
    const n: number = Number(input.split('\n')[0]);
    const a: number[] = input.split('\n')[1].split(' ').map(Number);
    const r = a.reduce((acc, current) => {
        return acc += 1 / current;
    }, 0)
    console.log(1 / r);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
// general helpers
const debug = (message?: any, ...optionalParams: any[]) => {
  if (process.env.LOCAL_DEBUG === '1') console.log(message, ...optionalParams)
}

// helpers
const parseLines = (
  lines: string[]
): { A: number[] } => {
  const A = lines[1].split(' ').map(line => +line)
  const obj = { A }
  debug(obj)
  return obj
}
// solver
export const solve = (lines: string[]): string => {
  const { A } = parseLines(lines)
  const sum = A.reduce((prev, current) => prev += 1 / current, 0)
  return `${1 / sum}`
}

// main
const main = (lines: string[]) => {
  console.log(solve(lines))
}

// exec main function for submit
if (process.env.LOCAL_DEBUG !== '1') {
  const { stdin: input, stdout: output } = process
  input.resume()
  input.setEncoding('utf8')
  const lines: string[] = []
  require('readline')
    .createInterface({ input, output })
    .on('line', (line: string) => lines.push(line))
    .on('close', () => main(lines))
}
//  [typescript]
import * as fs from 'fs'
const reader = (s: string) => s.split('\n')

function Main(input: string) {
  const N = parseInt(reader(input)[0], 10)
  const A = reader(input)[1]
    .split(' ')
    .map(x => parseInt(x, 10))

  if (N !== 1) {
    const mul = A.reduce((acc, cur) => acc * cur)
    let num = 0

    for (let i = 0; i < N; i++) {
      const tmp = A.filter((_, ind) => i !== ind)
      num += tmp.reduce((acc, cur) => acc * cur)
    }

    console.log(mul / num)
  } else {
    console.log(A[0])
  }
}

Main(fs.readFileSync('/dev/stdin', 'utf8'))
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc138 {
    /**
     * 2
     * 10 30
     */
    class ProgramB {
        main(inp: string) {
            const aList: number[] = inp.split('\n')[1].split(' ').map(x => parseInt(x));

            let denominator: number =
                aList.reduce((accum, current) => accum += 1 / current, 0);

            console.log(1 / denominator);
        }
    }

    const func = new ProgramB();
    func.main(fs.readFileSync('/dev/stdin', 'utf8').trim())
}
//  [python]
# -*- coding: utf-8 -*-

import numpy as np #1.11.0
#import matplotlib as plt #1.5.1
import copy 
import math

n = int(input())
a = int(input())

b = n % 500
if b <= a:
  print("Yes")
else:
  print("No")
//  [python]
import math
import numpy as np
from operator import mul

# 整数Nを桁ごとのリストにする
# l = [int(x) for x in list(str(N))]

# リストliから重複を削除したリストli_uniqを作成
#li_uniq = []
#for i in li:
#    if x not in li_uniq:
#        li_uniq.append(x)

# 複数行のinput - list版
#list = [list(map(int, input().split())) for i in range(N)]
# 複数行のinput - dictionary版
# key = a, value = b
#for i in range(N):
#    a, b = map(int, input().split())
#    dict[a] = b


N = int(input())
A = int(input())

a = N%500
if a <= A:
    print("Yes")
else:
    print("No")
//  [python]
n = int(input())
a = int(input())

if n % 500 <= a:
    print('Yes')
else:
    print('No')
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		final int A = sc.nextInt();
		final int C = 500;
		sc.close();
		
		int n = N%C; // 0 <= n <= 499
		if(A >= n) System.out.println("Yes");
		else System.out.println("No");
	}

}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class Main {
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			List<String> vals = br.lines().limit(2).collect(Collectors.toList());
			int n = Integer.valueOf(vals.get(0));
			int a = Integer.valueOf(vals.get(1));
			int zan = n % 500;
			if(zan <= a) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
	}


	private static List<String> splitBySpace(String target) {
		return Arrays.asList(target.split("\\s"));
	}

}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n  = sc.nextInt();
        int a = sc.nextInt();
        if(a >= n%500){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }   
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);	
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll ,ll> 			pll;
typedef pair<ld,ld> 			pld;
typedef unordered_map<ll,ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5+7;
const ll 	MAX7 	= 	1e+7+7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9+7;

vll adj[MAXN];ll visit[MAXN]={};
int dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1};
int dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};

// <------------- Declare Variables Here ------------> //

ll t=1;
ll n,x;
string s;

// <------------- Implement Functions Here ----------> //



// <------------- Start of main() -------------------> //

void MAIN() {
	cin >> n >> x;
	n%=500;
	if(x >= n) cout<<"Yes\n";
	else cout<<"No\n";	
}

int main() {
	fastio;randomINT;
	//cin>>t;
	while(t--) {
		MAIN();
	}
	return 0;
}
//  [cpp]
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl

using namespace std;

typedef long long int lli;

int main() {
    int N, A;
    cin >> N >> A;
    cout << ((N % 500) <= A ? "Yes" : "No") << endl;
    return 0;
}