Rating changes for the last round are temporarily rolled back. They will be returned soon. ×

 
 
 
 
General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
40804467 Contestant:
rahul1995
1011C - 37 GNU C++ Wrong answer on pretest 8 31 ms 12 KB 2018-07-26 19:32:06 2018-07-26 19:32:09
 
 
→ Source
/**
 * @author: Rahul Jain
**/

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

#define rep(i,n) for((i)=0;(i)<(n);(i)++)
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define ABS(p) ((p) < 0 ? -(p) : (p))
#define MOD 1000000007

void printArr(int a[], int n) {
    cout<<"\n----Print Array start----\n";
    int i;
    rep(i, n) cout<<a[i]<<" ";
    cout<<"\n----Print Array end----\n";
}

int main() {
	// your code goes here
	int n, m, i, a;
	cin >> n >> m;
	long long p = 1, p_1 = 1;
	rep(i, 2*n) {
	    cin >> a;
	    p = p*a;
	    p_1 = p_1*(a-1);
	}
	
	if(p==0 || p_1==0) cout << -1;
	else {
		double num = m*(p-p_1);
		printf("%.10lf", num/p_1);
	}
	return 0;
}
 
 
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details