#include <bits/stdc++.h>
int n, m;
double p[1005][1005];
double dist[1005];
double qhy[1005], zyg[1005];
bool flag[1005];
using namespace std;
void standing_by() {
  int i, j;
  scanf("%d", &n);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) {
      scanf("%lf", &p[i][j]);
      p[i][j] /= 100;
    }
  for (i = 0; i <= n; i++) {
    dist[i] = -1;
    qhy[i] = 1;
  }
  dist[n] = 0;
}
void complete() {
  int i, j, k;
  for (i = 1; i < n; i++) {
    for (j = 1, k = 0; j <= n; j++)
      if (!flag[j] && dist[j] >= 0 && (dist[j] <= dist[k] || dist[k] < 0))
        k = j;
    flag[k] = true;
    for (j = 1; j <= n; j++)
      if (!flag[j]) {
        zyg[j] += qhy[j] * p[j][k] * (1 + dist[k]);
        qhy[j] = qhy[j] * (1 - p[j][k]);
        if (1 - qhy[j] > 0)
          dist[j] = (zyg[j] + qhy[j]) / (1 - qhy[j]);
        else if (zyg[j] > 0)
          dist[j] = zyg[j];
      }
  }
  printf("%.10lf\n", dist[1]);
}
int main() {
  standing_by();
  complete();
  return 0;
}
