AlgoLensArena
ContestlərProblemlərOtaqlar
Vizualizator
← Məsələlər

DAPC20-039.\problemyamlname

Medium · 1 s · 256 MB

  • icpc
  • dapc
  • 2020

By accident, two rooms (room 0\texttt{0}0 and room 1\texttt{1}1) got booked for the theoretical exam of the B++ Applied Programming Course and both were communicated to the students. Now students might go to either of the rooms, and as a student assistant your job is to supervise room 1\texttt{1}1. Since you assisted all these students during the course, you know how much time each student will need to finish the exam. Already before the exam you are eager to go home, but you can only leave when all of the students in your examination room have finished. You assume that every student chooses one of the exam rooms with equal probability, independent of the other students. After how much time do you expect to be able to leave?

Giriş formatı

The input consists of:

• A line with an integer nnn (1≤n≤401 \leq n \leq 401≤n≤40), the number of students.

• A line with nnn integers t1,…,tnt_1, \ldots, t_nt1​,…,tn​ (1≤ti≤10001 \leq t_i \leq 10001≤ti​≤1000): tit_iti​ is the time it takes for the iiith student to finish the exam and leave.

Çıxış formatı

Output the expected time before you can leave. Your answer should have an absolute or relative error of at most 10−610^{-6}10−6.

Qeyd

Source: Delft Algorithm Programming Contest 2020 · Author: Pim Spelier · License: CC BY-SA 4.0 · Original: https://dapc.wisv.ch · Statement adapted for AlgoLens and shared under the same license.

Nümunələr

Giriş #1

2
2 3

Çıxış #1

2

Giriş #2

5
1 4 5 2 3

Çıxış #2

4.03125

Giriş #3

5
2 1 1 1 1

Çıxış #3

1.46875