#include <bits/stdc++.h>
using namespace std;
int n;
int mat[1003][1003];
double f[1003], p[1003];
bool vis[1003];
bool cmp(int, int);
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    p[i] = 1;
    for (int j = 1; j <= n; ++j) scanf("%d", mat[i] + j);
  }
  f[n] = p[n] = 0;
  while (true) {
    int pos = 0;
    double mn = 9999999999999;
    for (int i = 1; i <= n; ++i)
      if (!vis[i]) {
        double x = (f[i] + p[i]) / (1 - p[i]);
        if (x < mn) mn = x, pos = i;
      }
    if (!pos) break;
    vis[pos] = true;
    f[pos] = (f[pos] + p[pos]) / (1 - p[pos]);
    for (int i = 1; i <= n; ++i) {
      if (vis[i]) continue;
      double x = mat[i][pos] / 100.0;
      f[i] += (f[pos] + 1) * p[i] * x;
      p[i] *= (1 - x);
    }
  }
  printf("%.10lf\n", f[1]);
  return 0;
}
