criyle/codenet-compile-errors huggingface dataset:
Language: C++

/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pint;
const int MAX = 510000;
const int MOD = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define Rep(i, n) for(ll i = 1; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll fac[MAX], finv[MAX], inv[MAX];


template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }

}
ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b) {
  return b ? GCD(b,a%b) : a;
}


ll LCM(ll a,ll b){
  return a/GCD(a,b)*b;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

void runlength(string s,vector<pair<char,ll>> &p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
}




ll COM(ll n,ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

const int MAX_N=100010;
vector<bool> sieve_of_eratosthenes(){
  vector<bool> isPrime(MAX_N+1,true);
  for(int i=2;i<=MAX_N;i++){
    if(isPrime[i]){
      for(int j=2*i;j<=MAX_N;j+=i){
        isPrime[j]=false;
      }
    }
  }
  return isPrime;
}

vector<pint> prime_factorize(ll n){
  vector<pint> ans;
  for(ll p=2;p<=sqrt(n);p++){
    if(n%p!=0) continue;
    ll cnt=0;
    while(n%p==0){
      n/=p;
      cnt++;
    }
    ans.push_back(make_pair(p,cnt));
  }
  if(n!=1) ans.push_back(make_pair(n,1));
  return ans;
}

/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll n,m,d;
  cin>>n>>m>>d;
  if(d==0){
    cout<<setprecision(10)<<(m-1)*(double)1/n<<endl;
  }else {
    cout<<setpresicion(10)<<(m-1)*(double)2*(n-d)/(n*n)<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:145:11: error: 'setpresicion' was not declared in this scope
  145 |     cout<<setpresicion(10)<<(m-1)*(double)2*(n-d)/(n*n)<<endl;
      |           ^~~~~~~~~~~~
Language: C++

# coding: utf-8
# Your code here!
n,m,d=map(int,input().split())

if n>=2*d:
    expe=(n-2)*2+2*d if d!=0 else n
elif n>=d:
    expe=2*(n-d)
else:
    expe=0

print((expe/n**2)*(m-1))


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #Your
    2 | # Your code here!
      |   ^~~~
a.cc:3:1: error: 'n' does not name a type
    3 | n,m,d=map(int,input().split())
      | ^
Language: C++

import java.util.*;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        double n = sc.nextDouble();
        double m = sc.nextDouble();
        int d = sc.nextInt();
        sc.close();

        double sum = 0;
        sum += Math.max(0, n-2*d);
        sum += 2*d;
        System.out.println(sum/n/n*(m-1));
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main{
      | ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std
  int main(){
  double n,m,d;
  double ans=0;
  if(d==0){
    cout << setprecision(10) << (m-1)/n << endl;
  }
  else{
    cout << setprecision(10) << (m-1)/n*2*(n-d)/n << endl;
  }
}

Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 |   int main(){
      |   ~~~
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define rep(i,m) for(long long i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define all(x) (x).begin(),(x).end()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
using namespace std;
int main()
{
  double n,m,d,ans;
  cin >> n >> m >> d;
  x=d;
  ans=(n-d)*2/n/n*(m-1); 
  if(d==0)ans/=2;
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'x' was not declared in this scope
   14 |   x=d;
      |   ^
Language: C++

#include <iostream>
#include<iomanip>
#include<algorithm>
using namespace std;

int main() {

	int n, m, d; cin >> n >> m >> d;

	if (d == 0) {
		cout << setprecision(10) << (1.0 / n)*(m - 1) << endl;
	}
	else {
		cout << setprecision(10) << ((2.0*(n - d)) / pow(n, 2))*(m - 1) << endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:62: error: 'pow' was not declared in this scope
   14 |                 cout << setprecision(10) << ((2.0*(n - d)) / pow(n, 2))*(m - 1) << endl;
      |                                                              ^~~
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second

void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}
 
void No(){
	cout<<"No"<<endl;
	exit(0);
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n, m, d; cin >> n >> m >> d;
  ld res = (ld)(n - d) * (m - 1) (d != 0 ? 2 : 1);
  res /= (n * n);
  cout << setprecision(12) << res << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:34: error: expression cannot be used as a function
   55 |   ld res = (ld)(n - d) * (m - 1) (d != 0 ? 2 : 1);
      |                          ~~~~~~~~^~~~~~~~~~~~~~~~
Language: C++

#include <stdio.h>
#include <iostream>
using namespace std;
int in(){int x;scanf("%d",&x);return x;}
int main(){
    double n=in(),m=in(),d=in();
    double ans=d>0?2:1;
    ans*=(n-d)*(m-1)/n/n;
    cout<<setprecision(10)<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: 'setprecision' was not declared in this scope
    9 |     cout<<setprecision(10)<<ans<<endl;
      |           ^~~~~~~~~~~~
a.cc:3:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    2 | #include <iostream>
  +++ |+#include <iomanip>
    3 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
int main() {
  int N, M, D;
  cin >> N >> M >> D;
  cout << setprecision(10) << 1.0 * (M - 1) * (2.0 * (N - D)) / (N * N) << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: 'setprecision' was not declared in this scope
    6 |   cout << setprecision(10) << 1.0 * (M - 1) * (2.0 * (N - D)) / (N * N) << endl;
      |           ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include <iostream>
  +++ |+#include <iomanip>
    2 | using namespace std;
Language: C++

#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;
#define RET(ans) {cout<<ans<<endl;return 0;} 

    // 二次元ベクターの基本
    /*
    vector<vector<int>> dp; // 宣言
    dp.resize(n); // 1次元めの要素数決定
    dp[i].push_back(int); // プッシュバック
    rep(i,n){
        sort(dp[i].begin(),dp[i].end()); // 二次元めを昇順ソート
    }
    */

    // 整数スキャン（複数）
    /*
    int x,y,z;
    scanf("%d%d%d",&x,&y,&z);

    // n個の整数のスキャン
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // 文字列スキャン
    /*
    string s; cin >> s;
    */

    // n個の文字列スキャン
    /*
    vector<string> slist;
    rep(i,n){
        string s; cin >> s;
        slist.push_back(s);
    }
    */

int main() {
    ll n,m,d;
    cin >> n >> m >> d;


    double ans = 0;

    double kumi = (n-d)*2

    ans = (kumi/(double)(n*n))*(double)(m-1);
    
    cout << fixed << ans << endl;
    return 0;
}
 
 


Compiler output:
a.cc: In function 'int main()':
a.cc:101:5: error: expected ',' or ';' before 'ans'
  101 |     ans = (kumi/(double)(n*n))*(double)(m-1);
      |     ^~~
Language: C++

#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cassert>
using namespace std;

#define REP(i,n) for (ll i = 0; i < n; i++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;
typedef long long ll;

int main ()
{   
    int n,m,d;
    cin >> n >> m >> d;
    if (d == 0) {
        double P = 1.0 / (double)n;
        double ans = 0;
        REP(i,m - 1) ans += P; 
        cout << fixed << setprecisiton(10) << ans << endl;
    } else {
        double P = 2.0 * (double)(n - d) / (double)(n * n);
        double ans = 0;
        REP(i,m - 1) ans += P;
        cout << fixed << setprecision(10) << ans << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:26: error: 'setprecisiton' was not declared in this scope
   36 |         cout << fixed << setprecisiton(10) << ans << endl;
      |                          ^~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cassert>
using namespace std;

#define REP(i,n) for (ll i = 0; i < n; i++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;
typedef long long ll;

int main ()
{   
    int n,m,d;
    cin >> n >> m >> d;
    if (d == 0) {
        double P = 1.0 / (double)n;
        double ans = 0;
        REP(i,m - 1) ans += P; 
        cout << fixed << setprecisiton(10) << ans << endl;
    } else {
        double P = 2.0 * (double)(n - d) / (double)(n * n);
        double ans = 0;
        REP(i,m - 1) ans += P;
        cout << fixed << setprecisiton(10) << ans << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:26: error: 'setprecisiton' was not declared in this scope
   36 |         cout << fixed << setprecisiton(10) << ans << endl;
      |                          ^~~~~~~~~~~~~
a.cc:41:26: error: 'setprecisiton' was not declared in this scope
   41 |         cout << fixed << setprecisiton(10) << ans << endl;
      |                          ^~~~~~~~~~~~~
Language: C++

#include <string>
#include <vector>
#include <cmath>
#include <utility>
typedef long long ll;
ll MOD = 1e9+7;
 
using namespace std;
 
int main()
{
	double d,n,m;
	double ans=0;
	
	cin>>n>>m>>d;
	if(d==0)
	{
		ans=(m-1.0f)/n;
	}else{
		ans=2*(n-d)/pow(n,2);
ans*=(m-1);
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'cin' was not declared in this scope
   15 |         cin>>n>>m>>d;
      |         ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <utility>
  +++ |+#include <iostream>
    5 | typedef long long ll;
a.cc:23:9: error: 'cout' was not declared in this scope
   23 |         cout<<ans<<endl;
      |         ^~~~
a.cc:23:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:20: error: 'endl' was not declared in this scope
   23 |         cout<<ans<<endl;
      |                    ^~~~
a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    4 | #include <utility>
  +++ |+#include <ostream>
    5 | typedef long long ll;
Language: C++

#include <string>
#include <vector>
#include <cmath>
#include <utility>
typedef long long ll;
ll MOD = 1e9+7;
 
using namespace std;
 
int main()
{
	double d,n,m;
	double ans=0;
	
	cin>>n>>m>>d;
	if(d==0)
	{
		ans=(m-1.0f)/n;
	}else{
		ans=2.0f*(n-d)/pow(n,2);
ans*=(m-1.0f);
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'cin' was not declared in this scope
   15 |         cin>>n>>m>>d;
      |         ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <utility>
  +++ |+#include <iostream>
    5 | typedef long long ll;
a.cc:23:9: error: 'cout' was not declared in this scope
   23 |         cout<<ans<<endl;
      |         ^~~~
a.cc:23:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:20: error: 'endl' was not declared in this scope
   23 |         cout<<ans<<endl;
      |                    ^~~~
a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    4 | #include <utility>
  +++ |+#include <ostream>
    5 | typedef long long ll;
Language: C++

#include <string>
#include <vector>
#include <cmath>
#include <utility>
typedef long long ll;
ll MOD = 1e9+7;
 
using namespace std;
 
int main()
{
	double d,n,m;
	double ans=0;
	
	cin>>n>>m>>d;
	if(d==0)
	{
		ans=(m-1.0f)/n;
	}else{
		ans=2.0f*(n-d)/pow(n,2)*(m-1.0f);
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'cin' was not declared in this scope
   15 |         cin>>n>>m>>d;
      |         ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <utility>
  +++ |+#include <iostream>
    5 | typedef long long ll;
a.cc:22:9: error: 'cout' was not declared in this scope
   22 |         cout<<ans<<endl;
      |         ^~~~
a.cc:22:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:20: error: 'endl' was not declared in this scope
   22 |         cout<<ans<<endl;
      |                    ^~~~
a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    4 | #include <utility>
  +++ |+#include <ostream>
    5 | typedef long long ll;
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int dx[]={1,0,-1,0,1,-1,-1,1,0};
const int dy[]={0,1,0,-1,1,1,-1,-1,0};
const int INF = 1e9;
const long long LINF = 1e18;
const double EPS = 1e-8;
#define pb push_back
#define mk make_pair
#define fr first
#define sc second
#define reps(i,j,k) for(ll i = (j); i < (k); ++i)
#define rep(i,j) reps(i,0,j)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
typedef long long ll;
typedef pair<ll,ll> Pii;
typedef pair<Pii,int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
template<class T>
ostream& operator<<(ostream &out, const vector<T> &v){
	out << "{";
	rep(i,v.size()){
		out << v[i] <<", ";
	}
	return out << "}" << endl;
}
int main() {
    int n, m, d;
    cin >> n >> m >> d;
    double ans = 0.0;
    ans = (double)(2*d + (n-2*d)*2 ) / (double) n;
    if(d == 0){
        printf("%.8lf\n",(double)m/n)
    }
    else{
        printf("%.8lf\n",ans);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:38: error: expected ';' before '}' token
   35 |         printf("%.8lf\n",(double)m/n)
      |                                      ^
      |                                      ;
   36 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

int main(void){
  double n, m, d;
  cin >> n >> m >> d;
  cin.ignore();

  double p;
  if(
  if((d == 0) || (n <= 2 * d)){
    p = ((double)(m - 1)) / n;
  } else {
    p = ((double)((m - 1) * (2 * (n - 2 * d) + 2  * d))) / (n * n);
  }
  cout << p << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: expected primary-expression before 'if'
   14 |   if((d == 0) || (n <= 2 * d)){
      |   ^~
a.cc:16:5: error: expected primary-expression before 'else'
   16 |   } else {
      |     ^~~~
a.cc:16:4: error: expected ')' before 'else'
   16 |   } else {
      |    ^~~~~
      |    )
a.cc:13:5: note: to match this '('
   13 |   if(
      |     ^
Language: C++

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

int main()
{
    int n, m, d;
    cin >> n >> m >> d;
    if (d == 0)
        cout << 1./n << endl;
    else
        cout << 2.0(n-d)/(n*n) << endl;

    return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: expression cannot be used as a function
   11 |         cout << 2.0(n-d)/(n*n) << endl;
      |                 ~~~^~~~~
Language: C++

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

int main()
{
    int n. m, d;
    cin >> n >> m >> d;

    if (d == 0) cout << (double)1 / n;
    else cout << (long double)2 * (n - d) / n / n;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: expected initializer before '.' token
    6 |     int n. m, d;
      |          ^
a.cc:7:12: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |     cin >> n >> m >> d;
      |            ^
      |            yn
a.cc:7:17: error: 'm' was not declared in this scope; did you mean 'tm'?
    7 |     cin >> n >> m >> d;
      |                 ^
      |                 tm
a.cc:7:22: error: 'd' was not declared in this scope
    7 |     cin >> n >> m >> d;
      |                      ^
Language: C++

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

int main()
{
    int n. m, d;
    cin >> n >> m >> d;

    if (d = 0) cout << (long double)(m - 1) / n;
    else cout << (long double) 2 * (n - d) * (m - 1) / n / n;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: expected initializer before '.' token
    6 |     int n. m, d;
      |          ^
a.cc:7:12: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |     cin >> n >> m >> d;
      |            ^
      |            yn
a.cc:7:17: error: 'm' was not declared in this scope; did you mean 'tm'?
    7 |     cin >> n >> m >> d;
      |                 ^
      |                 tm
a.cc:7:22: error: 'd' was not declared in this scope
    7 |     cin >> n >> m >> d;
      |                      ^
Language: C++

n, m, d = map(int, input().split())

if d == 0:
  result = (m - 1) / n
else:
  result = ( n - d ) * 2 * (m - 1) / n / n

if result > 0.0000001:
  print(result)
else:
  print("0.000000")

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, m, d = map(int, input().split())
      | ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;

int main(){
  long long n,m,d;
  cin >> n >> m >> d;
  double res;
  if(d==0){
    res = (double)(m-1)/n;
  }else{
    res = (double)(m-1.0)*2*(n-d)/pow(n,2.0);
  }
  cout << fixed << setprecision(10) << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: 'setprecision' was not declared in this scope
   15 |   cout << fixed << setprecision(10) << res << endl;
      |                    ^~~~~~~~~~~~
a.cc:4:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    3 | #include<cmath>
  +++ |+#include <iomanip>
    4 | using namespace std;
Language: C++

#include <string>
#include <map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <sstream>
#include <string.h>
#define ll long long
#define pb push_back
using namespace std;

long long n, m, d;
 
void hai()
{
	cin >> n >> m >> d;
	if (d == 0) {
		cout << fixed << (1. * m - 1) * (n - d) / n / n;
		return;
	}
	double ans = (1. * m - 1) * 2. * (n - d) / n / n;
	cout << fixed << ans << "\n";
}
 
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	hai();
	return 0;
}

Compiler output:
a.cc: In function 'void hai()':
a.cc:17:9: error: 'cin' was not declared in this scope
   17 |         cin >> n >> m >> d;
      |         ^~~
a.cc:9:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    8 | #include <string.h>
  +++ |+#include <iostream>
    9 | #define ll long long
a.cc:19:17: error: 'cout' was not declared in this scope
   19 |                 cout << fixed << (1. * m - 1) * (n - d) / n / n;
      |                 ^~~~
a.cc:19:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:9: error: 'cout' was not declared in this scope
   23 |         cout << fixed << ans << "\n";
      |         ^~~~
a.cc:23:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc: In function 'int main()':
a.cc:29:9: error: 'cin' was not declared in this scope
   29 |         cin.tie(0);
      |         ^~~
a.cc:29:9: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++


#include <iostream>
#include <math.h>
#include <vector>
#include <stack>
#include <cstdio>
#include <string>
#include <bitset>
#include <list>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <functional>

using namespace std;
//debug

#define rep(i, N) for (int i = 0; i < N; i++)

#define pb push_back

typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<string> vs;



#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()



int main() {
	ll n,m,d;
	cin >> n >> m >> d;
	printf("%.8f", double(m - 1) / n / n*(n*double(d == 0) + 2*(n - d)*double(d != 0));


}



Compiler output:
a.cc: In function 'int main()':
a.cc:39:91: error: expected ')' before ';' token
   39 |         printf("%.8f", double(m - 1) / n / n*(n*double(d == 0) + 2*(n - d)*double(d != 0));
      |               ~                                                                           ^
      |                                                                                           )
Language: C++

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

typedef long long i64;
#define put(n) cout<<(n)<<"\n"
#define FOR(i,num,N) for(int(i)=(num);(i)<(N);(i)++)
#define RFOR(i,num,N) for(int (i)=(num);(i)>(N);(i)--)
#define all(v) (v).begin() , (v).end()
#define rall(v) (v).rbegin() , (v).rend()

int main(){
    double n,m,d;
    cin>>n>>m>>d;
    if(d == 0) cout<<setprecision(12)<<(m-1)/n;
    else cout<<setprecision(12)<<2*(n-d)*(m-1)/(n*n);
}

Compiler output:
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
    1 | #include<bits\stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<stack>
#include<queue>
using namespace std;

typedef long long i64;
#define put(n) cout<<(n)<<"\n"
#define FOR(i,num,N) for(int(i)=(num);(i)<(N);(i)++)
#define RFOR(i,num,N) for(int (i)=(num);(i)>(N);(i)--)
#define all(v) (v).begin() , (v).end()
#define rall(v) (v).rbegin() , (v).rend()

int main(){
    double n,m,d;
    cin>>n>>m>>d;
    if(d == 0) put((m-1)/n);
    else put(2*(n-d)*(m-1)/(n*n);
}

Compiler output:
a.cc:22:2: error: unterminated argument list invoking macro "put"
   22 | }
      |  ^
a.cc: In function 'int main()':
a.cc:21:10: error: 'put' was not declared in this scope
   21 |     else put(2*(n-d)*(m-1)/(n*n);
      |          ^~~
a.cc:21:13: error: expected '}' at end of input
   21 |     else put(2*(n-d)*(m-1)/(n*n);
      |             ^
a.cc:17:11: note: to match this '{'
   17 | int main(){
      |           ^
Language: C++

int main(){
    double n,m,d;
    cin>>n>>m>>d;
    if(d == 0) put((m-1)/n);
    else put(2*(n-d)*(m-1)/(n*n);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin>>n>>m>>d;
      |     ^~~
a.cc:4:16: error: 'put' was not declared in this scope
    4 |     if(d == 0) put((m-1)/n);
      |                ^~~
a.cc:5:33: error: expected ')' before ';' token
    5 |     else put(2*(n-d)*(m-1)/(n*n);
      |             ~                   ^
      |                                 )
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << (x) << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
int main(){
	double n,m,d;
	cin>>n>>m>>d;
  if(d==0)
	printf("%.12f\n",(1/n);
   else
           printf("%.12f\n",(2*(n-d)/n/n));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:31: error: expected ')' before ';' token
   18 |         printf("%.12f\n",(1/n);
      |               ~               ^
      |                               )
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << (x) << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
int main(){
	double n,m,d;
	cin>>n>>m>>d;
  if(d==0)
	printf("%.12f\n",(1/n);
   else
           printf("%.12f\n",(2*(n-d)/n/n);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:31: error: expected ')' before ';' token
   18 |         printf("%.12f\n",(1/n);
      |               ~               ^
      |                               )
a.cc:20:42: error: expected ')' before ';' token
   20 |            printf("%.12f\n",(2*(n-d)/n/n);
      |                  ~                       ^
      |                                          )
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << (x) << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
int main(){
	double n,m,d;
	cin>>n>>m>>d;
  if(d==0)
	printf("%.12f\n",(1/n);
   else
           printf("%.12f\n",(2(n-d)/n/n);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:31: error: expected ')' before ';' token
   18 |         printf("%.12f\n",(1/n);
      |               ~               ^
      |                               )
a.cc:20:31: error: expression cannot be used as a function
   20 |            printf("%.12f\n",(2(n-d)/n/n);
      |                              ~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back
 
typedef long long ll;
typedef pair<ll, int> ll_i;

int main() {
    double n,m,d;
    cin >> n >> m >> d;
    double tmp = 2.0*(m - 1)*(n - d)) / (n*n);
    if (d == 0){
        cout << tmp/2.0 << endl;
    } else {
        cout << tmp << endl;
    }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:37: error: expected ',' or ';' before ')' token
   13 |     double tmp = 2.0*(m - 1)*(n - d)) / (n*n);
      |                                     ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  long double n,m,d;
  cin >> n >> m >> d;

  long double result;
  if(d == 0){
    result = (m-1)/n;
  }else{
    result = 2*(m-1)*(n-d)/(n*n);
  }

  cout << setprecision(10) << result << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: 'setprecision' was not declared in this scope
   15 |   cout << setprecision(10) << result << endl;
      |           ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include <iostream>
  +++ |+#include <iomanip>
    2 | using namespace std;
Language: C++

#include<cstdio>
#include<iostream>

int main()
{
  double n,m,d;
  cin >> n >> m >> d;
  if(d == 0)
    cout << 1/n << endl;
  else
    cout << (2*(n-d)*(m-1))/(n*n) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> n >> m >> d;
      |   ^~~
      |   std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |     cout << 1/n << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |     cout << 1/n << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:11:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |     cout << (2*(n-d)*(m-1))/(n*n) << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:38: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |     cout << (2*(n-d)*(m-1))/(n*n) << endl;
      |                                      ^~~~
      |                                      std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <math.h>
using namespace std;

int main() {
	int n, m, d;
	cin >> n >> m >> d;
	long float counts = pow(n, 2);
	long float sum = 0;
	if (d == 0) {
		sum = n - d;
	}
	else {
		sum = (n - d) * 2;
	}
	long float ave = sum / counts;
	cout << ave*(m-1) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'long' specified with 'float'
    8 |         long float counts = pow(n, 2);
      |         ^~~~
a.cc:9:9: error: 'long' specified with 'float'
    9 |         long float sum = 0;
      |         ^~~~
a.cc:16:9: error: 'long' specified with 'float'
   16 |         long float ave = sum / counts;
      |         ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <math.h>

using namespace std;

#define REP(i,n)	for(int i=0;i<(n);++i)
#define REPS(i,s,t)	for(int i=(s);i<(t);++i)

#define INF 		2000000007
#define MOD			998244353

#define MAX 		100005

typedef unsigned int 			uint;
typedef unsigned long long int	ull;
typedef long long int ll;


int main(){
	int n,m,d;cin>>n>>m>>d;
	double ans = 0.0;

	if(d == 0)
		ans = 1.0*(m-1)/n;
	else{
		ans = double((n - d) * 2) / (n*n)*(m - 1);
	}

	cout << setprecision(7)<< ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:17: error: 'setprecision' was not declared in this scope
   35 |         cout << setprecision(7)<< ans << endl;
      |                 ^~~~~~~~~~~~
a.cc:9:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    8 | #include <math.h>
  +++ |+#include <iomanip>
    9 |
Language: C++

#include<iostream>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
using namespace std;
int n,m,d,k;
long double ans,z;
int main(){
	cin>>n>>m>>d;
	ans=1 long long*2*(n-d)*(m-1);
	z=(n*n);
	z=1/z;
	ans*=z;
	if(d==0) {
		z=n;
		z=1/z;
		ans=z*(m-1);
//		ans/=2;
	}
	printf("%.10lf",(double)ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: expected ';' before 'long'
   11 |         ans=1 long long*2*(n-d)*(m-1);
      |              ^~~~~
      |              ;
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <math.h>

using namespace std;

#define REP(i,n)	for(int i=0;i<(n);++i)
#define REPS(i,s,t)	for(int i=(s);i<(t);++i)

#define INF 		2000000007
#define MOD			998244353

#define MAX 		100005

typedef unsigned int 			uint;
typedef unsigned long long int	ull;
typedef long long int ll;


int main(){
	int N,M,D;cin>>N>>M>>D;
	double ans = 0.0;

	if(D == 0)
		ans = 1.0*(M-1)/N;
	else{
		double d = N-D;
		ans = d*1.0*2 /N/N*(M-1);
	}

	cout << ans << endl;

	return 0;
}#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <math.h>

using namespace std;

#define REP(i,n)	for(int i=0;i<(n);++i)
#define REPS(i,s,t)	for(int i=(s);i<(t);++i)

#define INF 		2000000007
#define MOD			998244353

#define MAX 		100005

typedef unsigned int 			uint;
typedef unsigned long long int	ull;
typedef long long int ll;


int main(){
	int N,M,D;cin>>N>>M>>D;
	double ans = 0.0;

	if(D == 0)
		ans = 1.0*(M-1)/N;
	else{
		double d = N-D;
		ans = d*1.0*2 /N/N*(M-1);
	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc:39:2: error: stray '#' in program
   39 | }#include <iostream>
      |  ^
a.cc:39:3: error: 'include' does not name a type
   39 | }#include <iostream>
      |   ^~~~~~~
a.cc:63:5: error: redefinition of 'int main()'
   63 | int main(){
      |     ^~~~
a.cc:25:5: note: 'int main()' previously defined here
   25 | int main(){
      |     ^~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
#define ll long long ;
int main(){
  ll n;
  ll m;
  ll d;
  long double ans;
  cin >> n >> m >> d;

  int cou=0;


    if(d==0){
      cou=n;
    }else if(d > n){
      cou = 0;

    }else{
    cou = 2*(n-d);
   }



  ans = (double)cou*(m-1)/(double)(n*n);

  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:17: error: declaration does not declare anything [-fpermissive]
    4 | #define ll long long ;
      |                 ^~~~
a.cc:6:3: note: in expansion of macro 'll'
    6 |   ll n;
      |   ^~
a.cc:6:6: error: 'n' was not declared in this scope
    6 |   ll n;
      |      ^
a.cc:4:17: error: declaration does not declare anything [-fpermissive]
    4 | #define ll long long ;
      |                 ^~~~
a.cc:7:3: note: in expansion of macro 'll'
    7 |   ll m;
      |   ^~
a.cc:7:6: error: 'm' was not declared in this scope; did you mean 'tm'?
    7 |   ll m;
      |      ^
      |      tm
a.cc:4:17: error: declaration does not declare anything [-fpermissive]
    4 | #define ll long long ;
      |                 ^~~~
a.cc:8:3: note: in expansion of macro 'll'
    8 |   ll d;
      |   ^~
a.cc:8:6: error: 'd' was not declared in this scope
    8 |   ll d;
      |      ^
Language: Java

public class Main {
        public static void main(String [] args){
            Scanner sc =new Scanner(System.in);
            int sum = 0;
            long ans = 0;
            long n = sc.nextLong();
            long m = sc.nextLong();
            long d = sc.nextLong();

            if(d==0) {
                System.out.println(n);
            }else {
                ans =2*(n-d+2);
                System.out.println(ans/(n*n));
            }

        }
}


Compiler output:
Main.java:3: error: cannot find symbol
            Scanner sc =new Scanner(System.in);
            ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
            Scanner sc =new Scanner(System.in);
                            ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#include<algorithm>
using namespace std;
 
int main(){
  long double n,m,d;
  cin >> n >> m >> d;
  if(d!=0){
   cout << setprecision(10) << 2*(m-1)/(n*n)*(n-d) << endl;
  }
  else{
   cout << setprecision(10) << (m-1)/n << endl;
  }
  return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: 'setprecision' was not declared in this scope
   11 |    cout << setprecision(10) << 2*(m-1)/(n*n)*(n-d) << endl;
      |            ^~~~~~~~~~~~
a.cc:5:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    4 | #include<algorithm>
  +++ |+#include <iomanip>
    5 | using namespace std;
a.cc:14:12: error: 'setprecision' was not declared in this scope
   14 |    cout << setprecision(10) << (m-1)/n << endl;
      |            ^~~~~~~~~~~~
a.cc:14:12: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#include<algorithm>
using namespace std;

int main(){
  long double n,m,d;
  cin >> n >> m >> d;
  if(d!=0){
   cout << (((m-1)/n)*(n-1))*((n-d)/(n-1)/n*2)) << endl;
  }
  else{
   cout << (m-1)/n << endl;
  }
  return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:47: error: expected ';' before ')' token
   11 |    cout << (((m-1)/n)*(n-1))*((n-d)/(n-1)/n*2)) << endl;
      |                                               ^
      |                                               ;
Language: C++

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

using ll=long long;
#define int ll

#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)

int read(){
	int i;
	scanf("%lld",&i);
	return i;
}

signed main(){
	int n,m,d;
	cin >> n >> m >> d;
	int score = 0;
	for(int i=1;i<=n;i++){
		if(i+d <= n) score +=1/n;
		if(i-d >= 1 && d != 0) score +=1/n;
	}
	print("%.15f",score * double(m-1) / n);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'print' was not declared in this scope; did you mean 'rint'?
   24 |         print("%.15f",score * double(m-1) / n);
      |         ^~~~~
      |         rint
Language: C++

#include<iostream>
#include<cstdout>
using namespace std;
 
int main(){
   int n,m,d;
   cin >> n >> m >> d;
 
   if( d !=0){
      printf("%.7f", 2.0 * (n-d) * (m-1) / n / n);
   }else{
      printf("%.7f", 1.0  * (m-1)  / n);
   }
}

Compiler output:
a.cc:2:9: fatal error: cstdout: No such file or directory
    2 | #include<cstdout>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
using namespace std;
typedef long long ll;
ll prime(ll x) {
	ll i;
	if (x < 2)return 0;
	else if (x == 2) return 1;
	if (x % 2 == 0) return 0;
	for (i = 3; i*i <= x; i += 2) {
		if (x%i == 0) return 0;
	}
	return 1;
}

ll MOD = 1000000007;
int main() {
	long double n, m, d;
	cin >> n >> m >> d;
	if (d != 0)
		cout << fixed << setprecision(13) << (m - 1) / n << endl;
	else(d == 0)
		cout <<fixed<<setprecision(13)<< (2*(m-1)*(n-d)/(n*n)) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:21: error: expected ';' before 'cout'
   36 |         else(d == 0)
      |                     ^
      |                     ;
   37 |                 cout <<fixed<<setprecision(13)<< (2*(m-1)*(n-d)/(n*n)) << endl;
      |                 ~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
using namespace std;
typedef long long ll;
ll prime(ll x) {
	ll i;
	if (x < 2)return 0;
	else if (x == 2) return 1;
	if (x % 2 == 0) return 0;
	for (i = 3; i*i <= x; i += 2) {
		if (x%i == 0) return 0;
	}
	return 1;
}

ll MOD = 1000000007;
int main() {
	long double n, m, d;
	cin >> n >> m >> d;
	if (n != 0)
		cout << fixed << setprecision(13) << (m - 1) / n << endl;
	else(n == 0)
		cout << 0 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:21: error: expected ';' before 'cout'
   36 |         else(n == 0)
      |                     ^
      |                     ;
   37 |                 cout << 0 << endl;
      |                 ~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
using namespace std;
typedef long long ll;
ll prime(ll x) {
	ll i;
	if (x < 2)return 0;
	else if (x == 2) return 1;
	if (x % 2 == 0) return 0;
	for (i = 3; i*i <= x; i += 2) {
		if (x%i == 0) return 0;
	}
	return 1;
}

ll MOD = 1000000007;
int main() {
	long double n, m, d;
	cin >> n >> m >> d;
  	if(n!=0)
	cout<<fixed<< setprecision(13) << (m - 1) / n << endl;
  	else(n==0)
    cout<<0<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:19: error: expected ';' before 'cout'
   36 |         else(n==0)
      |                   ^
      |                   ;
   37 |     cout<<0<<endl;
      |     ~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
using namespace std;
typedef long long ll;
ll prime(ll x) {
	ll i;
	if (x < 2)return 0;
	else if (x == 2) return 1;
	if (x % 2 == 0) return 0;
	for (i = 3; i*i <= x; i += 2) {
		if (x%i == 0) return 0;
	}
	return 1;
}

ll MOD = 1000000007;
int main() {
	long double n, m, d;
	cin >> n >> m >> d;
  	if(n!=0)
	cout<<fixed<< setprecision(13) << (m - 1) / n << endl;
  	else(n=0)
    cout<<0<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:18: error: expected ';' before 'cout'
   36 |         else(n=0)
      |                  ^
      |                  ;
   37 |     cout<<0<<endl;
      |     ~~~~
Language: C

#include <stdio.h>
int main(void){
  int n,m,d;
  scanf("%d %d %d",n,m,d);
  if(d==0){
    printf("%f",(1.0*(n-d)*(n**(m-2))*(m-1))/(n**m));

  }
  else{
    printf("%d",(2.0*(n-d)*(n**(m-2))*(m-1))/(n**m))
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:31: error: invalid type argument of unary '*' (have 'int')
    6 |     printf("%f",(1.0*(n-d)*(n**(m-2))*(m-1))/(n**m));
      |                               ^~~~~~
main.c:6:49: error: invalid type argument of unary '*' (have 'int')
    6 |     printf("%f",(1.0*(n-d)*(n**(m-2))*(m-1))/(n**m));
      |                                                 ^~
main.c:10:31: error: invalid type argument of unary '*' (have 'int')
   10 |     printf("%d",(2.0*(n-d)*(n**(m-2))*(m-1))/(n**m))
      |                               ^~~~~~
main.c:10:49: error: invalid type argument of unary '*' (have 'int')
   10 |     printf("%d",(2.0*(n-d)*(n**(m-2))*(m-1))/(n**m))
      |                                                 ^~
main.c:10:53: error: expected ';' before '}' token
   10 |     printf("%d",(2.0*(n-d)*(n**(m-2))*(m-1))/(n**m))
      |                                                     ^
      |                                                     ;
   11 |   }
      |   ~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
  int n;
  int m;
  int d;
  double double ans;
  cin >> n >> m >> d;

  int cou=0;


    if(d==0){
      cou=n;
    }else if(d > n){
      cou = 0;

    }else{
    cou = 2*(n-d);
   }



  ans = (long double)cou*((long double)m-(long double)1)/((long double)n)/((long double)n);

  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: two or more data types in declaration of 'ans'
    8 |   double double ans;
      |   ^~~~~~
a.cc:25:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |   ans = (long double)cou*((long double)m-(long double)1)/((long double)n)/((long double)n);
      |   ^~~
      |   abs