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

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

Date Picker

면접 대비

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

요약
7행 24열의 가능 시간 표가 주어질 때, 최소 d개의 요일과 h개의 시간을 골라 선택한 요일과 시간 조합 중 가능한 칸의 비율이 최대가 되도록 한다.
난이도

보통10점 중 5점

유형
그리디, 정렬, 조합론, 완전 탐색
정답자
아직 제출이 없습니다

문제

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 77 rows (days), and 2424 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 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 '.' or 'x', with '.' indicating the time slots you are available.
  • One line with two integers dd and hh (1≤d≤71 \leq d \leq 7, 1≤h≤241 \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−610^{-6}.

예제2

  1. 예제 1

    입력
    xxxxxx..xx..xxxxxxxxxxxx
    xxxxxxxxxxxxx....xxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxx..xx..xxxxxxxxxxxx
    xxxxxxxxxxxxx...x..xxxxx
    xxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxx
    2 5
    
    예상 출력
    0.8
    
  2. 예제 2

    입력
    xxxxxxxxx.....x...xxxxxx
    xxxxxxxx..x...x...xxxxxx
    xxxxxxxx......x...x.xxxx
    xxxxxxxx...xxxxxxxxxxxxx
    xxxxxxxx...xxxxxxxxxxxxx
    xxxxxxxx...xxxxxxxx.xxxx
    ......xxxxxxxxxxxxxxxxxx
    3 8
    
    예상 출력
    0.958333333333333