아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Uniform Chemistry

시간 제한1초메모리 제한1024 MB

요약
m명의 연구자가 매년 표본을 더 높은 원소로 균등하게 융합할 때, 각자가 원소 n에 가장 먼저 도달할 확률을 구한다.
난이도

보통10점 중 7점

유형
확률, 동적 계획법, 수학, 조합론
정답자
아직 제출이 없습니다

문제

In a parallel universe there are nn chemical elements, numbered from 11 to nn. The element number nn has not been discovered so far, and its discovery would be a pinnacle of research and would bring the person who does it eternal fame and the so-called SWERC prize.

There are mm independent researchers, numbered from 11 to mm, that are trying to discover it. Currently, the ii-th researcher has a sample of the element s_is\_i. Every year, each researcher independently does one fusion experiment. In a fusion experiment, if the researcher currently has a sample of element aa, they produce a sample of an element bb that is chosen uniformly at random between a+1a+ 1 and nn, and they lose the sample of element aa. The elements discovered by different researchers or in different years are completely independent.

The first researcher to discover element nn will get the SWERC prize. If several researchers discover the element in the same year, they all get the prize. For each i=1,2,…,mi = 1, 2, \dots , m, you need to compute the probability that the ii-th researcher wins the prize.

입력

The first line contains two integers nn and mm (2≤n≤1002 ≤ n ≤ 100, 1≤m≤101 ≤ m ≤ 10) — the number of elements and the number of researchers.

The second line contains mm integers s_1,s_2,…,s_ms\_1, s\_2, \dots , s\_m (1≤s_i<n1 ≤ s\_i < n) — the elements that the researchers currently have.

출력

Print mm floating-point numbers. The ii-th number should be the probability that the ii-th researcher wins the SWERC prize. Your answer is accepted if each number differs from the correct number by at most 10−810^{-8}.

예제4

  1. 예제 1

    입력
    2 3
    1 1 1
    
    예상 출력
    1.0 1.0 1.0
    
  2. 예제 2

    입력
    3 3
    1 1 2
    
    예상 출력
    0.5 0.5 1.0
    
  3. 예제 3

    입력
    3 3
    1 1 1
    
    예상 출력
    0.625 0.625 0.625
    
  4. 예제 4

    입력
    100 7
    1 2 4 8 16 32 64
    
    예상 출력
    0.178593469 0.179810455 0.182306771 0.187565366 0.199300430 0.229356322 0.348722518