#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5;
bool vis[N];
int n;
double f[N];
double p[N][N], pro[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1, tmp; j <= n; j++) {
      scanf("%d", &tmp);
      p[i][j] = 1.0 * tmp / 100.0;
    }
  }
  if (n == 1) {
    printf("0\n");
    return 0;
  }
  vis[n] = true;
  for (int i = 1; i < n; i++) {
    f[i] = 1;
    pro[i] = 1 - p[i][n];
  }
  for (int i = 1; i <= n; i++) {
    double minn = 1e18 + 7;
    int pos = 0;
    for (int j = 1; j <= n; j++) {
      if (!vis[j] && f[j] / (1 - pro[j]) < minn) {
        minn = f[j] / (1 - pro[j]);
        pos = j;
      }
    }
    if (pos == 1) {
      printf("%.12lf\n", f[1] / (1 - pro[1]));
      return 0;
    }
    vis[pos] = true;
    for (int j = 1; j <= n; j++) {
      if (!vis[j]) {
        f[j] += f[pos] / (1 - pro[pos]) * p[j][pos] * pro[j];
        pro[j] *= (1 - p[j][pos]);
      }
    }
  }
  return 0;
}
