Logo
(追記) (追記ここまで)

30901번 - Date Picker 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB89776990.789%

문제

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 7ドル$ rows (days), and 24ドル$ 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 $d$ days in the first poll and $h$ 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:

  • 7ドル$ lines with 24ドル$ characters, each character being either '.' or 'x', with '.' indicating the time slots you are available.
  • One line with two integers $d$ and $h$ (1ドル \leq d \leq 7,ドル 1ドル \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 10ドル^{-6}$.

제한

예제 입력 1

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

예제 출력 1

0.8

예제 입력 2

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

예제 출력 2

0.958333333333333

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > NWERC 2023 D번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /