結果

問題 No.1835 Generalized Monty Hall Problem
ユーザー 👑 tamatotamato
提出日時 2022-02-11 21:28:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 1,000 ms
コード長 309 bytes
コンパイル時間 562 ms
コンパイル使用メモリ 87,720 KB
実行使用メモリ 72,072 KB
最終ジャッジ日時 2023-09-10 00:50:15
合計ジャッジ時間 2,536 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,972 KB
testcase_01 AC 74 ms
71,988 KB
testcase_02 AC 75 ms
71,884 KB
testcase_03 AC 74 ms
72,072 KB
testcase_04 AC 74 ms
71,972 KB
testcase_05 AC 75 ms
71,560 KB
testcase_06 AC 73 ms
71,796 KB
testcase_07 AC 74 ms
71,776 KB
testcase_08 AC 74 ms
71,992 KB
testcase_09 AC 74 ms
71,924 KB
testcase_10 AC 75 ms
71,992 KB
testcase_11 AC 75 ms
71,784 KB
testcase_12 AC 74 ms
71,600 KB
testcase_13 AC 73 ms
71,732 KB
testcase_14 AC 74 ms
71,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    from math import gcd
    input = sys.stdin.readline

    N, M, K = map(int, input().split())

    upper = M * (N - 1)
    lower = N * (N - K - 1)
    g = gcd(upper, lower)
    print(upper // g, lower // g)


if __name__ == '__main__':
    main()
0