#include <bits/stdc++.h>
using namespace std;
const long long inf = 1505 * 1505, df = 1505;
double a[df], b[df], dis[df][df], sum[df][df];
long long n, vis[df];
inline long long read() {
  long long x = 0, y = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') y = (ch == '-') ? -1 : 1, ch = getchar();
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return x * y;
}
void upd(long long x, long long y) {
  for (long long i = (1); i <= (n); ++i) {
    if (!vis[i]) {
      a[i] += (a[y] / b[y]) * dis[i][y] * sum[i][x - 1];
      b[i] += -sum[i][x] + sum[i][x - 1];
    }
  }
}
void dij() {
  for (long long i = (1); i <= (n); ++i) {
    long long ty = 0;
    double mn = inf;
    for (long long j = (1); j <= (n); ++j) {
      if (!vis[j]) {
        if (a[j] / b[j] < mn) mn = a[j] / b[j], ty = j;
      }
    }
    vis[ty] = 1;
    for (long long j = (1); j <= (n); ++j) {
      if (!vis[j]) sum[j][i] = sum[j][i - 1] * (1.000000 - dis[j][ty]);
    }
    upd(i, ty);
  }
  return;
}
int main() {
  n = read();
  for (long long i = (1); i <= (n); ++i)
    for (long long j = (1); j <= (n); ++j)
      dis[i][j] = 1.0000 * read() / (1.0000 * 100);
  for (long long i = (1); i <= (n); ++i) sum[i][0] = 1.0000;
  for (long long i = (1); i <= (n); ++i) a[i] = 1, b[i] = 0;
  a[n] = 0, b[n] = 1;
  dij();
  printf("%.7lf", a[1] / b[1]);
}
