#include <bits/stdc++.h>
using namespace std;
const double inf = 1e20;
const double eps = 1e-9;
const int maxn = 1e3 + 3;
double p[maxn][maxn], f[maxn], g[maxn], P[maxn];
int n, vis[maxn];
int main() {
  scanf("%d", &n);
  for (register int i = 1; i <= n; i++)
    for (register int j = 1; j <= n; j++)
      scanf("%lf", &p[i][j]), p[i][j] /= 100.0;
  for (register int i = 1; i <= n; i++) g[i] = inf, f[i] = P[i] = 1;
  f[n] = g[n] = 0;
  for (register int i = 1; i <= n - 1; i++) {
    double tmp = inf;
    int bj = 0;
    for (register int j = 1; j <= n; j++)
      if (!vis[j] && g[j] < tmp) tmp = g[j], bj = j;
    vis[bj] = 1;
    for (register int j = 1; j <= n; j++) {
      if (vis[j]) continue;
      f[j] += tmp * P[j] * p[j][bj];
      P[j] *= 1.0 - p[j][bj];
      if (1.0 - P[j] < eps)
        g[j] = inf;
      else
        g[j] = f[j] / (1.0 - P[j]);
    }
  }
  printf("%.10lf\n", g[1]);
  return 0;
}
