#P13703. [NWERC 2023] Date Picker

[NWERC 2023] Date Picker

题目描述

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!

:::align{center} Afilled agenda. :::

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 77 rows (days), and 2424 columns (hours). Each cell in this matrix is either '.\texttt{.}' or 'x\texttt{x}', meaning that hour of that day you are either free or have a meeting, respectively.

You have to pick at least dd days in the first poll and hh 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?

输入格式

The input consists of:

  • 77 lines with 2424 characters, each character being either '.\texttt{.}' or 'x\texttt{x}', with '.\texttt{.}' indicating the time slots you are available.
  • One line with two integers dd and hh (1d71 \leq d \leq 7, 1h241 \leq h \leq 24), the minimum number of days and hours you have to fill in.

输出格式

Output the probability that you are available at the chosen meeting time. Your answer should have an absolute or relative error of at most 10610^{-6}.

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

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