#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int f = 1, ans = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    ans = ans * 10 + c - '0';
    c = getchar();
  }
  return f * ans;
}
const int MAXN = 1e3 + 11;
int N, vis[MAXN];
double p[MAXN][MAXN];
double f[MAXN], now[MAXN];
double calc(int u) { return (f[u] + now[u]) / (1 - now[u]); }
void update(int u) {
  vis[u] = 1;
  for (int i = 1; i <= N; i++)
    if (!vis[i])
      f[i] += (calc(u) + 1) * p[i][u] * now[i], now[i] *= (1 - p[i][u]);
  return;
}
int main() {
  N = read();
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= N; j++) {
      int x = read();
      p[i][j] = (double)x / 100;
    }
  if (N == 1) {
    printf("0\n");
    return 0;
  }
  for (int i = 1; i < N; i++) now[i] = 1;
  update(N);
  while (1) {
    int ps = 0;
    for (int i = 1; i <= N; i++)
      if (!vis[i])
        if (!ps || calc(i) < calc(ps)) ps = i;
    update(ps);
    if (ps == 1) {
      printf("%.10lf\n", calc(1));
      return 0;
    }
  }
}
