結果

問題 No.1835 Generalized Monty Hall Problem
ユーザー chineristACchineristAC
提出日時 2022-02-11 21:27:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 117 ms / 1,000 ms
コード長 469 bytes
コンパイル時間 1,433 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 75,072 KB
最終ジャッジ日時 2023-09-10 00:49:17
合計ジャッジ時間 3,495 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
74,504 KB
testcase_01 AC 113 ms
74,584 KB
testcase_02 AC 112 ms
74,412 KB
testcase_03 AC 113 ms
74,592 KB
testcase_04 AC 112 ms
75,072 KB
testcase_05 AC 112 ms
74,892 KB
testcase_06 AC 113 ms
74,708 KB
testcase_07 AC 113 ms
74,504 KB
testcase_08 AC 112 ms
74,888 KB
testcase_09 AC 113 ms
74,792 KB
testcase_10 AC 114 ms
75,044 KB
testcase_11 AC 113 ms
74,800 KB
testcase_12 AC 114 ms
75,064 KB
testcase_13 AC 113 ms
74,724 KB
testcase_14 AC 117 ms
74,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations
from math import log,gcd

input = lambda :sys.stdin.readline()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

N,M,K = mi()

a = M/N
b = (M*(N-1))/(N-K-1)*N

if M*N*(N-K-1) < M*(N-1)*N:
    p,q = M*(N-1),(N-K-1)*N
    g = gcd(p,q)
    print(p//g,q//g)
else:
    p,q = M,N
    g = gcd(p,q)
    print(p//g,q//g)
0