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

26534번 - Goats 다국어

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

문제

The goats have an interesting dice game they like to play. Each goat brings their own six-sided die with specified values on the six faces. Each die is fair; that is, when it is thrown, each of its six faces is equally likely to come up on top.

The first player throws the first die and the second throws the second die. If the values shown on the top of the dice differ, the player with the higher value wins. If the values are the same, both players throw the dice again.

Given two dice with specific values, what is the probability that the first player wins?

입력

The first line of input contains six space-separated integers, representing the values written on the first player’s die. The second line of input contains the values on the second player’s die in the same format.

It is guaranteed that all the values are between 1 and 6, inclusive.

출력

Print, on a single line, a floating-point value representing the probability that the first player wins, rounded and displayed to exactly five decimal places. The value should be printed with one digit before the decimal point and five digits after the decimal point. The sixth digit after the decimal point of the exact answer will never be 4 or 5 (eliminating complex rounding considerations).

제한

예제 입력 1

1 2 3 4 5 6
1 2 3 4 5 6

예제 출력 1

0.50000

예제 입력 2

4 4 4 4 1 1
3 3 3 3 3 3

예제 출력 2

0.66667

힌트

출처

School > PLU High School Programming Contest > PLU 2017 > Novice 9번

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

출처

대학교 대회

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

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