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

NWERC23-080.Date Picker

Hard · 1 s · 256 MB

  • icpc
  • nwerc
  • 2023

The NWERC is coming up and your agenda is filling up with meetings. One of your teammates wants to plan a meeting, and asks for your input. However, instead of asking you for your exact agenda, you have to fill out two separate polls: one for indicating which days you are available, and one for the hours!

As a computer scientist, you plan your meetings only on whole hours and each meeting takes an integer number of hours. Therefore, your agenda can be modelled as a matrix of 777 rows (days), and 242424 columns (hours). Each cell in this matrix is either ‘.’ or ‘x’, meaning that hour of that day you are either free or have a meeting, respectively.

You have to pick at least ddd days in the first poll and hhh hours in the second poll, and we assume the meeting will take place on any of your picked hour/day combinations with equal probability. What is the probability that you can attend the meeting if you fill in the polls optimally?

Giriş formatı

The input consists of:

• 777 lines with 242424 characters, each character being either ‘.’ or ‘x’, with ‘.’ indicating the time slots you are available.

• One line with two integers ddd and hhh (1≤d≤71 \leq d \leq 71≤d≤7, 1≤h≤241 \leq h \leq 241≤h≤24), the minimum number of days and hours you have to fill in.

Çıxış formatı

Output the probability that you are available at the chosen meeting time.

Your answer should have an absolute or relative error of at most 10−610^{-6}10−6.

Qeyd

Source: Northwestern Europe Regional Contest (NWERC) 2023 · Author: Jeroen Bransen · License: CC BY-SA 4.0 · Original: https://2023.nwerc.eu · Statement adapted for AlgoLens and shared under the same license.

Nümunələr

Giriş #1

xxxxxx..xx..xxxxxxxxxxxx
xxxxxxxxxxxxx....xxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxx..xx..xxxxxxxxxxxx
xxxxxxxxxxxxx...x..xxxxx
xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxx
2 5

Çıxış #1

0.8

Giriş #2

xxxxxxxxx.....x...xxxxxx
xxxxxxxx..x...x...xxxxxx
xxxxxxxx......x...x.xxxx
xxxxxxxx...xxxxxxxxxxxxx
xxxxxxxx...xxxxxxxxxxxxx
xxxxxxxx...xxxxxxxx.xxxx
......xxxxxxxxxxxxxxxxxx
3 8

Çıxış #2

0.958333333333333