#include <bits/stdc++.h>
using namespace std;
int n;
double A[1010], B[1010];
double p[1010][1010];
double dis(int u) { return (B[u] + 1) / (1 - A[u]); }
int mark[1010];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      scanf("%lf", &p[i][j]);
      p[i][j] /= 100;
    }
  for (int i = 1; i <= n - 1; i++) A[i] = 1;
  A[n] = 0, B[n] = -1;
  for (int k = 1; k <= n; k++) {
    int u = -1;
    for (int i = 1; i <= n; i++) {
      if ((u == -1 || dis(i) < dis(u) && !mark[i])) u = i;
    }
    mark[u] = 1;
    for (int v = 1; v <= n; v++) {
      if (mark[v]) continue;
      B[v] += A[v] * p[v][u] * dis(u);
      A[v] *= (1 - p[v][u]);
    }
  }
  printf("%.10f\n", dis(1));
  return 0;
}
