結果

問題 No.3483 A Forbidden Fruit
コンテスト
ユーザー nouka28
提出日時 2026-03-27 21:40:19
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 1,056 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 6,886 ms
コンパイル使用メモリ 374,344 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2026-03-27 21:40:35
合計ジャッジ時間 6,936 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 2 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
using namespace std;

#include<atcoder/all>
using namespace atcoder;
using mint=atcoder::modint998244353;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define rng(i,l,r) for(int i=(l);i<(r);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrng(i,l,r) for(int i=(r)-1;i>=(l);i--)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second

struct fast_io{fast_io(){cin.tie(nullptr)->sync_with_stdio(false);}}_;
template<class T> bool chmax(T &a,T b){return (a<b)?a=b,1:0;}
template<class T> bool chmin(T &a,T b){return (a>b)?a=b,1:0;}

template<class T>using pqmin=priority_queue<T,vector<T>,greater<T>>;

void solve();

signed main(){
	int T;cin>>T;
	cout<<fixed<<setprecision(15);
	while(T--){
		solve();
	}
}

void solve(){
	int N,M,K;cin>>N>>M>>K;

	if(K<=(N-1)*M){
		double ans=double((K+M-1)/M)/double(N*M);
		cout<<double(1-ans)<<endl;
	}else{
		double ans=double(N-2)/double(N*M);
		ans+=double(1)/double(N)*double(K%M)/double(M);
		cout<<double(1-ans)<<endl;
	}
}
0