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

20565번 - Painting Pips 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB126704948.515%

문제

Alice and Bob like playing games. Lately, they've been playing a game where Alice rolls $N$ dice and Bob pays her a dollar amount equal to the product of the numbers rolled on the $N$ dice; however, due to the lack of required skill, Alice and Bob have gotten bored.

To spice things up, they decide to use a custom set of dice. Specifically, Alice has $N$ blank 6ドル$-sided dice and she gets to paint pips on them. She has enough paint to paint $M$ pips. Subject to this constraint, she can paint the dice however she wants; for example, she may paint more than 6ドル$ pips on one side of a die. Note that she can choose to paint 0ドル$ pips on a side; if any of the rolled numbers is 0ドル,ドル the product is 0ドル$.

Assuming Alice paints the dice optimally, what is the expected value of her winnings in this game?

입력

The only line of input contains two space-separated integers, $N$ (1ドル \leq N \leq 20$) and $M$ (1ドル \leq M \leq 100$): the number of dice in the game and the maximum number of pips Alice may paint in total, respectively.

출력

Output a single real number, Alice's expected winnings. Your answer is considered correct if its absolute or relative error is at most 10ドル^{-6}$.

제한

예제 입력 1

2 2

예제 출력 1

0.027777777778

예제 입력 2

1 6

예제 출력 2

1.000000000000

예제 입력 3

2 3

예제 출력 3

0.055555555556

예제 입력 4

2 1

예제 출력 4

0.000000000000

힌트

In the first sample case, the best Alice can do is to put one pip on each die. This gives her an expected value of 1ドル/36$.

In the second sample case, one optimal strategy for Alice is to put a pip on each side of the die. No matter what she rolls, she receives a payout of 1ドル$.

In the final sample case, Alice can only paint 1ドル$ pip, so no matter what she does, she will always receive a payout of 0ドル$.

출처

University > UT Invitational Programming Contest > UT Invitational Programming Contest 2019 A번

  • 문제를 만든 사람: Ethan Arnold
(追記) (追記ここまで)

출처

대학교 대회

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

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