#include <bits/stdc++.h>
using namespace std;
bool SR(int &x) { return scanf("%d", &x) == 1; }
bool SR(long long &x) { return scanf("%lld", &x) == 1; }
bool SR(double &x) { return scanf("%lf", &x) == 1; }
bool SR(char *s) { return scanf("%s", s) == 1; }
bool RI() { return true; }
template <typename I, typename... T>
bool RI(I &x, T &...tail) {
  return SR(x) && RI(tail...);
}
void SP(const int x) { printf("%d", x); }
void SP(const long long x) { printf("%lld", x); }
void SP(const double x) { printf("%.16lf", x); }
void SP(const char *s) { printf("%s", s); }
void PL() { puts(""); }
template <typename I, typename... T>
void PL(const I x, const T... tail) {
  SP(x);
  if (sizeof...(tail)) putchar(' ');
  PL(tail...);
}
const int maxn = 1e3 + 3;
long double p[maxn][maxn];
int n;
void read() {
  RI(n);
  for (int i = (1); i <= int(n); i++)
    for (int j = (1); j <= int(n); j++) {
      int x;
      RI(x);
      p[i][j] = x;
    }
}
struct Want {
  long double rp, sum;
  Want() : rp(1), sum(1) {}
  void add(long double d, long double pp) {
    sum += rp * pp * d;
    rp *= (1 - pp);
  }
  long double get() { return sum / (1 - rp); }
};
Want w[maxn];
bitset<maxn> vis;
void relax(int k) {
  vis[k] = 1;
  long double d = w[k].get();
  for (int i = (1); i <= int(n); i++)
    if (!vis[i]) w[i].add(d, p[i][k]);
}
long double eps = 1e-18;
void build() {
  for (int i = (1); i <= int(n); i++)
    for (int j = (1); j <= int(n); j++) p[i][j] = max(p[i][j] / 100, eps);
  w[n].rp = w[n].sum = 0;
  relax(n);
  while ((int)vis.count() < n) {
    int id = 0;
    long double d = 1;
    for (int i = (1); i <= int(n); i++)
      if (!vis[i])
        if (!id || w[i].get() < d) d = w[id = i].get();
    relax(id);
  }
}
void sol() { PL((double)w[1].get()); }
int main() {
  read();
  build();
  sol();
  return 0;
}
