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

32808번 - Brownian Bears 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
4 초 2048 MB39212052.632%

문제

Dr. Ursula Major is an internationally renowned expert in the study of bears, specifically brown bears, which are known in many parts of North America as grizzly bears. She is most famous for her discovery of an extremely rare brown bear subspecies --- the Brownian bear, whose feeding behavior seems to be guided by an intriguing mixture of regularity and randomness.

At present, Dr. Major is studying a pair of Brownian bears living on a narrow strip of land that is oriented east-west. This territory has $n$ evenly spaced locations where the bears can forage for berries, and Dr. Major has labelled these locations 1,ドル 2, \ldots, n$ from west to east. Every morning, each Brownian bear wakes up in one of the $n$ locations and randomly chooses to move either east or west to the neighboring location. What is remarkable is that the probability of moving in either direction is exactly 50ドル\%!$ (Dr. Major's working theory is that this is rooted in some kind of quantum mechanical phenomenon in the bears' brains.) If a bear happens to start the day in one of the end locations (1ドル$ or $n$), then it will randomly choose between moving to the sole neighboring location or staying where it is. After making its choice, the bear spends the day foraging for berries in the chosen location, and then also sleeps there that night. The next morning, the process begins all over again.

Dr. Major is particularly interested in days when the two bears forage together, i.e., in the same location, so she plans to observe them over a period of time, possibly as long as a month (or until her funding runs out). At the beginning of the first observation day, the two bears wake up in different locations. Can you help Dr. Major determine the probability that the two bears will forage together for at least one day during the course of her experiment?

Note that the two bears can move past each other without foraging together. For example, if the bears start a particular day in locations 4ドル$ and 5ドル,ドル and if the bear in location 4ドル$ moves east and the bear in location 5ドル$ moves west, then the bears simply pass each other that morning without foraging together.

입력

The input consists of a single line containing four integers, $n$ $x$ $y$ $d,ドル where $n$ $(2 \leq n \leq 100)$ is the number of locations, $x$ and $y$ $(1 \leq x, y \leq n, x \neq y)$ are the locations where the two bears wake up at the beginning of the first observation day, and $d$ $(1 \leq d \leq 31)$ is the number of observation days.

출력

Output a line containing the probability that the two bears forage together for at least one day during the $d$ observation days. Express this probability as a fraction $a/b$ in lowest terms, where $a$ is a non-negative integer and $b$ is a positive integer. See the sample outputs for examples.

제한

예제 입력 1

4 1 2 2

예제 출력 1

3/8

예제 입력 2

6 2 5 2

예제 출력 2

0/1

예제 입력 3

2 1 2 1

예제 출력 3

1/2

힌트

출처

ICPC > Regionals > North America > East Central North America Regional > 2024 East Central NA Regional Contest D번

ICPC > Regionals > North America > Greater New York Region > 2024 Greater New York Regional Contest D번

ICPC > Regionals > North America > Northeast North America Regional > 2024 Northeast North America Regional Contest D번

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

출처

대학교 대회

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

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