提交时间:2022-07-20 11:59:58
运行 ID: 52807
#include<bits/stdc++.h> #define upf(i,n,k) for(int i=k;i<=n;i++) #define lowf(i,n,k) for(int i=n;i>=k;i--) #define Max(a,b,c) max(a,max(b,c)) #define Min(a,b,c) min(a,min(b,c)) #define ofile(N) freopen(N".in","r",stdin),freopen(N".out","w",stdout) #define ri register int #define ie inline #define ll long long using namespace std; double adddd[30]; double n,a,b; int kkk() { ll sum=1; upf(i,n,1)sum*=i; } bool check() { bool f=1; upf(i,n,1)if(adddd[i]==i)continue; else f=0; if(!f)return 0; return 1; } ie int read() { int s=0,w=1; char ch=getchar(); while(ch<'0'||ch>'9') { if(ch=='-')w=-1; ch=getchar(); } while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar(); return s*w; } ie void out(int a) { if(a>=10)out(a/10); putchar(a%10+'0'); } int main() { //ofile(""); n=read(),a=read(),b=read(); upf(i,n,1)adddd[i]=read(); if(check())puts("0.00000000000000000000"); else printf("%.20lf",min(b*kkk(),a*(n-1))); return 0; }