/**
 * Author: Sergey Kopeliovich (Burunduk30@gmail.com5
 * Date: 2013.10.05
 */

#include "testlib.h"

#include <cmath>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <algorithm>

using namespace std;

#define forn(i, n) for (int i = 0; i < (int)(n); i++)
#define forab(i, a, b) for (int i = (a); i <= (b); i++)

typedef double dbl;

const dbl eps = 1.1e-6;

struct pnt
{
  int x, y;

  pnt( int _x = 0, int _y = 0 ) : x(_x), y(_y) { }

  inline pnt operator - () const { return pnt(-x, -y); }

  inline pnt operator + ( const pnt &p ) const { return pnt(x + p.x, y + p.y); }
  inline pnt operator - ( const pnt &p ) const { return pnt(x - p.x, y - p.y); }
  inline pnt operator * ( const int &k ) const { return pnt(x * k, y * k); }
  inline pnt operator / ( const int &k ) const { return pnt(x / k, y / k); }

  inline int operator * ( const pnt &p ) const { return (int)x * p.y - (int)y * p.x; }
  inline int operator ^ ( const pnt &p ) const { return (int)x * p.x + (int)y * p.y; }

  inline bool operator == ( const pnt &p ) const { return x == p.x && y == p.y; }
  inline bool operator != ( const pnt &p ) const { return !(*this == p); }
  inline bool operator < ( const pnt &p ) const { return x < p.x || (x == p.x && y < p.y); }

  inline void read() { assert(scanf("%d%d", &x, &y) == 2); }

  inline int d2() const { return (int)x * x + (int)y * y; }
  inline dbl d() const  { return sqrt(d2()); }
  inline pnt ort() const { return pnt(-y, x); }

  void out() { printf("%d %d ", x, y); }
  void outln() { out(), puts(""); }
};

inline bool pless( const pnt &a, const pnt &b )
{
  int x = a * b;
  return x != 0 ? x < 0 : a.d2() < b.d2();
}

int ConvexHull( int n, pnt *p )
{
  int mi = 0;
  forn(i, n)
    if (p[mi] < p[i])
      mi = i;
  swap(p[0], p[mi]);
  forab(i, 1, n - 1)
    p[i] = p[i] - p[0];
  sort(p + 1, p + n, pless);

  int rn = 1;
  pnt st = p[0];
  forab(i, 1, n - 1)
  {
    pnt q = p[i] + st;
    while (rn >= 2 && (p[rn - 1] - p[rn - 2]) * (q - p[rn - 2]) >= 0)
      rn--;
    p[rn++] = q;
  }
  return rn;
}

const int N = 64;

int n, k;
dbl opt = 1e9;
int ind[N], r_ind[N];
pnt p[N], t[N];

void go( int i, int pn )
{
  if (pn == k)
  {
    forn(j, k)
      t[j] = p[ind[j]];
    int n = ConvexHull(k, t);
    dbl len = 0;
    forn(j, n)
      len += (t[(j + 1) % n] - t[j]).d();
    if (len < opt)
      opt = len, memcpy(r_ind, ind, sizeof(ind));
    return;
  }
  if (i == n)
    return;
  ind[pn] = i;
  go(i + 1, pn + 1);
  go(i + 1, pn);
}

void readInput( InStream &inf )
{
  n = inf.readInt(1, N);
  k = inf.readInt(1, n);
  forn(i, n)
  {
    p[i].x = inf.readInt();
    p[i].y = inf.readInt();
  }
}

dbl readOutput( InStream &out )
{
  dbl ans = out.readDouble();
  forn(i, k)
    ind[i] = out.readInt(1, n) - 1;
  sort(ind, ind + k);
  if (unique(ind, ind + k) - ind != k)
    out.quitf(_wa, "points can not be used twice!");
  forn(i, k)
    t[i] = p[ind[i]];
  int n = ConvexHull(k, t);
  dbl len = 0;
  forn(j, n)
    len += (t[(j + 1) % n] - t[j]).d();
  if (fabs(len - ans) > eps)
    out.quitf(_wa, "promised %.9f, calculated %.9f", ans, len);
  return len;
}

int main(int argc, char *argv[])
{
  registerTestlibCmd(argc, argv);

  readInput(inf);

  dbl ja = readOutput(ans);
  dbl ca = readOutput(ouf);

  if (fabs(ca - ja) > eps)
    quitf(ca < ja ? _fail : _wa, "Contestant says %.9f, jury say %.9f", ca, ja);
  quitf(_ok, "OK (n = %d, k = %d, answer = %.9f)", n, k, ja);
  return 0;
}
                     