/*--------------------------------------------------------------*/
/* ACM ICPC 2007-2008                                           */
/* Northeastern European Regional Contest                       */
/* St Petersburg - Barnaul - Tashkent - Batumi, November 28, 200*/
/*--------------------------------------------------------------*/
/* Problem G. Game                                              */
/*--------------------------------------------------------------*/
/* Solution                                                     */
/*                                                              */
/* Author                Iskander Akishev                       */
/*--------------------------------------------------------------*/
 
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class game_ia_bigint implements Runnable {
    private Scanner in;
    private PrintWriter out;
    private int n, k;
    private Rational[] p;
    private Rational[][] pl;
    private Rational[][] pr;
    private Rational[][] l;
    private Rational[][] r;
    private Rational[][] fl;
    private Rational[][] fr;
    final Rational ONE = new Rational(1, 1);
    final Rational ZERO = new Rational(0, 1);

    class Rational {
        final BigInteger p, q;
        
        Rational(long p, long q) {
            this(BigInteger.valueOf(p), BigInteger.valueOf(q));
        }
        
        Rational(BigInteger p, BigInteger q) {
            BigInteger x = p.gcd(q);
            this.p = p.divide(x);
            this.q = q.divide(x);
        }
        
        Rational add(Rational that) {
            BigInteger p1 = p.multiply(that.q).add(that.p.multiply(q));
            BigInteger q1 = q.multiply(that.q);
            return new Rational(p1, q1);
        }
        
        Rational sub(Rational that) {
            BigInteger p1 = p.multiply(that.q).subtract(that.p.multiply(q));
            BigInteger q1 = q.multiply(that.q);
            return new Rational(p1, q1);
        }
        
        Rational mul(Rational that) {
            BigInteger p1 = p.multiply(that.p);
            BigInteger q1 = q.multiply(that.q);
            return new Rational(p1, q1);
        }
        
        Rational div(Rational that) {
            BigInteger p1 = p.multiply(that.q);
            BigInteger q1 = q.multiply(that.p);
            return new Rational(p1, q1);
        }
        
        double toDouble() {
            return p.doubleValue() / q.doubleValue();
        }
        
        @Override
        public String toString() {
            return Double.toString(toDouble());
        }
    }
    
    public void run() {
        try {
            solve();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
    
    private Rational geomSeries(Rational x) {
//      return (1.0d / (1.0d - x));
        return ONE.div(ONE.sub(x));
    }
    
    private int prev(int u) {
        return u == 0 ? n - 1 : u - 1;
    }
    
    private int next(int u) {
        return (u + 1) % n;
    }
    
    private void calculatePR() {
        pr = new Rational[n][n];
        for (int i = 0; i < n; i++) {
//          pr[i][i] = 0;
            pr[i][i] = ZERO;
        }
        for (int i = 0; i < n; i++) {
//          pr[i][(i + 1) % n] = p[i] * (1 - p[(i + 1) % n]);
            pr[i][next(i)] = p[i].mul(ONE.sub(p[next(i)]));
        }
        for (int size = 2; size < n; size++) {
            for (int i = 0; i < n; i++) {
                int j = (i + size) % n;
//              pr[i][j] = p[i] * geomSeries(pr[next(i)][j]) * (1 - p[next(i)]);
                pr[i][j] = p[i].mul(geomSeries(pr[next(i)][j])).mul(ONE.sub(p[next(i)]));
            }
        }
    }

    private void calculatePL() {
        pl = new Rational[n][n];
        for (int i = 0; i < n; i++) {
//          pl[i][i] = 0.0;
            pl[i][i] = ZERO;
        }
        for (int i = 0; i < n; i++) {
//          pl[i][prev(i)] = (1 - p[i]) * p[prev(i)];
            pl[i][prev(i)] = (ONE.sub(p[i])).mul(p[prev(i)]);
        }
        for (int size = 2; size < n; size++) {
            for (int i = 0; i < n; i++) {
                int j = (i - size + n) % n;
//              pl[i][j] = (1 - p[i]) * geomSeries(pl[prev(i)][j]) * p[prev(i)];
                pl[i][j] = ONE.sub(p[i]).mul(geomSeries(pl[prev(i)][j])).mul(p[prev(i)]);
            }
        }
    }
    
    private void calcR() {
        r = new Rational[n][n];
        for (int i = 0; i < n; i++) {
//          r[i][i] = 1.0;
            r[i][i] = ONE;
        }
        for (int i = 0; i < n; i++) {
            r[i][next(i)] = p[i];
        }
        for (int size = 2; size < n; size++) {
            for (int i = 0; i < n; i++) {
                int j = (i + size) % n;
//              r[i][j] = geomSeries(pr[i][prev(j)]) * p[i] * r[next(i)][j];
                r[i][j] = geomSeries(pr[i][prev(j)]).mul(p[i]).mul(r[next(i)][j]);
            }
        }
    }

    private void calcL() {
        l = new Rational[n][n];
        for (int i = 0; i < n; i++) {
//          l[i][i] = 1.0;
            l[i][i] = ONE;
        }
        for (int i = 0; i < n; i++) {
//          l[i][prev(i)] = 1 - p[i];
            l[i][prev(i)] = ONE.sub(p[i]);
        }
        for (int size = 2; size < n; size++) {
            for (int i = 0; i < n; i++) {
                int j = (i - size + n) % n;
//              l[i][j] = geomSeries(pl[i][next(j)]) * (1 - p[i]) * l[prev(i)][j];
                l[i][j] = geomSeries(pl[i][next(j)]).mul(ONE.sub(p[i])).mul(l[prev(i)][j]);
            }
        }
    }
    
//  private void calcGL() {
//      gl = new double[n][n];
//      for (int i = 0; i < n; i++) {
//          gl[i][i] = 1.0;
//      }
//      for (int i = 0; i < n; i++) {
//          gl[i][prev(i)] = (1 - p[i]) * geomSeries((1 - p[i]) * p[prev(i)]);
//      }
//      for (int size = 2; size < n; size++) {
//          for (int i = 0; i < n; i++) {
//              int j = (i - size + n) % n;
//              gl[i][j] = geomSeries(pl[i][j]) * (1 - p[i]) * gl[prev(i)][j];
//          }
//      }
//  }
//
//  private void calcGR() {
//      gr = new double[n][n];
//      for (int i = 0; i < n; i++) {
//          gr[i][i] = 1.0;
//      }
//      for (int i = 0; i < n; i++) {
//          gr[i][next(i)] = p[i] * geomSeries(p[i] * (1 - p[next(i)]));
//      }
//      for (int size = 2; size < n; size++) {
//          for (int i = 0; i < n; i++) {
//              int j = (i + n) % n;
//              gr[i][j] = geomSeries(pr[i][j]) * p[i] * gr[next(i)][j];
//          }
//      }
//  }

    private void calcF() {
        fl = new Rational[n][n];
        fr = new Rational[n][n];
        for (int i = 0; i < n; i++) {
//          fl[i][next(i)] = (next(i) != k) ? 0 : (1 - p[k]);  
//          fr[i][prev(i)] = (prev(i) != k) ? 0 : p[k];  
            fl[i][next(i)] = (next(i) != k) ? ZERO : (ONE.sub(p[k]));  
            fr[i][prev(i)] = (prev(i) != k) ? ZERO : p[k];  
        }
        for (int size = 2; size < n; size++) {
            for (int i = 0; i < n; i++) {
                int j = (i + size) % n;
//              fl[i][j] = (fl[next(i)][j] + fr[j][next(i)] * l[j][next(i)]) * geomSeries(pr[next(i)][j]) * (1 - p[next(i)]);
                fl[i][j] = (fl[next(i)][j].add(fr[j][next(i)].mul(l[j][next(i)]))).mul(geomSeries(pr[next(i)][j])).mul(ONE.sub(p[next(i)]));
            }
            for (int i = 0; i < n; i++) {
                int j = (i - size + n) % n;
//              fr[i][j] = (fr[prev(i)][j] + fl[j][prev(i)] * r[j][prev(i)]) * geomSeries(pl[prev(i)][j]) * p[prev(i)];
                fr[i][j] = (fr[prev(i)][j].add(fl[j][prev(i)].mul(r[j][prev(i)]))).mul(geomSeries(pl[prev(i)][j])).mul(p[prev(i)]);
            }
        }
    }

    private void solve() throws IOException {
        Locale.setDefault(Locale.US);
        in = new Scanner(new FileReader("game.in"));
        out = new PrintWriter("game.out");
        
        n = in.nextInt();
        k = in.nextInt() - 1;
        p = new Rational[n];
        p[n - 1] = ONE;
        for (int i = 0; i < n - 1; i++) {
            double z = in.nextDouble();
            int pp = (int) Math.round(z * 100);
            int qq = 100;
            p[i] = new Rational(pp, qq);
        }
        calculatePL();
        calculatePR();
        calcL();
        calcR();
//      calcGL();
//      calcGR();
        calcF();
        
        if (n == 2) {
            out.println((k == 0) ? 1 : 0);
        } else {
            Rational res = fl[next(n - 1)][prev(n - 1)].add(fr[prev(n - 1)][next(n - 1)]);
            System.out.println(res.p + " " + res.q);
            out.println(res);
        }
        
        in.close();
        out.close();
    }
    
    public static void main(String[] args) {
        new Thread(new game_ia_bigint()).start();
    }

}
