結果

問題 No.1835 Generalized Monty Hall Problem
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2022-02-11 21:29:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 1,000 ms
コード長 425 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 86,880 KB
実行使用メモリ 71,704 KB
最終ジャッジ日時 2023-09-10 00:53:43
合計ジャッジ時間 2,271 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,320 KB
testcase_01 AC 74 ms
71,528 KB
testcase_02 AC 72 ms
71,564 KB
testcase_03 AC 71 ms
71,244 KB
testcase_04 AC 76 ms
71,704 KB
testcase_05 AC 75 ms
71,668 KB
testcase_06 AC 76 ms
71,376 KB
testcase_07 AC 75 ms
71,344 KB
testcase_08 AC 74 ms
71,348 KB
testcase_09 AC 75 ms
71,472 KB
testcase_10 AC 75 ms
71,568 KB
testcase_11 AC 75 ms
71,572 KB
testcase_12 AC 73 ms
71,536 KB
testcase_13 AC 74 ms
71,384 KB
testcase_14 AC 70 ms
71,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

https://yukicoder.me/problems/no/1835

元々 = M/N

正解の場合 M/N
○ M-1 個
× N-M 個

M-1 / (N-1-K)

不正解の場合 (N-M)/N
○ M個

M / (N-1-K)



"""
#a/b , c/d
def is_big(a,b,c,d):

    if a*d >= c*d:
        return a,b
    else:
        return c,d

import math
from sys import stdin
N,M,K = map(int,stdin.readline().split())

x,y = is_big(M,N,M*(N-1),N*(N-1-K))

g = math.gcd(x,y)
print (x//g,y//g)
0