問題一覧 > 通常問題

No.1706 Many Bus Stops (hard)

レベル : / AI推定難易度 : 1700 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 83
作問者 : harurun / テスター : chineristAC
お気に入りにしたユーザー ProblemId : 6990 / 自分の提出
問題文最終更新日: 2021-10-09 00:47:13
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 317 (順位表) の他の問題:

Problem Statement

There are $C$ bus stops, which we call bus stop $1$, bus stop $2$, ...., bus stop $C$.

At time $0$, $M$ buses are stopped at bus stop $1$, and there are no buses anywhere other than bus stop $1$.

At each time $i=0,1,2,...,N-1$, every bus at each bus stop moves independently as follows.

  • If a bus is at bus stop $x$

    • For each bus stop other than bus stop $x$, it moves to that bus stop with probability $\frac{1}{C}$, taking time $1.5$

    • With probability $\frac{1}{C}$, it stays at bus stop $x$

Output the probability that at least one bus is at bus stop $1$ at time $N$, modulo $\mod 10^9+7$.


What it means to output a probability modulo $\mod 10^9+7$ (click to expand)

When the probability is expressed as an irreducible fraction $\frac{P}{Q}$, output the non-negative integer $R$ that satisfies $R\times Q=P (mod 10^9+7)$ and $0≤R<10^9+7$.

Input

$C\ N\ M$

The number of bus stops $C$, an integer $N$, and the number of buses $M$ are given, separated by spaces.

Constraints

  • $2≤C≤1\times10^5$

  • $1≤N≤1\times10^9$

  • $1≤M≤1\times10^9$

  • All inputs are integers

Sample

Sample 1
Input
3 3 1
Output
370370373

The probability in question is $\frac{1}{27}$. Output it modulo $\mod 10^9+7$.

Sample 2
Input
10 1 2
Output
830000006

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。